Question: filter vcf to include only sites which have at least one homozygous alt call
0
gravatar for Grey Monroe
8 months ago by
Grey Monroe10
Max Planck Institute
Grey Monroe10 wrote:

Hi all,

I am trying to extract a subset of sites from a multi-sample vcf file. I only want those sites with at least one homozygous alternative allele call. Some sites are poly-allelic so sites that I want would have at least one 1/1 or 2/2 call.

I've looked through bcftools, vcftools, but haven't found an elegant solution. For example, from the documentation it seems bcftools --genotype can filter for sites with at least one homozygous call, but these could be ref or alt, and I want specifically alt calls.

Any ideas would be greatly appreciated!

vcf • 350 views
ADD COMMENTlink modified 8 months ago by finswimmer13k • written 8 months ago by Grey Monroe10
1
gravatar for Pierre Lindenbaum
8 months ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum129k wrote:
 bcftools view -i 'N_PASS(GT="AA")>=1'  in.vcf

not tested: I don't know if it will accept 1/2 genotypes too.

ADD COMMENTlink modified 8 months ago • written 8 months ago by Pierre Lindenbaum129k
2

bcftools view -i 'GT="AA"' in.vcf should be enough, as the manual differs between AA (alt-alt hom) and Aa/aA (alt-alt het)

ADD REPLYlink written 8 months ago by finswimmer13k

Works perfect thank you

ADD REPLYlink written 8 months ago by Grey Monroe10
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: 1218 users visited in the last hour