Entering edit mode
23 months ago
luca
•
0
Dear all,
I'd like to export an alignment in a fasta (or similar) format from a bam file.
I know there are tools to extract the reads that cover a certain region, for example by doing:
samtools view -b -h bam_file.bam "chr1:2000-3000" > reads_bam_file.bam
samtools fasta reads_bam_file.bam > reads_bam_file.fasta
But this doesn't result in an alignment.
The reason I'd like to avoid repeat the alignment is that I might have several hundreds of reads, which make a de novo alignment not sustainable.
I haven't found so far a tool for doing this and I was wondering if anybody has suggestions
Thank you in advance!
Exactly what I was looking for! Thanks
Please accept GenoMax's answer to mark the post resolved.