Question: [solved]bcftools breaks in for loop
0
gravatar for maximilian.mayerhofer
28 days ago by
maximilian.mayerhofer20 wrote:

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?

for-loop bcf bash bcftools vcf • 103 views
ADD COMMENTlink modified 28 days ago • written 28 days ago by maximilian.mayerhofer20
1
gravatar for Asaf
28 days ago by
Asaf5.5k
Israel
Asaf5.5k wrote:

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

ADD COMMENTlink written 28 days ago by Asaf5.5k

Jep, was a version issue.

ADD REPLYlink written 28 days ago by maximilian.mayerhofer20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1783 users visited in the last hour