vcftools on 2 snpeff vcf files
1
0
Entering edit mode
20 months ago
anasjamshed ▴ 140

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?

snpeff vcftools • 1.3k views
ADD COMMENT
2
Entering edit mode
20 months ago
raphael.B ▴ 520

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.

ADD COMMENT
0
Entering edit mode

I am trying this command :

 bcftools merge -m snps -Ou ctrl.vcf.gz clownvar.vcf.gz | bcftools norm -m- -Ou | bcftools view -i 'ANN~"non_synonymous" & N_PASS(gt="alt")=1'

But it throwing following error:

Error: Duplicate sample names (unknown), use --force-samples to proceed anyway.
Failed to read from standard input: unknown file type
Failed to read from standard input: unknown file type

How can I solve this issue?

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

do i need bgzip compressed vcf files with -merge?

ADD REPLY
0
Entering edit mode

Normally not

ADD REPLY

Login before adding your answer.

Traffic: 1965 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6