export alignment from BAM file
1
0
Entering edit mode
2.8 years 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!

bam samtools • 695 views
ADD COMMENT
2
Entering edit mode
2.8 years ago
GenoMax 141k

See if this answer helps: https://support.bioconductor.org/p/64748/#64755

ADD COMMENT
0
Entering edit mode

Exactly what I was looking for! Thanks

ADD REPLY
0
Entering edit mode

Please accept GenoMax's answer to mark the post resolved.

upvote_bookmark_accept

ADD REPLY

Login before adding your answer.

Traffic: 2394 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6