Skip to content

Aligners

An aligner is a type of analysis software that matches short sequences, or reads, stored in FASTQ to a reference genome or transcriptome. STAR and HISAT2 are representative aligners for RNA-seq. Their output is stored in SAM/BAM, a file containing alignment information.

FASTQ -> alignment(STAR/HISAT2, etc.) -> SAM/BAM -> count/assembly/variant/fusion analysis

A DNA-seq aligner can generally assume that a read came from a continuous region of the genome. An RNA-seq read, however, comes from mature mRNA and can cross the joined boundary between exons, called a splice junction. From the genome’s perspective, the front of the read may need to align to exon 1 and the back to exon 2, thousands of base pairs away.

RNA-seq therefore usually requires a spliced aligner.

read: AAAAAAA|GGGGGGG
genome: exon 1 |---- intron ----| exon 2
alignment: AAAAAAA GGGGGGG
ToolReleased / introducedMain useKey characteristic
STAR2012/2013bulk RNA-seq, fusion, large cohortsVery fast spliced alignment, high memory use
HISAT22015 beta, 2019 paperbulk RNA-seq, low memory, graph indexHierarchical Graph FM index, can incorporate SNP and transcript information
TopHat / TopHat22009 / 2013Historically important RNA-seq alignerBowtie-based exon-first method, now generally a legacy tool
Subread / Subjunc2013expression counting, junction detectionSeed-and-vote strategy, same package ecosystem as featureCounts
Bowtie / Bowtie22009 / 2012Unspliced alignment of short readsBWT/FM-index based, unsuitable for RNA-seq spliced alignment by itself
BWA2009DNA-seq short-read alignmentOne of the standard BWT-based DNA aligners
minimap22018long reads, long RNA/cDNA, genome alignmentMinimizer based, important for long-read RNA-seq

RNA-seq alignment has four main challenges.

ProblemExplanation
splice junctionOne read can span two or more discontinuous positions in the genome
multi-mappingThe same read can align to multiple positions because of paralogs, pseudogenes, or repeats
sequencing error / variantA read may not exactly match the reference because of mismatches, indels, or SNPs
transcript ambiguityIsoforms share exons, making transcript-level assignment ambiguous

Splice junctions in particular are the key distinction between DNA-seq and RNA-seq aligners.

DNA-seq aligner: match a read to a continuous region of the genome
RNA-seq spliced aligner: split a read into exon segments and match them to discontinuous regions of the genome

Most modern aligners do not align an entire read from the beginning with dynamic programming. They first find short pieces of the read, called seeds, quickly in the reference, then extend the alignment around those candidate positions.

read: ACTGACCTGAACT...
seed: ACTGAC
candidate: a position where ACTGAC was found somewhere in the genome
extend: extend around it while evaluating mismatches, indels, and splices

This method connects to older ideas used by tools such as BLAST. The difference is the use of data structures such as suffix arrays, FM-indexes, and minimizer indexes to search an entire reference genome quickly.

These are important concepts in the Bowtie, BWA, and HISAT families. The Burrows-Wheeler Transform (BWT) and FM-index store a large genome string in compressed form while still enabling fast searches for short queries.

Advantages:

AdvantageExplanation
Low memoryKeeps the index for whole-genome searches relatively small
Fast exact and near-exact searchWell suited to searching for short-read seeds
Strong for short-read DNA/RNA alignmentA core data structure of the Illumina short-read era

The disadvantage is that they do not directly solve the problem of a read aligning to discontinuous regions of the reference, as in splicing. TopHat therefore ran Bowtie first and inferred junctions from the remaining reads, while HISAT and HISAT2 extended the FM-index structure for RNA-seq.

STAR makes extensive use of an uncompressed suffix array rather than a compressed FM-index. This makes seed searches very fast, but loading a human genome index requires substantial memory.

A key term in the STAR paper is Maximal Mappable Prefix (MMP). STAR starts at the front of a read and finds the longest prefix that can align to the reference. If a splice or mismatch interrupts it, STAR searches for another seed in the remaining portion.

read: exonA_part | exonB_part
MMP 1: exonA_part
MMP 2: exonB_part
stitching: connect the two seeds through a splice junction to form one alignment

STAR (Spliced Transcripts Alignment to a Reference) is an RNA-seq aligner whose paper was published online in 2012 and appeared in Bioinformatics in 2013. It was developed to process large transcriptome datasets such as ENCODE quickly.

Core algorithm:

