[solved]bcftools breaks in for loop
1
0
Entering edit mode
5.7 years ago

I want to filter my bcf files for various criteria. If I use it on one single file, it works, but as soon as I for-loop it, it breaks with unknown command.

for n in /Volumes/Temp/PBI_CNV/results/*.bcf; do
        bcftools filter -i 'MAPQ>40' $n > ${n%*.bcf}_mapq.vcf
done

for m in /Volumes/Temp/PBI_CNV/results/*_mapq.vcf; do
        grep -vwE '(LowQual|##contig)' $m > ${m%*.vcf}_qual.vcf
done

Results me in:

[main] Unrecognized command.
[main] Unrecognized command.
[main] Unrecognized command.
[main] Unrecognized command.
[main] Unrecognized command.
[main] Unrecognized command.
[main] Unrecognized command.
[main] Unrecognized command.
[main] Unrecognized command.
[main] Unrecognized command.
[main] Unrecognized command.
[main] Unrecognized command.
[main] Unrecognized command.
[main] Unrecognized command.
[main] Unrecognized command.

As well as empty _mapq.vcf and _qual.vcf files. No additional error, so the loop seems to be working. Is this a bug?

bash bcftools bcf vcf for-loop • 1.6k views
ADD COMMENT
1
Entering edit mode
5.7 years ago
Asaf 10k

Might be a version issue try putting just bcftools inside the loop and see if it's the desired version

ADD COMMENT
0
Entering edit mode

Jep, was a version issue.

ADD REPLY

Login before adding your answer.

Traffic: 2163 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6