Bowtie 2 is an ultrafast and memory-efficient tool for aligning sequencing reads to long reference sequences. You can find more information about Bowtie2 here.
First we we must load the bowtie2 module. The easiest way to do the is to add it to your .bashrc
file, by including its load command.
module load bowtie2
In your home directory add a location to store the files to process in the example.
razor-l3:jokinsey:~$ mkdir BOWTIE-JOBS
Navigate into the directory and copy the necessary files from the examples in the bowtie2 application.
azor-l3:jokinsey:~$ cd BOWTIE-JOBS/ razor-l3:jokinsey:~/BOWTIE-JOBS$ cp /share/apps/bowtie2/bowtie2-2.2.3/example/reference/lambda_virus.fa . razor-l3:jokinsey:~/BOWTIE-JOBS$ cp /share/apps/bowtie2/bowtie2-2.2.3/example/reads/reads_1.fq .
Create a PBS
script in your $HOME/BOWTIE-JOBS/
directory to run the example that has all of the information listed below.
#!/bin/bash #PBS -q tiny12core #PBS -N bowtie2 #PBS -l nodes=1:ppn=12 #PBS -j oe #PBS -m abe #PBS -M jokinsey@uark.edu #PBS -l walltime=00:05:00 cd $PBS_O_WORKDIR cp lambda_virus.fa /scratch/$PBS_JOBID cp reads_1.fq /scratch/$PBS_JOBID cd /scratch/$PBS_JOBID bowtie2-build lambda_virus.fa lambda_virus bowtie2 -x lambda_virus -U reads_1.fq -S eg1.sam mv lambda_virus* eg1.sam $PBS_O_WORKDIR/
The PBS
script above copies the unindexed FASTA
file for the lambda virus and the FASTAQ
file containing the unpaired reads for the lambda phage to the /scratch/$PBS_JOBID
directory where we will run the computation.
The bowtie2-build
line will output files that represent the index for the Lambda phage reference genome. The line below that runs the bowtie2 aligner, and outputs the alginments to a SAM
file called eg1.sam
. Then the output lambdavirus index files and the alignment results stored in the eg1.sam
file, are moved to the $PBS_O_WORKDIR
directory where the job was submitted from.
Submit the job to the queue.
<code>
razor-l3:jokinsey:~/BOWTIE-JOBS$ qsub bowtie2.pbs
</code>
More information on how to interpret a SAM
file can be found here