ItemDetails
indexuncompressed suffix array
seed searchsequential maximum mappable seed search, Maximal Mappable Prefix (MMP)
splice handlingcreates split alignments through seed clustering, stitching, and scoring
annotation useGTF splice junctions can be included during index generation to improve sensitivity
outputsupports sorted BAM, splice junction tables, chimeric junctions, and other outputs

STAR’s major advantage is speed. Its paper reported much faster performance than other RNA-seq aligners of the time, and it remains widely used in bulk RNA-seq pipelines. It is often selected for these situations:

SituationWhy STAR fits
Human/mouse bulk RNA-seqA well-validated default choice
Processing many samplesVery fast when given CPU resources
Fusion transcript discoveryCan use chimeric alignment output
Novel splice junction discoveryCan find junctions without annotation

Cautions:

CautionExplanation
Memory useA human genome index may require tens of GB of RAM
Parameter effectsMulti-mapping, chimeric alignment, and splice-overhang settings change results
Very short readsJunctions are harder to detect reliably and depend more on annotation

In practice, GTF is usually included when building the index.

Terminal window
STAR \
--runThreadN 8 \
--runMode genomeGenerate \
--genomeDir star_index \
--genomeFastaFiles genome.fa \
--sjdbGTFfile annotation.gtf \
--sjdbOverhang 100

--sjdbOverhang is usually set to read length - 1. For example, use 100 for a 101 bp read.

HISAT2 is the successor to HISAT. A beta release appeared in 2015, and the HISAT2 paper covering graph-based genome alignment and genotyping was published in Nature Biotechnology in 2019.

The core of HISAT2 is its Hierarchical Graph FM index (HGFM).

ItemDetails
indexglobal FM/GFM index plus many local FM/GFM indexes
graph supportcan include SNP, haplotype, and transcript information in the index
memorycan align to the human genome with much less memory than STAR
RNA-seq supportsplice-aware alignment, can use known splice-site and exon information

HISAT2 has a smaller memory burden than STAR. It is a good choice when RNA-seq alignment must run on an ordinary server or personal workstation.

Terminal window
hisat2 \
-p 8 \
--dta \
-x genome_index \
-1 sample_R1.fastq.gz \
-2 sample_R2.fastq.gz \
-S sample.sam

--dta reports alignments in a form convenient for downstream transcript assemblers such as StringTie.

Advantages:

AdvantageExplanation
Low memoryRelatively manageable even in desktop-class environments
FastStrong short-read processing through an FM-index
Graph indexCan incorporate known SNPs and variants into the reference
Works well with StringTieOften presented as the HISAT2 + StringTie + Ballgown pipeline

Cautions:

CautionExplanation
Fusion analysisLess common than tools based on STAR chimeric output
Preparing a graph indexIndexes including SNPs or transcripts can complicate preparation and file management
Parameters require understandingUse of known and novel splice sites and --dta depends on the purpose

TopHat, released in 2009, was an early RNA-seq spliced aligner. It first used Bowtie to align reads that mapped continuously to the genome, then used the remaining reads to find splice junctions.

1. First align unspliced reads with Bowtie
2. Collect unaligned reads and infer exon islands and junction candidates
3. Perform spliced alignment including the junctions

TopHat is historically important. The combination of TopHat and Cufflinks was widely used in the “Tuxedo pipeline” during the early years of RNA-seq analysis. For new analyses today, STAR or HISAT2 is generally recommended instead.

ItemTopHat
AdvantagePopularized RNA-seq spliced alignment
LimitationSlow and inefficient for modern read lengths and large datasets
Current roleLegacy tool, mainly encountered when reproducing older papers or maintaining old pipelines

TopHat2 improved handling of insertions, deletions, fusion transcripts, and other situations. Even so, modern new analyses generally use HISAT2 or STAR instead of TopHat2.

Subread, released in 2013, uses a seed-and-vote strategy. It extracts multiple seeds from a read, maps them to the reference, and selects the genomic location supported by the greatest number of seeds.

ToolExplanation
SubreadUsed for genomic read alignment and RNA-seq expression analysis
SubjuncA tool in the Subread family specialized for RNA-seq junction detection
featureCountsA read-counting tool in the same package, very commonly used to create RNA-seq count matrices

Subread itself is mentioned less often than STAR or HISAT2 as an RNA-seq aligner, but the Subread package is extremely common in RNA-seq analysis because of featureCounts.

Pseudoalignment and quasi-mapping: are they aligners?

Section titled “Pseudoalignment and quasi-mapping: are they aligners?”

Tools such as Salmon and kallisto also appear frequently in RNA-seq expression estimation. They differ from genome aligners in the traditional sense.

