This is a test version of Biostars. For the public version, visit https://www.biostars.org.
vcf-consensus outputs sequence same as reference

I downloaded a fasta file with a consensus sequence and a vcf file with the variant for certain individual (both files from 1000 genomes). I'm trying to get the sequence for that individual. To do that, i'm using vcf-consensus like this (let's say the consensus is master.fasta and the vcf is HG02291.vcf.gz):

tabix -p vcf HG02291.vcf.gz
cat master.fasta | vcf-consensus HG02291.vcf.gz > HG02291.fasta

After I do that, I compare HG02291.fasta with master.fasta and they are the exact same files (same headers and sequences), therefore vcf-consensus is not applying any changes to master.fasta. I've tried the same procedure with many other samples and it still does not work. What am I doing wrong?

vcftools vcf-consensus 1000 genomes

Do you have multi-samples within the same vcf? If so, try the -s flag

2 answers

Here are two clues to consider:

1) Make sure the *vcf.gz file was zipped using bgzip. You could unzip them first and zip them again with bgzip from tabix
2) Make sure the chromosome IDs are same in VCF and fasta. Sometimes, it's "chr01" in one file, but "chr1" or "1" in another one.

i checked it twice but still showing problem> same output as reference fasta file

Please use ADD COMMENT to answer to earlier reaction, as such this thread remains logically structured and easy to follow.

Not a solution but I would recommend trying - a) rerunning with -s <sample_name> -i options b) running vcf-validator to check vcf

i checked it twice but still showing problem> same output as reference fasta file

Did you figured out what it was? Coz I'm struggling with the same.

Log in to answer this question.