Question: Getting frequency of sites fixed within the sample (i.e. divergence sites) from VCF file
1
gravatar for JGuVa
16 months ago by
JGuVa10
JGuVa10 wrote:

Hi there,

I am trying to extract fixed sites within the sample from a VCF file. By fixed sites, I mean those that differ from the reference genome but that are fixed within the sample.

    REF    ALT ind_1   ind_2  ind_3
1    A      C    1/1    1/1     1/1
2    G      T    1/1    0/1     0/0
3    C      G    1/1    1/1     1/0
4    G      C    0/1    1/1     1/0
5    A      G    1/1    1/1     1/1

For instance, this is was a simplified version of a VCF file. In this case, sites 1 and 5 belong to this category of sites that contribute to divergence. Is there any tool on vcftools or R package that I can use for this purpose?

Thanks in advance.

snp sequence next-gen • 473 views
ADD COMMENTlink modified 16 months ago by finswimmer13k • written 16 months ago by JGuVa10

not clear to me. You want the variants where all the genotypes are homozygous for the ALT allele ?

ADD REPLYlink written 16 months ago by Pierre Lindenbaum127k

Yes, exactly, that is what I need.

ADD REPLYlink written 16 months ago by JGuVa10

In addition to Pierre: Is your data in this simplified format or a normal vcf?

ADD REPLYlink written 16 months ago by finswimmer13k

My file is a normal VCF, I presented it like that just for the sake of the explanation.

ADD REPLYlink written 16 months ago by JGuVa10
0
gravatar for Pierre Lindenbaum
16 months ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum127k wrote:

using vcffilterjdk http://lindenb.github.io/jvarkit/VcfFilterJdk.html

java -jar dist/vcffilterjdk.jar -e 'return variant.getGenotypes().stream().allMatch(G->G.isHomVar());' in.vcf
ADD COMMENTlink written 16 months ago by Pierre Lindenbaum127k
0
gravatar for finswimmer
16 months ago by
finswimmer13k
Germany
finswimmer13k wrote:

Using bcftools:

$ bcftools view -i 'COUNT(GT="AA")=N_SAMPLES' input.vcf

or

$ bcftools view -e 'GT[*]!="AA"' input.vcf

fin swimmer

ADD COMMENTlink modified 16 months ago • written 16 months ago by finswimmer13k
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: 1933 users visited in the last hour