Question: filter unique variants from multiple VCF files
0
gravatar for anu.pullanhi
21 months ago by
anu.pullanhi0 wrote:

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.

snp next-gen vcf • 1.6k views
ADD COMMENTlink modified 20 months ago by Biostar ♦♦ 20 • written 21 months ago by anu.pullanhi0

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 modified 21 months ago • written 21 months ago by Kevin Blighe69k

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 written 20 months ago by anu.pullanhi0

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 modified 20 months ago • written 20 months ago by finswimmer14k

Hello

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

ADD REPLYlink written 20 months ago by anu.pullanhi0

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 written 20 months ago by finswimmer14k

sorry! i cannot share the data.

Thanks

ADD REPLYlink written 20 months ago by anu.pullanhi0

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 written 20 months ago by finswimmer14k

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 modified 20 months ago by finswimmer14k • written 20 months ago by anu.pullanhi0
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: 1389 users visited in the last hour
_