Question: Does bowtie2 take gz input files?
gravatar for f.dinesh
4 weeks ago by
f.dinesh0 wrote:

Hi I'm trying to properly input files to bowtie2 and I'm first of all confused if bowtie2 can take fq.gz files or not? or do they need to be unizipped first (.fq)?

Thanks, Dinesh

gzip fq.gz gz gzip input bowtie2 • 201 views
ADD COMMENTlink modified 4 weeks ago by ATpoint25k • written 4 weeks ago by f.dinesh0

Have you tried running the command or reading the manual? What did the manual say?

ADD REPLYlink written 4 weeks ago by RamRS24k

Yes I did run the code with the gz files and it failed saying that there is no such directory. I unzipped the files and ran the same code and its running so I think it works. But i'm sure that it should accept gz files, the manual says it does. I'm wondering what is the difference between these pieces of code:

bowtie2 [options]* -x <bt2-idx> {-1 <m1> -2 <m2> | -U <r> | --interleaved } [-S <sam>]


$BT2_HOME/bowtie2 -x $BT2_HOME/example/index/lambda_virus -1 $BT2_HOME/example/reads/reads_1.fq -2 $BT2_HOME/example/reads/reads_2.fq -S eg2.sam

The top code mentions it can accept .gz or .bz2 however these did not work. I have paired read files so from my understanding m1 is R1 file and m2 is R2 file name. I don't have any unpaired reads so -U was deleted my files are also not interleaved so all thats left is this:

bowtie2 -p 4 -x atccxxxx {-1 ND_R1.fq.gz -2 ND_R2.fq.gz} [-S <sam>]

This is the code I ended up using

bowtie2 -p 4 -x atccxxxx -1 ND_Rep1_R1_val_1.fq, -2 ND_Rep1_R2_val_2.fq -S nd1sam.sam

Can anyone provide some help on why the initial commands didn't work? Thank you so much!

ADD REPLYlink modified 4 weeks ago • written 4 weeks ago by f.dinesh0

I'm pretty rusty with bowtie, but I'm pretty sure the braces and brackets are not meant to be taken literally. That's why your command line without them worked (though I'm surprised the comma was acceptable)

ADD REPLYlink written 4 weeks ago by swbarnes27.0k

Exactly thanks! The brackets were confusing me, all good now!

ADD REPLYlink written 4 weeks ago by f.dinesh0

did not work

That is not a sufficient explanation of what went wrong. Please tell us what you expected to happen, what happened and why you think it happened and what you think the error is.

ADD REPLYlink written 4 weeks ago by RamRS24k

bowtie2 can use gzipped files for alignment (for reference my version is

ADD REPLYlink written 4 weeks ago by genomax74k
Please log in to add an answer.


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