Quick/dirty consensus from bam

50 views
Skip to first unread message

Darren Obbard

unread,
Aug 3, 2015, 12:22:02 PM8/3/15
to ashworth-c...@googlegroups.com, Sujai Kumar
Hi all,

What is the quickest (the one that requires me to learn the least) way
of getting a consensus fasta from a bam?

I am trying this

samtools mpileup -g -f myfasta.fas mybam.bam | \
bcftools consensus -i -f myfasta.fas -

But it doesn't work, possibly because (contrary to the examples) the vcf
must be tabix indexed

However, when I try

samtools mpileup -g -u -f myfasta.fas mybam.bam | bgzip -c temp.vcf.bz
tabix temp.vcf.bz
bcftools consensus -i -f myfasta.fas temp.vcf.bz

tabix fails with

[get_intv] the following line cannot be parsed and skipped: BCFÚ¡
[ti_index_core] the indexes overlap or are out of bounds


Example code would be very welcome...

--

Darren Obbard
Institute of Evolutionary Biology
University of Edinburgh
Ashworth Laboratories
Charlotte Auerbach Road
Edinburgh EH9 3FL
darren...@ed.ac.uk
Lab: 0131 651 3614 -- Office 0131 651 7781
Mobile: 07968 838 635 -- Home: 0131 466 0341
http://obbard.bio.ed.ac.uk/

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

Reply all
Reply to author
Forward
0 new messages