This is a test version of Biostars. For the public version, visit https://www.biostars.org.
question about Bowtie2 command

Hi, everyone,

I am running Bowtie2 to get mapped reads as well as unmapped reads. The following command gives mapped reads:

bowtie2 -x rRNA -U file.fq -S file.sam

And the below command gives unmapped reads:

bowtie2 -x rRNA -U file.fq --un file_filtered.fq

How to run one command to get both mapped and unmapped reads? THANK YOU!

bowtie2

1 answer

bowtie2 --un file_filtered.fq -x rRNA -U file.fq -S file.sam

Though keep in mind that the SAM file will have unmapped reads too, since you didn't specify --no-unal.

Hi Devon, thanks a lot!  My understanding is: in your command, the file.sam has both mapped and unmapped reads information. If I only want mapped reads information, I just add --no-unal option.  Is my understanding right? I just make it sure. THANKS!

In both yours and mine it'll have both mapped and unmapped alignments. If you just want the mapped alignments in it then bowtie2 --no-unal --un file_filtered.fq -x rRNA -U file.fq -S file.sam should work.

Hi Devon, Thanks a lot!

Log in to answer this question.