How do I extract aligned reads from BAM file?
1
0
Entering edit mode
6.8 years ago
MAPK ★ 2.1k

Hi, I have a fasta sequence to which I have aligned a fastq file using bowtie and got a BAM file. I need to extract all the reads in fastq file that aligned to my fasta sequence. Can I just extract all the reads from the BAM file I got from bowtie alignment in this case? Please suggest me if I should be doing something different. Thanks!

fastq bam • 4.7k views
ADD COMMENT
3
Entering edit mode
6.8 years ago

Yes, just use samtools fastq with the BAM file produced by bowtie2. You'll presumably want to use the -F 4 option.

ADD COMMENT
0
Entering edit mode

Thanks Devon. Since I will be extracting all the aligned reads from bam file, I had to use this command: samtools fasta input.bam -F 4 > output.fasta

ADD REPLY

Login before adding your answer.

Traffic: 1595 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