Retrieval of similar positions from samples in a vcf but different from reference
1
1
Entering edit mode
6.7 years ago
bioinfo8 ▴ 230

Hi,

I have a vcf file (for "a" type of samples) a_filtered_ann10.vcf annotated for 10 genes by bcftools and consists of 5 samples and similarly b_filtered_ann10.vcf . I have visualized both the vcf files in IGV and can see the variation with respect to the reference.

Now, I would like to retrieve only those positions from each file which are similar among the samples but different from the reference.

Any guidance would be appreciated.

Thanks!

vcf bcftools variant calling • 1.9k views
ADD COMMENT
0
Entering edit mode
6.7 years ago
guillaume.rbt ★ 1.0k

Hi, If you want to get snps where all samples are different from the ref you can use SnpSift filter ( http://snpeff.sourceforge.net/SnpSift.html ) and filter on the genotype field.

ADD COMMENT
0
Entering edit mode

Thanks. SnpSift is part of SnpEff distribution and I tried annotating my variants using SnpEff but it showed error: unknown input vcf format and hence, I used bcftools for annotation (where I did not find such issue). Therefore, I want to use non-SnpEff based solution.

ADD REPLY
1
Entering edit mode

Would bcftools view work if min alternate allele frequency is set to 1.0 ?

bcftools view --min-af 1 input.vcf.gz
ADD REPLY
0
Entering edit mode

Maybe you can just filter all non variant genotypes of your vcf :

cat your_vcf.vcf | grep -v "0/0"

Then you will have only variants with all samples being homozygote or heterozygote.

ADD REPLY

Login before adding your answer.

Traffic: 2514 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6