Directory argument for Bowtie2

928 views Asked by At

I'm using the software Bowtie 2 which aligns genome sequences. I have all my indexes in a directory miniReference1.

When I call Bowtie2 with the -x <dir> option I get the error that my index is not a Bowtie 2 index. What am I doing wrong? Below is a screenshot:

3

There are 3 answers

0
Anugerah Erlaut On

I had a similar issue running bowtie 2.5.0 against index files built by bowtie 2.4.5. The error message shows readU: No such file or directory even though the files are there.

enter image description here

I rebuilt the indexes using bowtie 2.5.0 and the issue was resolved. So I'd suggest rebuilding the indexes using the same version as the aligner, and then running it again.

8
Peter - Reinstate Monica On

I'm quoting the relevant part of the manual:

-x           The basename of the index for the reference genome. The basename is the name of any of the index files up to but not including the final .1.bt2 / .rev.1.bt2 / etc. bowtie2 looks for the specified index first in the current directory, then in the directory specified in the BOWTIE2_INDEXES environment variable. [Emphasis by me.]

After reading this, I assume that what was missing is to tell BowTie2 the directory it is supposed to look in by setting the environment variable BOWTIE2_INDEXES. In bash you would do that by issuing the command

export BOWTIE2_INDEXES=miniReference1

If that doesn't help try to provide the absolute path. It is unclear to me whether Bowtie2 expects a Posix path name like /c/Users/raghdad/Documents/project-x/sequences/miniReference1 or a Windows path name like C:\Users\.... (pwd in your terminal gives you the Posix name for the current directory).

The -x file base name argument, miniReference1, is correct but does not name a directory; instead, it tells BowTie2 the set of indexes you want to work with, which is identified by the common "base name" of the files (the part up to the first dot). The reason for this scheme is probably that you could have different sets of indexes in the same directory, and each set would have a distinct and unique base name. Of course your way of putting each set in its own directory appears to be much cleaner, unless there is a reason to assess several index sets in one go.

0
ATpoint On

The -x argument takes the path to the basename of the index. That means, if the index called miniReference1.{suffix} is inside a folder also called miniReference1 then it must be -x path/to/miniReference1/miniReference1. There is no need to use this variable, just use the plain path.