Question: Bowtie2 output alignments and non-alignments in same file
0
gravatar for zhangzhenyusz
2.1 years ago by
zhangzhenyusz20 wrote:

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!

rna-seq bowtie2 • 763 views
ADD COMMENTlink modified 2.1 years ago by Brian Bushnell16k • written 2.1 years ago by zhangzhenyusz20
0
gravatar for Brian Bushnell
2.1 years ago by
Walnut Creek, USA
Brian Bushnell16k wrote:

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 COMMENTlink written 2.1 years ago by Brian Bushnell16k

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

ADD REPLYlink written 2.1 years ago by zhangzhenyusz20

My mistake; for bacteria Bowtie2 is fine.

ADD REPLYlink written 2.1 years ago by Brian Bushnell16k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1961 users visited in the last hour