This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Get full sequence from sorted bam file

Hi, I got an indexed and sorted bam file from a colleague, and I also have the reference genome. My question is: how can I get a full sequence (eg. fasta file) from the bam file?

I googled some tools, but most of them are used to convert bam file into fasta, and the fasta file still contains segments of reads. I do not want to have these reads, I want to have a whole sequence.

Appreciated it for your answers!

assembly alignment sequencing

1 answer

You can create a consensus sequence from an aligned BAM file after calling SNP's. Basic procedure is described in this bcftools consensus help page.

Thank you very much! Your suggestion works good for me!

Log in to answer this question.