I got my annotated variants in file1.vcf(control) and file2.vcf(clown) and now I need to find which non-synonymous SNPs are different between Sample Control and sample Clown. which command of vcftools I can use?
I got my annotated variants in file1.vcf(control) and file2.vcf(clown) and now I need to find which non-synonymous SNPs are different between Sample Control and sample Clown. which command of vcftools I can use?
Something like this should do the trick:
bcftools merge -m snps -Ou file1.vcf file2.vcf | bcftools norm -m- -Ou | bcftools view -i 'ANN~"non_synonymous" & N_PASS(gt="alt")=1' -Oz -o output.vcf.gz
1st command merges the 2 samples 2nd splits multeallic records that may appear during the emerging process 3rd selects records where only 1 sample is bearing alternative allele (het or hom)
Just as a recommandation, it is better if you can, to call your 2 samples together. Indeed, if you have a record in one file but none in the other at the same location, you have no way of knowing if this is because second sampes if hom ref at this location or if it is just a no call due to a technical issue.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
I am trying this command :
But it throwing following error:
How can I solve this issue?
Your 2 samples have the same names Just as the error message suggests, you can run
bcftools merge
with the--force-samples
to ignore the problem.do i need bgzip compressed vcf files with -merge?
Normally not