bcftools icon indicating copy to clipboard operation
bcftools copied to clipboard

bcftools call -T logical complement issue

Open plubbe opened this issue 2 years ago • 1 comments

Hiya -

I've been trying to use mpileup and call with a file of regions to exclude from the call command, like so: bcftools mpileup -Ou -f reference.fa input.bam | bcftools call -T ^reads_to_exclude.txt -c - > output.vcf

I keep getting an error to the following in the mpileup output: [E::hts_open_format] Failed to open file "^reads_to_exclude.txt" : No such file or directory. I guess this is because the file is called reads_to_exclude and not ^reads_to_exclude. The same problem happens if, for example, I use the -t flag and attempt to exclude sex chromosomes such as bcftools mpileup -Ou -f reference.fa input.bam | bcftools call -t ^X,Y -c - > output.vcf [E::hts_open_format] Failed to open file "^X,Y" : No such file or directory.

Clearly there's an issue with the presence of the logical complement operator ^, but I have no idea how to address this? I am using BCFtools 1.13.

plubbe avatar Feb 03 '22 04:02 plubbe

From various reasons the -t/-T option works differently in mpileup / call. I hope if you just pipe through bcftools view -t, it works?

pd3 avatar Feb 09 '22 13:02 pd3