Hi there I have a VCF file generated by hap.py
I need to first generate two files for SNPs and INDELs, respectively which I have done with the following commands:
bcftools view -V indels -l 9 -Oz -o eval_indels.vcf.gz eval.vcf.gz
to retain SNPs only, and
bcftools view -V snps -l 9 -Oz -o eval_indels.vcf.gz eval.vcf.gz
to retain INDELs only.
What I need to do next is to generate two files for each variant type (four in total) containing the FPs calls and the FNs calls only. Now, these are FORMAT values and the way I'm doing it is as follow (example for INDELs):
bcftools view -e 'BD="FN" && BD="TP" && BD="TN"' -l 9 -Oz -o eval_indelsFP.vcf.gz eval_indels.vcf.gz
to exclude everything but FPs values, and
bcftools view -e 'BD="FP" && BD="TP" && BD="TN"' -l 9 -Oz -o eval_indelsFN.vcf.gz eval_indels.vcf.gz
to exclude everything but FNs values. However, for some reason, I'm getting wrong output results where other classes of calls are still present. If helpful, I can attach an image of what eval_indels.vcf.gz
looks like. Thanks in advance!
It would be helpful to see the first few lines of your VCF file. However, the following might work:
If I understand well what you're trying to do, I would use the
||
operator instead of the&&