Updated 2021-05-17

Run Bowtie2 on the Cluster


  • Use module avail bowtie2 to see all the available versions of Bowtie2 on the cluster
  • Load Bowtie2 with module load bowtie2/<your version>
  • Run Bowtie2 with bowtie2 -x <.genomes file> -U <.fq file> -S <allignment .sam file>. Bowtie2 has many options and can be run many ways. The line above is simply a general template. When you login on the head node, load Bowtie2 and type bowtie2. A more detailed explanation on all the possible run options should appear.


In your PBS script, you must load Bowtie2 before you run Bowtie2

Example PBS Script

#PBS -N bowtie2Test
#PBS -A [Account] 
#PBS -l nodes=2:ppn=8
#PBS -l walltime=2:00
#PBS -q inferno
#PBS -j oe
#PBS -o bt2Result.out

module load bowtie2/2.3.2
bowtie2 -x <.genomes file> -U <.fq file> -S <allignment .sam file>
  • The #PBS directives are standard, requesting 2 hours of walltime and 2 nodes with 8 cores per node. More on #PBS directives can be found in the PBS guide
  • $PBS_O_WORKDIR is simply a variable that represents the directory you submit the PBS script from. Make sure the .fastq .sam, and any other files you need are in the same directory you put the PBS script in. This line tells the cluster to enter this directory where you have stored the PBS script, and look for all the files for the job. If you use $PBS_O_WORKDIR, you need to have all your files in the same folder as your PBS script otherwise the cluster won't be able to find the files it needs.
  • Output Files, will also show up in the same directory as the PBS script.
  • module load bowtie2/2.3.2 loads Bowtie2
  • bowtie2 -x <.genomes file> -U <.fq file> -S <allignment .sam file> runs Bowtie2. Again, this is just a general template. This line will vary based on what you are running.

Submit Job & Check Job Status

  • Make sure you're in the directory that contains the PBS script, the .fasq files, the .sam file, and any other files you need.
  • Submit as normal, with qsub <pbs script name>. In this case qsub bowtie2.pbs or whatever you called the PBS script. You can name the PBS scripts whatever you want, just keep the .pbs at the end
  • Check job status with qstat -u username3 -n, replacing "username3" with your gt username
  • You can delete the job with qdel 22182721, replacing the number with the jobid returned after running qsub

Collect Results

  • All files created will be in the same folder where your PBS script is (same directory you ran qsub from)
  • The .out file will be found here as well. It contains the results of the job, as well as diagnostics and a report of resources used during the job. If the job fails or doesn't produce the result you were hoping for, the .out file is a great debugging tool.
  • You can transfer the resulting files off the cluster using scp or a file transfer service