Bowtie2 is an ultrafast and memory-efficient tool for aligning sequencing reads to long reference sequences. Although Bowtie and Bowtie2 are both fast read aligners, there are few main differences between them:
Same as Bowtie, the first and basic step of running Bowtie2 is to build Bowtie2 index from a reference genome sequence. The basic usage of the command bowtie2-build is:
$ bowtie2-build -f input_reference.fasta index_prefix
The command bowtie2 takes a Bowtie2 index and set of sequencing read files and outputs set of alignments in SAM format. The general bowtie2 usage is:
$ bowtie2 -x index_prefix [-q|--qseq|-f|-r|-c] [-1 input_reads_pair_1.[fasta|fastq] -2 input_reads_pair_2.[fasta|fastq] | -U input_reads.[fasta|fastq]] -S bowtie2_alignments.sam [options]
input_reads.[fasta|fastq]
) and paired-end (input_reads_pair_1.[fasta|fastq]
, input_reads_pair_2.[fasta|fastq]
) files in fasta or fastq format. The format of the input files also needs to be specified by using one of the following flags: -q (fastq files), –qseq (Illumina’s qseq format), -f (fasta files), -r (raw one sequence per line), or -c (sequences given on command line).
An example of how to run Bowtie2 local alignment on Swan with paired-end fasta files and 8 CPUs
is shown below:
bowtie2_alignment.submit
#!/bin/bash
#SBATCH --job-name=Bowtie2
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=8
#SBATCH --time=168:00:00
#SBATCH --mem=10gb
#SBATCH --output=Bowtie2.%J.out
#SBATCH --error=Bowtie2.%J.err
module load bowtie/2.3
bowtie2 -x index_prefix -f -1 input_reads_pair_1.fasta -2 input_reads_pair_2.fasta -S bowtie2_alignments.sam --local -p $SLURM_NTASKS_PER_NODE
Bowtie2 outputs alignments in SAM format that can further be manipulated with different tools, like SAMtools and GATK. Each line from the file describes an alignment and is a collection of at least 12 fields separated by tabs. Detailed information about Bowtie2 output fields can be found in the Bowtie2 manual.