Question: Retrieval of similar positions from samples in a vcf but different from reference
1
gravatar for bioinfo8
2.8 years ago by
bioinfo8120
bioinfo8120 wrote:

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!

bcftools variant calling vcf • 1.1k views
ADD COMMENTlink modified 2.8 years ago by guillaume.rbt790 • written 2.8 years ago by bioinfo8120
0
gravatar for guillaume.rbt
2.8 years ago by
guillaume.rbt790
France
guillaume.rbt790 wrote:

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 COMMENTlink modified 2.8 years ago • written 2.8 years ago by guillaume.rbt790

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 REPLYlink modified 2.8 years ago • written 2.8 years ago by bioinfo8120
1

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

bcftools view --min-af 1 input.vcf.gz
ADD REPLYlink written 2.8 years ago by microfuge1.6k

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 REPLYlink written 2.8 years ago by guillaume.rbt790
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: 2049 users visited in the last hour