This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract alignment in fasta format from BAM/SAM file

Hi, I have a BAM file from aligning reads to a reference. What I would like is a fasta alignment file for each read showing the alignment between read and reference ie.

>read1

------A--C------GTATCTAGTCATGACT----------

Is there a tool/method that I can use that can extract the alignmments from a BAM and show in fasta format.

alignment bam

1 answer

The tool sam2pairwise does what you need:

https://github.com/mlafave/sam2pairwise

Log in to answer this question.