Biostar Beta. Not for public use.
filter unique variants from multiple VCF files
0
Entering edit mode
13 months ago

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.

ADD COMMENTlink
0
Entering edit mode

I want to filter unique variants between normal and benign

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)?

ADD REPLYlink
0
Entering edit mode

Yes, filter unique variants that are called in at least one benign sample that are not called in any normal sample and vice versa.

ADD REPLYlink
0
Entering edit mode

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

ADD REPLYlink
0
Entering edit mode

Hello

While using bcftools merge, i get error "Not ready for type [0]: SNP at 12783".

ADD REPLYlink
0
Entering edit mode

Hello again,

could you please show the complete header (the lines starting with a #) and the first few variant lines of your vcf file?

fin swimmer

ADD REPLYlink
0
Entering edit mode

sorry! i cannot share the data.

Thanks

ADD REPLYlink
0
Entering edit mode

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?

ADD REPLYlink
0
Entering edit mode

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">
ADD REPLYlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.1