Updated 2023-02-07

Run Bowtie2 on the Cluster

Summary

  • 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 ruSBATCHn 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.

Warning

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

Example SBATCH Script

#!/bin/bash
#SBATCH -J bowtie2Test
#SBATCH -A [Account] 
#SBATCH -N 2 --ntasks-per-node=8
#SBATCH -t 2
#SBATCH -q inferno
#SBATCH -o Report-%bt2Result.out

cd $SLURM_SUBMIT_DIR
module load bowtie2/2.4.2
bowtie2 -x <.genomes file> -U <.fq file> -S <allignment .sam file>
  • The #SBATCH directives are standard, requesting 2 hours of walltime and 2 nodes with 8 cores per node.
  • $SLURM_SUBMIT_DIR is simply a variable that represents the directory you submit the SBATCH script from. Make sure the .fastq .sam, and any other files you need are in the same directory you put the SBATCH script in. This line tells the cluster to enter this directory where you have stored the SBATCH script, and look for all the files for the job. If you use $SLURM_SUBMIT_DIR, you need to have all your files in the same folder as your SBATCH 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 SBATCH script.
  • module load bowtie2/2.4.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 SBATCH script, the .fasq files, the .sam file, and any other files you need.
  • Submit as normal, with sbatch <SBATCH script name>. In this case sbatch bowtie2.SBATCH or whatever you called the SBATCH script. You can name the SBATCH scripts whatever you want, just keep the .SBATCH at the end
  • Check job status with squeue -u username3sbatch, replacing "username3" with your gt username
  • You can delete the job with scancel 22182721, replacing the number with the jobid returned after running sbatch

Collect Results

  • All files created will be in the same folder where your SBATCH script is (same directory you ran sbatch 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