Question: Generating wrong consensus sequence using samtools + bcftools
gravatar for zhuhenan0514
3.4 years ago by
United Kingdom
zhuhenan05140 wrote:


I am trying to generate consensus sequence using samtools (v1.2) and bcftools (v1.2). Everything is just following the manual suggests and bam file was generated by bowtie2.

samtools mpileup -uf ref.fa aln.bam | bcftools call -c | vcf2fq > cns.fq


samtools mpileup -uf ref.fa aln.bam | bcftools call -mv -Oz -o calls.vcf.gz
tabix calls.vcf.gz
cat ref.fa | bcftools consensus calls.vcf.gz > cns.fa

Unfortunately, none of them gave me the right results. First, the consensus is longer than my reference sequences and it was fulfil by reference in which reads didn't cover. Second, if characters reported by reads are different from the reference, it will choose the reference.

I have attempted to change a lot of parameters but nothing works, but then I used the old version of samtools and bcftools to the same bam file, and everything is fine. So I got no idea what happened now.Please help.

Thank you.




ADD COMMENTlink written 3.4 years ago by zhuhenan05140
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: 1498 users visited in the last hour