rna-quantification/alignment-free-quant/SKILL.md
Quantify transcript expression using pseudo-alignment with Salmon or kallisto. Use when quantifying transcripts with Salmon or kallisto.
npx skillsauth add GPTomics/bioSkills bio-rna-quantification-alignment-free-quantInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Reference examples tested with: Salmon 1.10+, fastp 0.23+, kallisto 0.50+, pandas 2.2+
Before using code patterns, verify installed versions match. If versions differ:
<tool> --version then <tool> --help to confirm flagsIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
"Quantify gene expression without alignment" -> Estimate transcript abundances directly from FASTQ reads using pseudo-alignment or selective alignment, bypassing genome mapping.
salmon quant -i index -l A -1 R1.fq.gz -2 R2.fq.gz -o quant/, kallisto quant -i index -o output R1.fq.gz R2.fq.gzQuantify transcript abundance directly from FASTQ reads using pseudo-alignment (kallisto) or selective alignment (Salmon).
# Download transcriptome FASTA
# Ensembl: Homo_sapiens.GRCh38.cdna.all.fa.gz
# Basic index (fast, less accurate)
salmon index -t transcripts.fa -i salmon_index
# Decoy-aware index (recommended for accuracy)
# First, create decoys from genome
grep "^>" genome.fa | cut -d " " -f 1 | sed 's/>//g' > decoys.txt
cat transcripts.fa genome.fa > gentrome.fa
salmon index -t gentrome.fa -d decoys.txt -i salmon_index -p 8
# Paired-end reads
salmon quant -i salmon_index -l A \
-1 sample_R1.fastq.gz -2 sample_R2.fastq.gz \
-o sample_quant -p 8
# Single-end reads
salmon quant -i salmon_index -l A \
-r sample.fastq.gz \
-o sample_quant -p 8
Key flags:
-l A - Automatically detect library type-p - Number of threads--validateMappings - More accurate (default in recent versions)--gcBias - Correct for GC bias--seqBias - Correct for sequence-specific bias| Code | Description |
|------|-------------|
| A | Automatic detection (recommended) |
| ISR | Inward, stranded, read 1 from reverse |
| ISF | Inward, stranded, read 1 from forward |
| IU | Inward, unstranded |
for sample in sample1 sample2 sample3; do
salmon quant -i salmon_index -l A \
-1 ${sample}_R1.fastq.gz -2 ${sample}_R2.fastq.gz \
-o ${sample}_quant -p 8
done
sample_quant/
├── quant.sf # Main quantification file
├── aux_info/ # Auxiliary information
├── cmd_info.json # Command used
├── lib_format_counts.json # Library format detection
└── logs/ # Log files
quant.sf format:
Name Length EffectiveLength TPM NumReads
ENST00000456328.2 1657 1477.000 0.000000 0.000
ENST00000450305.2 632 452.000 12.345678 156.789
kallisto index -i kallisto_index transcripts.fa
# Paired-end
kallisto quant -i kallisto_index -o sample_quant \
sample_R1.fastq.gz sample_R2.fastq.gz
# Single-end (must specify fragment length)
kallisto quant -i kallisto_index -o sample_quant \
--single -l 200 -s 20 sample.fastq.gz
# With bootstraps (for sleuth)
kallisto quant -i kallisto_index -o sample_quant -b 100 \
sample_R1.fastq.gz sample_R2.fastq.gz
Key flags:
-b - Number of bootstrap samples-t - Number of threads--single - Single-end mode-l - Estimated fragment length (single-end)-s - Fragment length standard deviationsample_quant/
├── abundance.tsv # Main quantification (text)
├── abundance.h5 # HDF5 format (for sleuth)
└── run_info.json # Run information
abundance.tsv format:
target_id length eff_length est_counts tpm
ENST00000456328.2 1657 1477.00 0.00 0.000000
ENST00000450305.2 632 452.00 156.79 12.345678
| Feature | Salmon | kallisto | |---------|--------|----------| | Speed | Fast | Fastest | | Accuracy | Higher | Good | | GC bias correction | Yes | No | | Decoy sequences | Yes | No | | Memory usage | Moderate | Low |
Recommendation: Use Salmon for production, kallisto for quick exploratory analysis.
# Salmon: use tximport in R
# kallisto: use tximport or sleuth
# Quick Python combination
python << 'EOF'
import pandas as pd
from pathlib import Path
samples = ['sample1', 'sample2', 'sample3']
tpm_data = {}
counts_data = {}
for sample in samples:
quant_file = Path(f'{sample}_quant/quant.sf') # Salmon
# quant_file = Path(f'{sample}_quant/abundance.tsv') # kallisto
df = pd.read_csv(quant_file, sep='\t', index_col=0)
tpm_data[sample] = df['TPM']
counts_data[sample] = df['NumReads'] # or est_counts for kallisto
tpm_matrix = pd.DataFrame(tpm_data)
counts_matrix = pd.DataFrame(counts_data)
tpm_matrix.to_csv('tpm_matrix.csv')
counts_matrix.to_csv('counts_matrix.csv')
EOF
# Check mapping rate from Salmon logs
grep "Mapping rate" sample_quant/logs/salmon_quant.log
# Check library type detection
cat sample_quant/lib_format_counts.json
Good metrics:
Low mapping rate:
Inconsistent library types:
tools
--- name: bio-phasing-imputation-foundations description: Frames the phasing/imputation pipeline before any tool runs: phasing and imputation are one Li-Stephens copying HMM (recombination is the transition, mutation the emission, the genetic map and Ne set the rates), imputation's honest output is a dosage with a self-estimated quality (INFO/R2/DR2) not a hard genotype, and the stages are ordered and each fails silently (QC, align build and strand to the panel, phase, impute per chromosome, fil
tools
Chooses the enrichment generation before any tool runs, mapping the input shape to a method class - a pre-selected gene list plus a background to over-representation analysis (ORA, hypergeometric), a ranked statistic for all genes to gene set enrichment (GSEA), a signed signaling topology to pathway-topology (SPIA) - then making the null explicit (competitive vs self-contained, gene vs subject sampling) and running a trustworthiness checklist (testable-gene universe, FDR, redundancy collapse, leading-edge check, version reporting). Covers why every clusterProfiler GSEA is the inter-gene-correlation-uncorrected competitive null, why the background not the gene list decides ORA significance, and why no method is universally best. Use when deciding ORA vs GSEA vs topology, which gene-set DB, whether a result is trustworthy, or which null a tool computes. For ORA see go-enrichment, GSEA see gsea, databases kegg-pathways/reactome-pathways/wikipathways; the ranking comes from differential-expression/de-results.
testing
End-to-end GWAS workflow from VCF to association results. Covers PLINK QC, population structure correction, and association testing for case-control or quantitative traits. Use when running genome-wide association studies.
development
Orchestrates the full path from differential expression results to redundancy-collapsed functional enrichment: choose ORA vs GSEA, convert gene IDs per method, run enrichGO/enrichKEGG/enrichPathway/enrichWP or gseGO/gseKEGG (clusterProfiler, ReactomePA, rWikiPathways), and visualize. Routes the ORA-vs-GSEA generation fork and the null/universe/reproducibility theory to pathway-analysis/enrichment-foundations. Use when a DESeq2/edgeR/limma result must become enriched GO terms, KEGG/Reactome/WikiPathways pathways, or a GSEA leading edge; when deciding whether a ranking exists for all genes (GSEA, named decreasing vector) or only a pre-selected list (ORA plus a defensible background universe); or when assembling DE-to-pathway end to end. The DE list and ranking statistic come from differential-expression/de-results; per-method nuance lives in the pathway-analysis skills.