Hello
I have multiple normal and benign VCF files. I want to filter unique variants between normal and benign. How can i perform the filtering?
Thanks in advance.
Hello
I have multiple normal and benign VCF files. I want to filter unique variants between normal and benign. How can i perform the filtering?
Thanks in advance.
Before starting you have to merge all your vcf files into one, with e.g. bcftools merge.
After that, you can use bcftools view to find your variants of interest. Create a file with the sample names for your "normal" and one for your "benign" (one sample name per line). Than try this:
bcftools view -i '(COUNT(GT[@normal.txt] = "alt")> 0 && COUNT(GT[@benign.txt] = "alt") = 0) || (COUNT(GT[@normal.txt] = "alt") = 0 && COUNT(GT[@benign.txt] = "alt") > 0)' merged.vcf.gz
(Couldn't test it for now)
Make sure you are using a current version of bcftools (v1.9).
fin swimmer
Without looking at your data it is quite hard to help. Maybe this helpful for you: Is there a way to Scan and Correct bad vcf INFO values?
I understand that, but i cannot share the data. I already looked into the issue and I don't find any AS_MQ error in the VCF file. I also checked SNP as the error was showing as "Not ready for type [0]: SNP at 12783".
##INFO=<ID=SNP,Number=A,Type=Flag,Description="Variant is a SNP">
I have just encountered this same error message.
This problem is elaborated here: https://github.com/samtools/bcftools/issues/1685
You need to identify tags like this:
bcftools view -h "${vcf}" | grep -e "Number=A,Type=Flag"
Then, either follow the advice in the GitHub issue and recode them as Number=0,Type=Flag, or remove these if they are not needed:
bcftools annotate -x INFO/SNP,INFO/MNP "${vcf}"
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
So, you want to find variants that are called in at least 1 benign sample that are not called in any normal sample (and vice-versa)?
Yes, filter unique variants that are called in at least one benign sample that are not called in any normal sample and vice versa.