Alternative to cellranger: STARsolo
TL;DR: STARsolo is a fast, open-source alternative to Cell Ranger for 10x scRNA-seq quantification. Produces nearly identical results ~10x faster, with full control over parameters. Use when you need speed, flexibility, or Cell Ranger isn't available for your platform.
Why STARsolo?
Cell Ranger vs STARsolo
| Feature | Cell Ranger | STARsolo |
|---|---|---|
| Speed | Baseline | 10x faster |
| Memory | ~30-40 GB | ~30-40 GB |
| Platform | Linux only | Linux, macOS*, Windows (WSL) |
| License | Proprietary | Open source (MIT) |
| Output format | Cell Ranger specific | Compatible with Cell Ranger |
| Customization | Limited | Full parameter control |
| Intron counting | Gene Ex only | Gene Ex + Velocyto modes |
*macOS requires workarounds (see below)
When to Choose STARsolo
✅ Use STARsolo if:
- Cell Ranger unavailable (e.g., macOS, Windows)
- Need faster processing (large cohorts)
- Want RNA velocity (intron/exon counting)
- Need custom reference genomes
- Batch processing automation
⚠️ Stick with Cell Ranger if:
- Using 10x Feature Barcoding (CITE-seq, hashtags)
- Need Loupe Browser files
- Require 10x support for troubleshooting

