STAR is the fast, splice-aware RNA-seq aligner that places reads across exon-exon junctions on the genome. It is the choice when the deliverable needs genomic coordinates -- novel isoforms, fusions, RNA variant calling, coverage tracks, splicing QC, or single-cell counting (STARsolo) -- and has memory to spare (~30 GB for human). The decisions that actually shape the result are the splice-junction database (built from a GTF at sjdbOverhang = readlength - 1), the per-sample vs cohort two-pass choice, the 255-for-unique MAPQ that breaks GATK, and the strand column STAR reports; this skill emphasizes those over the basic command.
conda install -c bioconda star samtools
--sjdbOverhang at index build.Tell your AI agent what you want to do: - "Build a STAR index for my genome and GTF with the right sjdbOverhang for 150 bp reads" - "Align my paired-end RNA-seq reads with STAR in two-pass mode and get gene counts" - "Detect my library strandedness from the STAR GeneCounts output" - "Align RNA-seq for GATK variant calling without the empty-VCF MAPQ problem" - "Run STAR for fusion detection with STAR-Fusion"
"Create a STAR index for genome.fa with genes.gtf for 150 bp reads, and reduce genomeSAindexNbases appropriately because my genome is a 5 Mb bacterial assembly."
"Align my paired-end RNA-seq with STAR two-pass, output a coordinate-sorted BAM and gene counts, and tell me from the counts whether my library is stranded."
"Align RNA-seq with STAR for GATK variant calling and make sure the unique-read MAPQ does not cause an empty VCF."
"I am doing differential splicing across 30 samples -- how do I run STAR two-pass so the junction set is identical across samples instead of per-sample?"
"Run STAR with chimeric output for STAR-Fusion on my tumor RNA-seq."
--sjdbGTFfile and --sjdbOverhang = readlength - 1, reducing --genomeSAindexNbases for small genomes.--quantMode GeneCounts to also read strandedness.--outSAMmapqUnique 60 for any STAR -> GATK path so the 255 uniques are not dropped.| Read length | sjdbOverhang |
|---|---|
| 50 bp | 49 |
| 75 bp | 74 |
| 100 bp | 99 |
| 150 bp | 149 |
| Library type | ReadsPerGene column | Equivalent counter setting |
|---|---|---|
| Unstranded | column 2 | htseq -s no / featureCounts -s 0 |
| Forward (Ligation) | column 3 | htseq -s yes / featureCounts -s 1 |
| Reverse (dUTP, TruSeq -- the common case) | column 4 | htseq -s reverse / featureCounts -s 2 |
--sjdbOverhang to read length - 1 at index build; the default 100 quietly degrades junction sensitivity for short reads.--outSAMtype BAM SortedByCoordinate -- do not run samtools sort again.--outSAMmapqUnique 60 so the 255 uniques are not dropped as "unavailable," and inject read groups with --outSAMattrRGline ID:.. SM:.. PL:ILLUMINA LB:.. (space-separated tags, not bwa's -R '@RG\t...') because GATK requires them.--readFilesCommand zcat for .gz input (bwa/bowtie2/HISAT2 auto-detect it). For htseq-count, emit --outSAMtype BAM Unsorted or re-sort with samtools sort -n; featureCounts accepts coordinate order.-q 10 filter deletes every multimapper and under-counts gene families.--genomeSAindexNbases for small genomes or STAR silently builds a broken index.| Factor | STAR | HISAT2 |
|---|---|---|
| Memory (human) | ~30 GB | ~7 GB |
| Speed | very fast | fast |
| Native gene counts | yes (GeneCounts) | no |
| Fusion detection | yes (chimeric) | no |
| MAPQ for GATK | 255 -> set 60 | 60 (GATK-friendly) |
| Downstream coupling | featureCounts, RSEM, STAR-Fusion, STARsolo | StringTie/Cufflinks via --dta |