MethodRepresentative toolsOutputCharacteristic
genome alignmentSTAR, HISAT2BAM/SAMRecords where each read aligns in the genome
transcriptome quantificationSalmon, kallistotranscript/gene abundance tableQuickly calculates compatibility with a transcriptome

kallisto uses pseudoalignment, while Salmon uses quasi-mapping or selective alignment. Instead of generating a complete base-level alignment for every read, these methods quickly determine which transcripts are compatible with a read and estimate abundance.

Salmon and kallisto are therefore very fast and practical when the goal is gene or transcript expression quantification. A genome aligner is needed for these other goals:

GoalWhy genome alignment is needed
Novel splice junctionsMust directly inspect exon-exon connections on the genome
Fusion transcriptsRequires chimeric alignments spanning distant loci or chromosomes
RNA editing / variant candidatesRequires reference coordinates and base-level mismatches
IGV visualizationRequires BAM for inspection in a genome browser

Bowtie is a BWT-based short-read aligner released in 2009. Its speed and low memory use made it important in early NGS analysis.

Bowtie focused on rapidly aligning short reads to a reference and was close to ungapped alignment by default. Bowtie2, released in 2012, improved handling of gapped alignments and longer reads.

Bowtie and Bowtie2 do not directly handle splice junctions in RNA-seq. They instead serve supporting roles such as:

UseExplanation
TopHat’s internal alignerTopHat constructs spliced alignments on top of Bowtie/Bowtie2
Transcriptome alignmentAligning reads to a transcript FASTA in which splicing is already represented
QC / contamination checksRapid mapping to rRNA, adapters, microbial sequences, and similar references

BWA (Burrows-Wheeler Aligner) is a DNA-seq short-read aligner released in 2009. It includes the BWA-backtrack, BWA-SW, and BWA-MEM families, and BWA-MEM was a standard choice for WGS and WES analysis for many years.

ItemBWA
Main useDNA-seq, WGS, WES, targeted sequencing
indexBWT based
Role in RNA-seqUnsuitable as the default aligner for ordinary mRNA RNA-seq because it is not a spliced aligner

BWA can align RNA-seq reads that map to a continuous region of the genome, but it cannot naturally handle reads crossing exon-exon junctions.

minimap2 is a general-purpose pairwise aligner released in 2018. It supports some short-read use cases but is especially strong for long reads and alignment between large sequences.

SituationWhy minimap2 is often used
Oxford Nanopore / PacBio long readsHandles long reads and high error rates
Long-read RNA-seqSpliced alignment of full-length cDNA and direct RNA reads
Assembly to referenceAligns contigs or an assembly to a reference
Genome-to-genome comparisonFast alignment between large sequences

minimap2 uses minimizers as seeds. It selects representative k-mers from the read and reference to find candidate positions quickly, then creates the final alignment through chaining and alignment extension.

For short-read Illumina bulk RNA-seq, STAR and HISAT2 are usually more familiar choices. minimap2 appears very frequently in long-read transcriptome analysis.

These tools were important aligners that addressed RNA-seq and spliced alignment before or around the same time as STAR and HISAT2.

ToolCharacteristic
GMAPA long-established splice-aware mapper for aligning cDNA/EST to a genome
GSNAPA short-read aligner in the GMAP family, supporting SNP-tolerant alignment and splicing
MapSpliceAn RNA-seq aligner focused on splice-junction discovery

They are not the most common choices for new bulk RNA-seq analyses today, but they can still appear in result files or methods descriptions from older papers and particular pipelines.

GoalRecommended choiceReason
Ordinary human/mouse bulk RNA-seqSTAR or HISAT2The most widely validated spliced aligners
Plenty of RAM and fast processing requiredSTARFast and well supported by downstream tools
Limited RAMHISAT2Low memory use
Transcript assembly with StringTieHISAT2 --dta or STARProduces BAM files convenient for assemblers
Fusion transcript discoverySTAR + Arriba/STAR-Fusion, etc.Strong chimeric-alignment ecosystem
Simple expression quantificationAlso consider Salmon/kallistoFast abundance estimates without BAM
Long-read RNA/cDNAminimap2Strong for spliced alignment of long reads
Short-read DNA-seq WGS/WESBWA-MEM/BWA-MEM2 familyUse a DNA aligner because there is no splicing
Long-read DNA-seqminimap2Strong for Nanopore/PacBio long-read alignment

For practice, begin with either STAR or HISAT2 to create a BAM file and inspect the alignments directly in IGV. Seeing how reads cross exon-exon junctions makes the concept of RNA-seq alignment much quicker to grasp.

Whichever aligner you use, you will usually inspect BAM/SAM in the end. The important items are:

