Question: vcf-consensus Error: Fasta sequence does not match REF
gravatar for colin.kern
4.2 years ago by
United States
colin.kern930 wrote:

I'm using this series of commands to get consensus sequences:

samtools mpileup -vf seqs.fa aligned.bam > vcf.gz
tabix -p vcf -f vcf.gz
cat seqs.fa | vcf-consensus vcf.gz > consensus.fa

(I was trying to do this using bcftools/ but was having a different problem I've finally given up on)

I'm getting this error:

The fasta sequence does not match the REF at XLOC_000009.TCONS_00000016:733. G(GTTATA) in .fa, C in .vcf, frz=0

but if I check the fasta sequence using samtools faidx, it gives the C that's expected:

$ samtools faidx seqs.fa XLOC_000009.TCONS_00000016:733

These warnings from before the error might be relevant?

The version "4.2" not supported, assuming VCFv4.1
Note: Conflicting variants at (or near) XLOC_000009.TCONS_00000016:725, cannot apply both.

Does anyone know why I'm getting this error and how to fix it?


The line in the vcf at this location is:

XLOC_000009.TCONS_00000016      733     .       C       <*>     0       .       DP=14;I16=0,8,0,0,222,6594,0,0,336,14112,0,0,0,0,0,0;QS=1,0;MQ0F=0      PL      0,24,128

I noticed it's the last line/position for that sequence.

ADD COMMENTlink modified 4.2 years ago • written 4.2 years ago by colin.kern930
gravatar for microfuge
4.2 years ago by
microfuge1.8k wrote:

Can you please print the vcf line at the position ? Conflicting variants would mean it is a heterozygous genotype and it does not know which allele to put in the fasta.

ADD COMMENTlink written 4.2 years ago by microfuge1.8k

I've added the vcf line to my post.

ADD REPLYlink written 4.2 years ago by colin.kern930

Hi microfuge, I am getting the same error and I mapping reads from several genotypes to one heterozygous reference and was hoping to get the consensus files for each genotype. Does this error mean it is not possible to get the consensus for each genotype individually?

ADD REPLYlink written 3.9 years ago by Illinu90
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1363 users visited in the last hour