hisat2-alignment
Skill8 starsChanged 5 months agoMITView on GitHub
Splice-aware RNA-seq alignment with HISAT2 — fast, memory-efficient, and the default in many bulk RNA-seq pipelines alongside STAR.
In this repository125 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/AGENTS.mdAGENTS.md
- batch-processingSkill
- bowtie2-alignmentSkill
- bwa-alignmentSkill
- bwa-mem2-alignmentSkill
- codon-usageSkill
- compressed-sequence-filesSkill
- fastq-quality-scoresSkill
- filter-sequencesSkill
- format-conversionSkill
- motif-searchSkill
- paired-end-fastqSkill
- pysam-genomicsSkill
- read-write-sequencesSkill
- reverse-complementSkill
- sam-bam-basicsSkill
- samtools-bam-processingSkill
- seq-objectsSkill
- sequence-propertiesSkill
- sequence-slicingSkill
- sequence-statisticsSkill
- star-alignmentSkill
- transcription-translationSkill
- academic-cvSkill
- faculty-interviewSkill
- fellowship-applicationSkill
- industry-transitionSkill
- negotiationSkill
- tenure-dossierSkill
- admet-predictionSkill
- conformer-generationSkill
- covalent-designSkill
- docking-rescoringSkill
- free-energy-calculationsSkill
- generative-designSkill
- molecular-descriptorsSkill
- molecular-ioSkill
- molecular-standardizationSkill
- pharmacophore-modelingSkill
- pose-validationSkill
- protac-degradersSkill
- qsar-modelingSkill
- retrosynthesisSkill
- scaffold-analysisSkill
- shape-similaritySkill
- similarity-searchingSkill
- substructure-searchSkill
- virtual-screeningSkill
- snakemake-workflow-engineSkill
- ai-disclosureSkill
- data-privacySkill
- image-integritySkill
- irb-protocolSkill
- ai-detection-awarenessSkill
- ai-disclosure-statementSkill
- scientific-voice-styleSkill
- text-humanizing-editorialSkill
- cellprofiler-pipelinesSkill
- image-analysis-best-practicesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
No fabricated citations: Every cited work must resolve to a verifiable
- Distinctive: line 21
No claim without provenance: Every quantitative or factual claim
- Distinctive: line 22
No silent failure: Every script invocation, API call, or tool use must declare its exit status and what to do on non-zero.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- metadata:
category: bioinformatics-sequence
oversight: low
version: 1.0.0
author: Pradyumna Jayaram
tags: [bioinformatics-sequence, research]
difficulty: intermediate
-->HISAT2 RNA-seq Alignment
Hard rules
- No fabricated citations. Every cited work must resolve to a verifiable
- No claim without provenance. Every quantitative or factual claim
- No silent failure. Every script invocation, API call, or tool use must declare its exit status and what to do on non-zero. A skill that silently swallows errors is a violation.
When to use
- Bulk RNA-seq alignment to a reference transcriptome/genome.
- Small-genome RNA-seq where STAR's index cost is too high.
- 3' tag-seq (e.g., Lexogen QuantSeq) with appropriate flag settings.
- Long RNA-seq (>250 bp reads, e.g., ONT cDNA).
When NOT to use
- De novo transcript assembly → use
STAR(better novel junction discovery). - DNA-seq variant calling → use
bwa-memorbwa-mem2. - Long reads → use
minimap2with-ax splice.
Prerequisites
hisat2≥ 2.2samtools≥ 1.19- Reference FASTA + HISAT2 index
- For best sensitivity: known splice sites from a GTF file
Core workflow
- Extract splice sites and exons from a GTF to build a sensitive index.
- Build the HISAT2 index (
hisat2-buildorhisat2-build-swith known splice sites). - Align with
hisat2 --dtafor downstream transcriptome assembly (StringTie / Cufflinks) or--no-spliced-alignmentfor general use. - Sort and index the BAM with
samtools.
Code patterns
Extract splice sites and exons from a GTF
hisat2_extract_splice_sites.py genes.gtf > splice_sites.txt
hisat2_extract_exons.py genes.gtf > exons.txtBuild a sensitive index (with known splice sites)
hisat2-build -p 16 --ss splice_sites.txt --exon exons.txt reference/genome.fa genome_hs2Build a basic index (no annotation, faster)
hisat2-build -p 16 reference/genome.fa genome_hs2Paired-end alignment (typical bulk RNA-seq)
hisat2 -p 16 --dta -x genome_hs2 \
-1 reads_R1.fq.gz -2 reads_R2.fq.gz \
--rg-id sample1 --rg SM:sample1 --rg PL:ILLUMINA --rg LB:lib1 \
-S sample1.sam
samtools sort -@ 8 -o sample1.bam sample1.sam
samtools index sample1.bam
rm sample1.sam--dta (downstream-transcriptome-assembly) is required if you'll run StringTie; it reports alignments tailored to transcript assembly.
Single-end alignment
hisat2 -p 16 --dta -x genome_hs2 -U reads.fq.gz --rg-id s1 --rg SM:s1 |
samtools sort -@ 8 -o s1.bam -rRNA-aware alignment (filter rRNA first, or use --un-gz to drop)
hisat2 -p 16 --dta --un-gz unmapped.fq.gz -x genome_hs2 -1 R1.fq -2 R2.fq |
samtools sort -@ 8 -o s.bam ---un-gz writes reads that didn't align (often rRNA or contaminant) for downstream QC.
Strand-specific libraries (dUTP / Ligation)
HISAT2 doesn't natively set XS tags; the convention is to use featureCounts or StringTie to infer strand from spliced alignments. For library prep-specific strand:
# Ligation protocol (Illumina TruSeq stranded)
# HISAT2 reports XS:A:+ / XS:A:- via the spliced alignment orientation
# featureCounts -s 2 (reverse stranded) will pick this upLong-read cDNA (ONT / PacBio Iso-Seq)
hisat2 -p 16 --dta -x genome_hs2 -U iso_seq.fq.gz --no-temp-splicesite |
samtools sort -@ 8 -o iso.bam -nf-core integration
nf-core/rnaseq defaults to STAR. To use HISAT2, pass --aligner hisat2 on the CLI.
Common pitfalls
- Forgetting
--dtafor transcriptome assembly. StringTie/Cufflinks require the special scoring. - Building an index without splice sites. The basic index works but is less sensitive for novel junctions.
- Mixing up
--rna-strandness(legacy flag removed in 2.2). In HISAT2 2.2+, use downstream tools (featureCounts -s) to handle strand. - Not using
--rg-id.featureCountsandStringTieneed read groups for multi-sample merges. - STAR's memory cost is too high → HISAT2 with low sensitivity. If STAR fails on RAM, HISAT2 with the basic index will also miss junctions. Consider subsampling reads or using a known-splice-site index.
Validation
samtools flagstat s.bam— high mapping rate expected (≥80% for human bulk RNA-seq).samtools view -c -f 2 s.bam— properly-paired count.samtools view s.bam | grep -c 'N:M:'— spliced alignment count (look forNin CIGAR).samtools view s.bam | awk '$6 ~ /N/' | wc -l— spliced reads.- rRNA fraction should be < 10% for poly-A selected, < 25% for ribo-depleted.
Open alternatives
| Need | Tool |
| Best novel junction discovery | STAR |
| Lower memory footprint | HISAT2 (this skill) |
| Long-read cDNA | minimap2 -ax splice:hq |
| Pseudo-alignment (transcripts only) | salmon, kallisto |
| Standard bulk RNA-seq | nf-core/rnaseq (default STAR, --aligner hisat2 optional) |
References
- HISAT2 paper: Kim et al. 2019, Nature Methods —
10.1038/s41587-019-0201-4 - HISAT2 manual: http://daehwankimlab.github.io/hisat2/manual/
- Companion:
ors-bioinformatics-sequence-star-alignment,ors-bioinformatics-sequence-bwa-alignment.
Changelog
- 1.0.0 (2026-06-10): Initial adaptation by Pradyumna Jayaram from
bio-hisat2-alignment(bioSkills-main/read-alignment/hisat2-alignment)."
Cross-references
Other skills in this category:
- batch-processing
- bowtie2-alignment
- bwa-alignment
- bwa-mem2-alignment
- codon-usage
- compressed-sequence-files
- fastq-quality-scores
- filter-sequences
- format-conversion
- motif-search
- paired-end-fastq
- pysam-genomics
- read-write-sequences
- reverse-complement
- sam-bam-basics
- samtools-bam-processing
- seq-objects
- sequence-properties
- sequence-slicing
- sequence-statistics
- star-alignment
- transcription-translation
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

