Bowtie2
In this section:
Description
According to the Bowtie2 page, Bowtie2 is an ultrafast and memory-efficient tool for aligning sequencing reads to long reference sequences. It is particularly good at aligning reads of about 50 to 1000 characters, and particularly good at aligning to relatively long genomes (e.g., mammalian).
Available Versions
bowtie2/2.3.5.1
Job Submission
#!/bin/bash
#SBATCH -J bowtie2
#SBATCH -N 1
#SBATCH -c 8
#SBATCH -t 24:00:00
#SBATCH --mem=16G
export INPUT="reference.fa reads.fq"
export OUTPUT="aligned.sam"
module load bowtie2/2.3.5.1
# Build index
bowtie2-build reference.fa reference_index
# Align reads
job-nanny bowtie2 -x reference_index -U reads.fq -S aligned.sam -p $SLURM_CPUS_PER_TASK
Paired-end Alignment
#!/bin/bash
#SBATCH -J bowtie2_paired
#SBATCH -N 1
#SBATCH -c 8
#SBATCH -t 24:00:00
#SBATCH --mem=16G
export INPUT="reference.fa reads_1.fq reads_2.fq"
export OUTPUT="aligned.sam"
module load bowtie2/2.3.5.1
# Build index
bowtie2-build reference.fa reference_index
# Align paired-end reads
job-nanny bowtie2 -x reference_index -1 reads_1.fq -2 reads_2.fq -S aligned.sam -p $SLURM_CPUS_PER_TASK
Script Processing
#!/bin/bash
#SBATCH -J bowtie2_script
#SBATCH -N 1
#SBATCH -c 8
#SBATCH -t 24:00:00
#SBATCH --mem=16G
export INPUT="reference.fa reads/ run.sh"
export OUTPUT="results/"
module load bowtie2/2.3.5.1
job-nanny ./run.sh
#!/bin/bash
echo "====================[ Building index ]===================="
bowtie2-build reference/lambda_virus.fa lambda_virus
echo "====================[ Aligning ]===================="
bowtie2 -x lambda_virus -U reads/reads_1.fq -S eg1.sam -p 8
echo "====================[ Processing SAM ]===================="
samtools view -bS eg1.sam > eg1.bam
samtools sort eg1.bam -o eg1.sorted.bam
samtools index eg1.sorted.bam
mkdir -p results
mv eg1.* results/
Important Options
Option |
Description |
|---|---|
|
Reference index (prefix) |
|
Paired-end file 1 |
|
Paired-end file 2 |
|
Single-end file |
|
Output SAM file |
|
Number of threads |
|
More sensitive mode (slower) |
|
Faster mode (less sensitive) |
|
Input is FASTQ |
|
Input is FASTA |
References
Documentation: https://bowtie-bio.sourceforge.net/bowtie2/manual.shtml
See also
RSEM - Transcriptome quantification with Bowtie2
Running Simulations - How to submit jobs