Question: [solved]bcftools breaks in for loop
0
gravatar for maximilian.mayerhofer
10 months 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 • 362 views
ADD COMMENTlink modified 10 months ago • written 10 months ago by maximilian.mayerhofer20
1
gravatar for Asaf
10 months ago by
Asaf6.9k
Israel
Asaf6.9k wrote:

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

ADD COMMENTlink written 10 months ago by Asaf6.9k

Jep, was a version issue.

ADD REPLYlink written 10 months 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: 1181 users visited in the last hour