Installation
Linux (Recommended)
# Download STAR (includes STARsolo)
wget https://github.com/alexdobin/STAR/archive/2.7.11a.tar.gz
tar -xzf 2.7.11a.tar.gz
cd STAR-2.7.11a/source
# Compile
make STAR
# Add to PATH
export PATH=$PWD:$PATH
echo 'export PATH=/path/to/STAR-2.7.11a/source:$PATH' >> ~/.bashrc
# Verify
STAR --version
macOS (Apple Silicon)
Known issue: Recent STAR versions have bugs on Apple Silicon. Use this specific pre-release:
# Download working version
wget https://github.com/dobinlab/STAR_pre_releases/archive/refs/tags/2.7.11b_alpha_2024-02-09.tar.gz
tar -xzf 2.7.11b_alpha_2024-02-09.tar.gz
cd STAR_pre_releases-2.7.11b_alpha_2024-09/source
# Compile (do NOT use STARstaticformac)
make STAR
# Increase file descriptor limit (required for temp files)
ulimit -n 2048 # Add to ~/.zshrc for persistence
# Test
./STAR --version
Resources:
- Issue #2142 - Apple Silicon fix
- Issue #1953 - macOS compilation
conda (Any OS)
conda install -c bioconda star
Preparing the Reference
1. Download Reference Files
Critical: GTF and FASTA must match in chromosome naming (CHR vs ALL vs PRI).
# For genome mapping (recommended - finds splice junctions)
wget ftp://ftp.ensembl.org/pub/release-110/fasta/homo_sapiens/dna/Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz
wget ftp://ftp.ensembl.org/pub/release-110/gtf/homo_sapiens/Homo_sapiens.GRCh38.110.gtf.gz
gunzip *.gz
| File Type | Chromosome Set | Use Case |
|---|---|---|
| primary_assembly (PRI) | Main chromosomes only | Gene quantification (recommended) |
| toplevel (ALL) | Includes scaffolds/patches | Complete genome |
| CHR | Transcripts only | cDNA mapping (no splicing) |
2. Build STAR Index
STAR --runMode genomeGenerate \
--genomeDir ./STARindex \
--genomeFastaFiles Homo_sapiens.GRCh38.dna.primary_assembly.fa \
--sjdbGTFfile Homo_sapiens.GRCh38.110.gtf \
--runThreadN 16 \
--genomeSAindexNbases 14 # Adjust for small genomes
Time: ~30-60 min for human genome
Disk: ~30 GB for indexed genome
Running STARsolo
Basic 10x v3 Chemistry
STAR --runThreadN 16 \
--genomeDir ./STARindex \
--readFilesIn R2.fastq.gz R1.fastq.gz \ # Note: R2 first!
--readFilesCommand zcat \
--soloType CB_UMI_Simple \
--soloCBwhitelist 3M-february-2018.txt \ # 10x barcode whitelist
--soloUMIlen 12 \
--outSAMtype BAM SortedByCoordinate \
--outSAMattributes NH HI nM AS CR UR CB UB GX GN sS sQ sM \
--outFileNamePrefix output_
10x barcode whitelists: 10x-barcode-lists
STARsolo for RNA Velocity
Count both exons (gene expression) and introns (nascent RNA):
STAR --runThreadN 16 \
--genomeDir ./STARindex \
--readFilesIn R2.fastq.gz R1.fastq.gz \
--readFilesCommand zcat \
--soloType CB_UMI_Simple \
--soloCBwhitelist 3M-february-2018.txt \
--soloUMIlen 12 \
--soloFeatures Gene Velocyto \ # Key addition
--outSAMtype BAM SortedByCoordinate \
--outFileNamePrefix velocyto_
Output: Both Gene/ (standard) and Velocyto/ (intron/exon) matrices.
Multi-Sample Batch Processing
#!/bin/bash
samples=(sample1 sample2 sample3)
for sample in "${samples[@]}"; do
STAR --runThreadN 8 \
--genomeDir ./STARindex \
--readFilesIn ${sample}_R2.fastq.gz ${sample}_R1.fastq.gz \
--readFilesCommand zcat \
--soloType CB_UMI_Simple \
--soloCBwhitelist 3M-february-2018.txt \
--soloUMIlen 12 \
--outSAMtype None \ # Skip BAM to save time
--outFileNamePrefix ${sample}_ &
done
wait
echo "All samples processed"
Parameter Tuning for Cell Ranger Equivalence
To match Cell Ranger output exactly:
STAR --runThreadN 16 \
--genomeDir ./STARindex \
--readFilesIn R2.fastq.gz R1.fastq.gz \
--readFilesCommand zcat \
--soloType CB_UMI_Simple \
--soloCBwhitelist 3M-february-2018.txt \
--soloUMIlen 12 \
--soloCBstart 1 --soloCBlen 16 --soloUMIstart 17 \
--soloCellFilter EmptyDrops_CR \ # Cell Ranger's algorithm
--soloUMIdedup 1MM_CR \ # Cell Ranger UMI dedup
--soloUMIfiltering MultiGeneUMI_CR \
--soloBarcodeReadLength 0 \ # Allow barcode length variation
--outSAMtype BAM SortedByCoordinate \
--outSAMattributes NH HI nM AS CR UR CB UB GX GN sS sQ sM \
--outFileNamePrefix CR_equivalent_
Key Parameters Explained
| Parameter | Cell Ranger Default | Purpose |
|---|---|---|
--soloCellFilter EmptyDrops_CR |
Yes | Cell calling algorithm |
--soloUMIdedup 1MM_CR |
Yes | Allow 1 mismatch in UMI |
--soloUMIfiltering MultiGeneUMI_CR |
Yes | Filter multi-gene UMIs |
--clipAdapterType CellRanger4 |
Yes (CR4+) | Adapter clipping |
Output Files
STARsolo creates a folder structure similar to Cell Ranger:
output_Solo.out/
├── Gene/
│ ├── filtered/
│ │ ├── matrix.mtx.gz
│ │ ├── barcodes.tsv.gz
│ │ └── features.tsv.gz
│ ├── raw/
│ │ ├── matrix.mtx.gz
│ │ ├── barcodes.tsv.gz
│ │ └── features.tsv.gz
│ └── Summary.csv
└── Velocyto/ (if --soloFeatures Velocyto used)
├── filtered/
└── raw/
Compatible with: Seurat, Scanpy, Cell Ranger analysis pipelines.
Load into Seurat
library(Seurat)
# Load STARsolo output (same as Cell Ranger)
counts <- Read10X("output_Solo.out/Gene/filtered/")
pbmc <- CreateSeuratObject(counts, project = "PBMC")
# Standard Seurat workflow
pbmc <- NormalizeData(pbmc)
pbmc <- FindVariableFeatures(pbmc)
# ... continue as usual
Load into Scanpy
import scanpy as sc
# Read STARsolo output
adata = sc.read_10x_mtx("output_Solo.out/Gene/filtered/")
# Standard preprocessing
sc.pp.filter_cells(adata, min_genes=200)
sc.pp.normalize_total(adata, target_sum=1e4)
Troubleshooting
"samOutBufferSizeMax too small"
Cause: Complex genome or many reads
Fix:
--limitOutSAMoneReadBytes 1000000 # Increase buffer
"Too many open files"
Cause: System file descriptor limit
Fix:
ulimit -n 4096 # Increase limit (macOS/Linux)
Mismatched GTF/FASTA chromosomes
Symptom: Few or no reads mapped
Fix: Ensure GTF and FASTA use same naming:
# Check GTF chromosomes
zcat Homo_sapiens.GRCh38.110.gtf.gz | cut -f1 | sort -u | head
# Check FASTA chromosomes
grep "^>" Homo_sapiens.GRCh38.dna.primary_assembly.fa | head
# Both should show "1", "2", ... OR "chr1", "chr2", ...
Low cell recovery
Cause: Wrong chemistry or barcode whitelist
Fix:
- 10x v2: Use
737K-august-2016.txt - 10x v3: Use
3M-february-2018.txt - Check with
fastqcthat R1 starts with barcodes
Comparison: Speed Benchmark
| Dataset | Cell Ranger | STARsolo | Speedup |
|---|---|---|---|
| 5K PBMC | 30 min | 3 min | 10x |
| 10K tumor | 90 min | 9 min | 10x |
| 50K multiome | 6 hours | 35 min | 10x |
Hardware: 16 cores, 64GB RAM, NVMe SSD
Advanced: Custom Chemistries
For non-10x protocols (e.g., inDrop, Drop-seq):
STAR --soloType CB_UMI_Simple \
--soloCBstart 1 --soloCBlen 8 \ # Barcode position
--soloUMIstart 9 --soloUMIlen 6 \ # UMI position
--soloCBwhitelist custom_barcodes.txt # Custom list
Resources
- STAR manual: github.com/alexdobin/STAR/blob/master/doc/STARmanual.pdf
- 10x barcode lists: github.com/10XGenomics/cellranger/tree/master/lib/python/cellranger/barcodes
- STARsolo paper: He et al., Genome Biology 2021
See also:
Originally posted on WeChat Official Account: bioinfo_studyroom