This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to intersect data from four different annotated files using ubuntu commands?

I have three affected and one unaffected VCF and annotated files from exome analysis. I want to compare the variants present in the affecteds and absent in unaffected data.

How can I pull out the variants unique to affected individuals from all the four files?

Kindly help.

ubuntu vcf annotation filtering variants

1 answer

merge the vcf files with bcftools and the use an expression to test the 3 affected genotypes and the non-affected genotype:

bcftools merge src/test/resources/S[1-4].vcf.gz | \
bcftools  view -i '(GT[0]=="AA" || GT[0]=="RA")  && (GT[1]=="AA" || GT[1]=="RA") && (GT[2]=="AA" || GT[2]=="RA") &&  (GT[3]=="RR" )'

Thanks for the help. GT[1] == "AA" represents the missing variants among the affecteds data, is it?

AA = "alt+alt" homozygous for the alternative allele(s)

Thanks for timely help.

If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted.
Upvote|Bookmark|Accept

Log in to answer this question.