🧬 Hub

HISAT2 RNA-Seq Spliced Alignment Lab

Hierarchical Graph FM Indexing, Splice Junction Discovery & Downstream Transcript Assembly

← Back to Hub

⚡ Fast, Accurate Splice-Aware RNA-Seq Mapping

HISAT2 uses a Hierarchical Graph FM Index (HGFM) that represents the entire human or target genome with millions of splice junctions in ~4.5 GB of RAM. Reads spanning exon-exon junctions are mapped with high sensitivity, directly feeding into StringTie and featureCounts pipelines.

🧭 RNA-Seq Strandedness & Kit Configuration Advisor

Interactive Tool

Selecting the incorrect strand orientation causes reverse reads to be counted on the opposite strand, corrupting gene expression values. Select your library preparation protocol:

HISAT2 CLI Flag:
--rna-strandness RF
Read 1 matches reverse complement of original transcript; Read 2 matches sense transcript strand (dUTP protocol).
Equivalent featureCounts & StringTie Flags:
featureCounts: -s 2 (reversely stranded)
StringTie: --rf

💾 HGFM Index RAM & Build Time Estimator

Interactive Calculator

Target Organism & Annotations

Resource Estimation

Estimated Index Build RAM:
~10.5 GB RAM
Runtime Memory for Alignment (-p 8):
~4.8 GB RAM

0. Hierarchical Graph FM Indexing Principles

Standard DNA aligners (Bowtie2, BWA) assume contiguous mapping and penalize large intron gaps as long deletions, failing on spliced eukaryotic mRNA. HISAT2 utilizes a global FM index representing the whole genome and ~55,000 local FM indexes covering 64-kbp regions with splice graph overlaps to seamlessly resolve reads spanning across introns up to 500,000 bp.

1. Reference Genome & GTF Annotation Ingestion

Acquire matching primary assembly FASTA and comprehensive gene annotations (Ensembl / GENCODE). Avoid unplaced contig patches to prevent multi-mapping ambiguities.

BASH
# Download human GRCh38 primary genome and comprehensive GTF annotation
wget -c https://ftp.ensembl.org/pub/release-111/fasta/homo_sapiens/dna/Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz
wget -c https://ftp.ensembl.org/pub/release-111/gtf/homo_sapiens/Homo_sapiens.GRCh38.111.gtf.gz
gzip -d Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz
gzip -d Homo_sapiens.GRCh38.111.gtf.gz

2. Extract Splice Sites & Exons from GTF

Use Python extraction utilities bundled with HISAT2 to extract donor/acceptor splice junctions and exon coordinates.

BASH
# Extract splice junctions
hisat2_extract_splice_sites.py Homo_sapiens.GRCh38.111.gtf > genome.ss

# Extract exon coordinates
hisat2_extract_exons.py Homo_sapiens.GRCh38.111.gtf > genome.exon

3. Build HGFM Splice-Aware Genome Index

Build the index incorporating splice junctions and exons for enhanced mapping across known transcript isoforms.

BASH
# Build HISAT2 index with 8 threads
hisat2-build -p 8 \
  --ss genome.ss \
  --exon genome.exon \
  Homo_sapiens.GRCh38.dna.primary_assembly.fa \
  grch38_tran/genome_tran

4. Quality Trimming & Adapter Clipping (fastp)

Clean raw paired-end RNA reads, eliminate polyG tails from Illumina NovaSeq/NextSeq 2-color chemistry, and remove adapter sequences.

BASH
# Fast all-in-one pre-processing
fastp \
  -i sample_R1.fastq.gz -I sample_R2.fastq.gz \
  -o clean_R1.fastq.gz -O clean_R2.fastq.gz \
  --trim_poly_g --detect_adapter_for_pe \
  -w 8 -h sample_qc.html -j sample_qc.json

5. Splice-Aware Alignment Execution (--dta)

Crucially include the --dta (Downstream Transcript Assembly) parameter. This reports alignments tailored specifically for StringTie and Cufflinks.

BASH
# Spliced paired-end mapping with HISAT2
hisat2 -p 8 \
  --dta \
  --rna-strandness RF \
  -x grch38_tran/genome_tran \
  -1 clean_R1.fastq.gz \
  -2 clean_R2.fastq.gz \
  --novel-splicesite-outfile sample_novel_ss.txt \
  --summary-file sample_align_summary.txt \
  -S sample_alignments.sam

6. Direct Stream into Coordinate-Sorted Indexed BAM

Avoid generating gigantic intermediate SAM files on disk by piping directly to SAMtools.

BASH
# Stream directly from hisat2 into sorted BAM
hisat2 -p 8 --dta --rna-strandness RF \
  -x grch38_tran/genome_tran \
  -1 clean_R1.fastq.gz -2 clean_R2.fastq.gz | \
  samtools sort -@ 8 -m 2G -o sample_aligned.sorted.bam -

samtools index -@ 8 sample_aligned.sorted.bam

7. Alignment QC & Summary Rate Evaluation

Inspect alignment summary output. Target overall alignment rate is > 85-90% with concordant pair alignment > 75%.

BASH
# View HISAT2 alignment summary
cat sample_align_summary.txt

# Expected healthy output:
# 30000000 pairs; of these:
#   26500000 (88.33%) aligned concordantly exactly 1 time
#   2100000 (7.00%) aligned concordantly >1 times
# 95.33% overall alignment rate

8. Novel Splice Junction Discovery

Examine de novo unannotated splice junctions discovered in the sequencing experiment.

BASH
# Inspect novel splice junctions (chr, start, end, strand)
head -n 20 sample_novel_ss.txt

9. Downstream Transcript Assembly with StringTie

Assemble transcripts, estimate expression abundances (TPM & FPKM), and generate Ballgown/DESeq2 inputs.

BASH
# Assemble transcripts using guide GTF annotation
stringtie sample_aligned.sorted.bam \
  -G Homo_sapiens.GRCh38.111.gtf \
  -o stringtie_out/sample.gtf \
  -p 8 \
  --rf \
  -e -B -A stringtie_out/sample_gene_abundances.tsv

10. Gene-Level Count Matrix with featureCounts

Quantify gene-level raw read counts for direct input into DESeq2 or EdgeR.

BASH
# Quantify raw counts across all samples
featureCounts -T 8 -p -B -C \
  -s 2 \
  -a Homo_sapiens.GRCh38.111.gtf \
  -o gene_counts.txt \
  sample_01.sorted.bam sample_02.sorted.bam sample_03.sorted.bam

🔀 Decision Architecture: Alignment & Assembly Strategy

Decision Tree
Select Primary Experimental Goal:
Recommended: HISAT2 + featureCounts + DESeq2
Map reads with hisat2 --dta, stream into coordinate-sorted BAM, count overlapping exons per gene with featureCounts -s 2, and feed raw integers into DESeqDataSetFromMatrix().
Copied to clipboard!