sciagent-skill-creator
Scaffold a new SciAgent-Skills entry. Picks pipeline/toolkit/database/guide template, creates skills/{category}/{name}/SKILL.md…
Counts RNA-seq reads overlapping GTF gene features. Takes sorted STAR BAMs plus GTF; outputs a per-gene tab-delimited matrix across samples. Handles strandedness (0/1/2), paired-end, multi-sample batch counting in one command, and outputs assignment statistics. Use Salmon for
Claude Code
$ npx -y skills add jaechang-hits/SciAgent-Skills --skill featurecounts-rna-counting --agent claude-code
Codex
$ npx skills add jaechang-hits/SciAgent-Skills --skill featurecounts-rna-counting -a codex -y
Cursor
$ npx skills add jaechang-hits/SciAgent-Skills --skill featurecounts-rna-counting -a cursor -y
Gemini CLI
$ npx skills add jaechang-hits/SciAgent-Skills --skill featurecounts-rna-counting -a gemini-cli -y
GitHub Copilot
$ npx skills add jaechang-hits/SciAgent-Skills --skill featurecounts-rna-counting -a github-copilot -y
OpenCode
$ npx skills add jaechang-hits/SciAgent-Skills --skill featurecounts-rna-counting -a opencode -y
Windsurf
$ npx skills add jaechang-hits/SciAgent-Skills --skill featurecounts-rna-counting -a windsurf -y
name: "featurecounts-rna-counting" description: "Counts RNA-seq reads overlapping GTF gene features. Takes sorted STAR BAMs plus GTF; outputs a per-gene tab-delimited matrix across samples. Handles strandedness (0/1/2), paired-end, multi-sample batch counting in one command, and outputs assignment statistics. Use Salmon for alignment-free quantification; use featureCounts when STAR BAMs already exist." license: "GPL-3.0"
featureCounts (part of the Subread package) assigns sequencing reads in BAM files to genomic features defined in a GTF/GFF annotation. It counts how many reads overlap each gene (or exon, intron, or custom feature), producing a gene × sample count matrix suitable for differential expression analysis with DESeq2 or edgeR. featureCounts processes multiple BAM files in a single command, reporting read assignment statistics (assigned, unassigned by category) alongside the count matrix. It is the standard counting step after STAR alignment in RNA-seq pipelines.
> **Check before installing**: The tool may already be available in the current environment (e.g., inside a `pixi` / `conda` env). Run `command -v featureCounts` first and skip the install commands below if it returns a path. When running inside a pixi project, invoke the tool via `pixi run featureCounts` rather than bare `featureCounts`.
# Install with conda (recommended) conda install -c bioconda subread # Verify featureCounts -v # featureCounts v2.0.6 # Alternative: install via apt (Ubuntu/Debian) sudo apt-get install subread
Settle these with the user before writing any analysis code.
decisions:
- id: D1
param: annotation
kind: required
source: upstream
ask: "Which GTF/GFF annotation file should be used, and does its assembly exactly match the BAM alignment reference?"
default: null
- id: D2
param: strandSpecific
kind: required
source: data
ask: "Which strandedness did the representative-alignment check infer, and does it agree with the library preparation?"
default: null
- id: D3
param: -t, -g
kind: optional
source: user
ask: "Should expression be summarized from exons to genes, or from another feature type for a specific downstream question?"
default: "-t exon -g gene_id"
- id: D4
param: -M, -O
kind: optional
source: user
ask: "Should reads with multiple genomic mappings or overlapping gene assignments be included in the count matrix?"
default: "exclude both multi-mappers and multi-overlap reads"
- id: D5
param: --minOverlap, --fracOverlap
kind: optional_conditional
source: user
ask: "Does the assay or feature definition require a minimum overlap stricter than one aligned base?"
default: "--minOverlap 1 --fracOverlap 0"Incorrect library strandedness can substantially reduce or misassign counts; the magnitude varies by gene and annotation, so infer it from the data and treat an ambiguous result as a QC failure. Enabling multi-mapper counting can inflate counts for paralogs and repeat-associated genes. Neither setting necessarily produces a software error.
# Count reads for multiple samples (unstranded paired-end RNA-seq)
featureCounts \
-a gencode.v47.annotation.gtf \
-o counts/gene_counts.txt \
-T 8 \
-p --countReadPairs \
results/sample1/Aligned.sortedByCoord.out.bam \
results/sample2/Aligned.sortedByCoord.out.bam
echo "Count matrix: counts/gene_counts.txt"
head -3 counts/gene_counts.txtEnsure BAM files are sorted and indexed, and the GTF matches the genome assembly.
# Verify BAM files are sorted samtools view -H results/sample1/Aligned.sortedByCoord.out.bam | grep "SO:" # Expected: SO:coordinate # List BAMs to count ls results/*/Aligned.sortedByCoord.out.bam | head -5 # Download GENCODE GTF (same version used for STAR indexing) wget https://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_47/gencode.v47.primary_assembly.annotation.gtf.gz gunzip gencode.v47.primary_assembly.annotation.gtf.gz echo "GTF lines: $(wc -l < gencode.v47.primary_assembly.annotation.gtf)"
Test strandedness using a small read count to set the `-s` parameter correctly.
# Quick strandedness check: count 1 sample with all 3 modes
# Compare assigned rates: highest = correct mode
for strand in 0 1 2; do
echo "=== Strandedness -s $strand ==="
featureCounts \
-a gencode.v47.primary_assembly.annotation.gtf \
-o /tmp/test_s${strand}.txt \
-T 4 \
-p --countReadPairs \
-s $strand \
results/sample1/Aligned.sortedByCoord.out.bam 2>&1 \
| grep "Successfully assigned"
done
# Rule: 0=unstranded if similar rates; 1 or 2 if one is much higherStandard configuration for unstranded libraries (most polyA-selected RNA-seq).
mkdir -p counts
# Multi-sample batch counting: pass all BAMs as positional arguments
featureCounts \
-a gencode.v47.primaryTurn your AI coding agent into a life sciences expert — 199 bioinformatics skills for Claude Code covering RNA-seq, single-cell analysis, genomics, proteomics, drug discovery, and more. Boosted BixBench from 65% to 92%. Open source.
Scaffold a new SciAgent-Skills entry. Picks pipeline/toolkit/database/guide template, creates skills/{category}/{name}/SKILL.md…
Bayesian modeling with PyMC 5: priors, likelihood, NUTS/ADVI sampling, diagnostics (R-hat, ESS), LOO/WAIC comparison, prediction.…
Time-to-event modeling with scikit-survival: Cox PH (elastic net), Random Survival Forests, Boosting, SVMs for censored data.…
Guided statistical analysis: test choice, assumption checks, effect sizes, power, APA reporting. Pick tests, verify assumptions,…
Python statistical modeling: regression (OLS, WLS, GLM), discrete (Logit, Poisson, NegBin), time series (ARIMA, SARIMAX, VAR),…
DL cell/nucleus segmentation for fluorescence and brightfield microscopy. Pre-trained models (cyto3, nuclei, tissuenet) and a…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.