Bowtie2 output alignments and non-alignments in same file
1
0
Entering edit mode
6.7 years ago

Hi everybody,

I'm using Bowtie2 and I'm trying to output the alignments to a SAM file and unmapped to fastq file. I know --no-unal option make sam file only contain the mapped reads; however, my fastq files will have zero content because all unmapped reads are omitted. Does anyone know any option(s) to fulfil both goals.

Thank you!

Bowtie2 RNA-Seq • 1.7k views
ADD COMMENT
0
Entering edit mode
6.7 years ago

I've revised your post to a question, as it is not a tool post. Also, Bowtie2 is not a good tool for RNA-seq since it is not splice-aware.

You can filter out unmapped reads from the sam file after the fact, and convert the filtered reads to fastq, with BBMap's reformat.sh:

reformat.sh in=reads.sam out=mapped.sam mappedonly
reformat.sh in=reads.sam out=unmapped.fq unmappedonly

Or use BBMap in the first place (which is splice aware) like this:

bbmap.sh in=reads.fq outm=mapped.sam outu=unmapped.fq ref=ref.fa maxindel=200k
ADD COMMENT
0
Entering edit mode

Oh I'm actually on bacteria. Thank you for the BBMap one.

ADD REPLY
0
Entering edit mode

My mistake; for bacteria Bowtie2 is fine.

ADD REPLY

Login before adding your answer.

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