ItemMeaning
mapping rateProportion of all reads that aligned to the reference
uniquely mapped readsReads confidently aligned to only one location
multi-mapped readsReads that align similarly well to several locations
splice junction supportNumber of reads crossing a junction
MAPQMapping quality representing alignment confidence
CIGAREncodes matches, insertions, deletions, splice skips, and other operations

N is an especially important CIGAR character in RNA-seq BAM. It means that a long region of the reference was skipped, which usually represents an intron in RNA-seq.

50M1000N50M

This read aligned its first 50 bp to one exon, skipped 1,000 bp of the reference, and aligned its last 50 bp to the next exon.

1. Match the genome FASTA and GTF versions

Section titled “1. Match the genome FASTA and GTF versions”

STAR and HISAT2 can both use annotations. The genome build, chromosome names, and release version of the genome FASTA and GTF must match.

Good: GRCh38 FASTA + GENCODE v46 GRCh38 GTF
Risky: GRCh37 FASTA + GRCh38 GTF
Risky: FASTA uses chr1, GTF uses 1

2. Record alignment parameters with the results

Section titled “2. Record alignment parameters with the results”

RNA-seq alignment is highly sensitive to parameters. At minimum, record the following in a paper or notebook:

aligner: STAR 2.7.x
genome: GRCh38
annotation: GENCODE v46
key options: --sjdbOverhang 100, --outSAMtype BAM SortedByCoordinate

In gene families, pseudogenes, and repetitive regions, a read may align to several places. Aligners differ in how they report multi-mapping reads, and counting tools differ in how they handle them.

4. A “fast aligner” is not always the better answer

Section titled “4. A “fast aligner” is not always the better answer”

The right choice depends on the purpose. If you need only expression quantification, Salmon or kallisto may be more practical. If you want to inspect fusions or novel junctions, you need spliced genome alignment. If you want to examine variant candidates, base-level alignment and post-processing matter.

The default choice for short-read RNA-seq is STAR or HISAT2.
STAR is fast and feature-rich but uses substantial memory.
HISAT2 offers low memory use and a graph FM index.
TopHat is historically important but generally a legacy choice for new analyses.
Think of Bowtie and BWA as DNA or unspliced short-read aligners.
minimap2 is important for long-read RNA/cDNA and genome alignment.
Salmon and kallisto estimate transcript abundance rather than serving as traditional aligners.
  • Dobin A. et al. STAR: ultrafast universal RNA-seq aligner. Bioinformatics 29(1), 15-21 (2013). DOI: 10.1093/bioinformatics/bts635
  • Kim D. et al. HISAT: a fast spliced aligner with low memory requirements. Nature Methods 12, 357-360 (2015). DOI: 10.1038/nmeth.3317
  • Kim D. et al. Graph-based genome alignment and genotyping with HISAT2 and HISAT-genotype. Nature Biotechnology 37, 907-915 (2019). DOI: 10.1038/s41587-019-0201-4
  • Trapnell C., Pachter L., Salzberg S. L. TopHat: discovering splice junctions with RNA-Seq. Bioinformatics 25(9), 1105-1111 (2009). DOI: 10.1093/bioinformatics/btp120
  • Kim D. et al. TopHat2: accurate alignment of transcriptomes in the presence of insertions, deletions and gene fusions. Genome Biology 14, R36 (2013). DOI: 10.1186/gb-2013-14-4-r36
  • Langmead B. et al. Ultrafast and memory-efficient alignment of short DNA sequences to the human genome. Genome Biology 10, R25 (2009). DOI: 10.1186/gb-2009-10-3-r25
  • Langmead B., Salzberg S. L. Fast gapped-read alignment with Bowtie 2. Nature Methods 9, 357-359 (2012). DOI: 10.1038/nmeth.1923
  • Li H., Durbin R. Fast and accurate short read alignment with Burrows-Wheeler transform. Bioinformatics 25(14), 1754-1760 (2009). DOI: 10.1093/bioinformatics/btp324
  • Liao Y., Smyth G. K., Shi W. The Subread aligner: fast, accurate and scalable read mapping by seed-and-vote. Nucleic Acids Research 41(10), e108 (2013). DOI: 10.1093/nar/gkt214
  • Li H. Minimap2: pairwise alignment for nucleotide sequences. Bioinformatics 34(18), 3094-3100 (2018). DOI: 10.1093/bioinformatics/bty191
  • HISAT2 official documentation: https://daehwankimlab.github.io/hisat2/
  • STAR source and manual: https://github.com/alexdobin/STAR
  • minimap2 source and manual: https://github.com/lh3/minimap2