Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Count reads per gene from aligned BAM files using Subread featureCounts. Use when processing BAM files from STAR/HISAT2 to generate gene-level counts for DESeq2/edgeR.
.claude/skills/bio-rna-quantification-featurecounts-counting/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 75% | 0% |
| case-10 | ✗→✓ | ▲ Improved | -12% | 0% |
| case-18 | ✗→✓ | ▲ Improved | -29% | 0% |
| case-22 | ✓→✓ | = Same ✓ | 180% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 201% | 0% |
<!--
#
#
-->
Count reads mapping to genomic features (genes, exons) from BAM files.
bash# Single sample featureCounts -a annotation.gtf -o counts.txt aligned.bam # Multiple samples (recommended - single matrix output) featureCounts -a annotation.gtf -o counts.txt sample1.bam sample2.bam sample3.bam # All BAMs in directory featureCounts -a annotation.gtf -o counts.txt *.bam
bash# Count fragments, not reads (required for paired-end) featureCounts -p --countReadPairs -a annotation.gtf -o counts.txt *.bam # Check proper pairs only featureCounts -p --countReadPairs -B -C -a annotation.gtf -o counts.txt *.bam
Flags:
-p - Input is paired-end--countReadPairs - Count fragments instead of reads-B - Only count properly paired reads-C - Don't count chimeric fragmentsbash# Unstranded (default) featureCounts -s 0 -a annotation.gtf -o counts.txt *.bam # Forward stranded (e.g., dUTP, NSR) featureCounts -s 1 -a annotation.gtf -o counts.txt *.bam # Reverse stranded (e.g., Illumina TruSeq, most common) featureCounts -s 2 -a annotation.gtf -o counts.txt *.bam
Determining strandedness: Use infer_experiment.py from RSeQC or check library prep protocol.
bash# Count at gene level (default) featureCounts -t exon -g gene_id -a annotation.gtf -o counts.txt *.bam # Count at transcript level featureCounts -t exon -g transcript_id -a annotation.gtf -o counts.txt *.bam # Count CDS only featureCounts -t CDS -g gene_id -a annotation.gtf -o counts.txt *.bam
Flags:
-t - Feature type in GTF (default: exon)-g - Meta-feature attribute (default: gene_id)bash# Discard multi-mappers (default, recommended for DE) featureCounts -a annotation.gtf -o counts.txt *.bam # Count multi-mappers (fractional) featureCounts -M --fraction -a annotation.gtf -o counts.txt *.bam # Count multi-mappers (full count to each location) featureCounts -M -a annotation.gtf -o counts.txt *.bam
bash# Discard reads overlapping multiple features (default) featureCounts -a annotation.gtf -o counts.txt *.bam # Count reads overlapping multiple features featureCounts -O -a annotation.gtf -o counts.txt *.bam # Fractional count for overlaps featureCounts -O --fraction -a annotation.gtf -o counts.txt *.bam
bash# Use multiple threads featureCounts -T 8 -a annotation.gtf -o counts.txt *.bam # Use less memory (slower) featureCounts --largeBAM -a annotation.gtf -o counts.txt *.bam
featureCounts produces two files:
Geneid Chr Start End Strand Length sample1.bam sample2.bam
GENE1 chr1 100 500 + 400 1523 1891
GENE2 chr1 1000 2000 - 1000 892 756Status sample1.bam sample2.bam
Assigned 1523456 1678234
Unassigned_Unmapped 12345 11234
Unassigned_NoFeatures 234567 245678bash# Remove first 6 columns (metadata) to get just counts cut -f1,7- counts.txt | tail -n +2 > count_matrix.txt
pythonimport pandas as pd counts = pd.read_csv('counts.txt', sep='\t', comment='#') count_matrix = counts.set_index('Geneid').iloc[:, 5:] # Skip metadata columns count_matrix.columns = [c.replace('.bam', '') for c in count_matrix.columns] count_matrix.to_csv('count_matrix.csv')
rcounts <- read.table('counts.txt', header=TRUE, row.names=1, skip=1) count_matrix <- counts[, 6:ncol(counts)] # Skip metadata columns colnames(count_matrix) <- gsub('.bam', '', colnames(count_matrix))
Low assignment rate:
-s)Zero counts for known expressed genes:
-t exon vs -t gene)<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-22 | pass→pass | 3,915 | 2,857 | -27% | 1 | 1 | 0% | 703 | 1,968 | +180% | 0 | 0 | — |
case-05 | pass→pass | 3,495 | 10,438 | +199% | 1 | 1 | 0% | 658 | 1,982 | +201% | 0 | 0 | — |
case-01 | fail→pass | 6,324 | 3,746 | -41% | 1 | 1 | 0% | 1,310 | 2,288 | +75% | 0 | 0 | — |
case-02 | pass→pass | 7,321 | 3,078 | -58% | 1 | 1 | 0% | 614 | 2,093 | +241% | 0 | 0 | — |
case-03 | pass→pass | 5,395 | 3,665 | -32% | 1 | 1 | 0% | 990 | 2,122 | +114% | 0 | 0 | — |
case-04 | pass→pass | 6,873 | 2,363 | -66% | 1 | 1 | 0% | 1,285 | 1,878 | +46% | 0 | 0 | — |
case-06 | pass→pass | 10,981 | 8,841 | -19% | 1 | 1 | 0% | 2,049 | 2,323 | +13% | 0 | 0 | — |
case-07 | pass→pass | 6,974 | 3,382 | -52% | 1 | 1 | 0% | 1,345 | 2,003 | +49% | 0 | 0 | — |
case-08 | pass→pass | 6,276 | 5,086 | -19% | 1 | 1 | 0% | 1,218 | 2,349 | +93% | 0 | 0 | — |
case-09 | pass→pass | 7,174 | 2,444 | -66% | 1 | 1 | 0% | 1,286 | 1,831 | +42% | 0 | 0 | — |
case-10 | fail→pass | 13,730 | 4,046 | -71% | 1 | 1 | 0% | 2,436 | 2,145 | -12% | 0 | 0 | — |
case-11 | pass→pass | 6,319 | 5,722 | -9% | 1 | 1 | 0% | 1,177 | 2,603 | +121% | 0 | 0 | — |
case-12 | pass→pass | 4,577 | 4,602 | +1% | 1 | 1 | 0% | 894 | 2,395 | +168% | 0 | 0 | — |
case-13 | fail→fail | 7,592 | 8,248 | +9% | 1 | 1 | 0% | 1,450 | 3,129 | +116% | 0 | 0 | — |
case-14 | pass→pass | 31,642 | 15,461 | -51% | 1 | 1 | 0% | 2,053 | 3,072 | +50% | 0 | 0 | — |
case-15 | pass→pass | 7,701 | 4,770 | -38% | 1 | 1 | 0% | 1,292 | 2,311 | +79% | 0 | 0 | — |
case-16 | pass→pass | 2,229 | 2,039 | -9% | 1 | 1 | 0% | 373 | 1,810 | +385% | 0 | 0 | — |
case-17 | pass→pass | 8,437 | 3,190 | -62% | 1 | 1 | 0% | 1,380 | 1,957 | +42% | 0 | 0 | — |
case-18 | fail→pass | 14,821 | 3,450 | -77% | 1 | 1 | 0% | 2,870 | 2,045 | -29% | 0 | 0 | — |
case-19 | pass→pass | 7,959 | 6,010 | -24% | 1 | 1 | 0% | 1,383 | 2,578 | +86% | 0 | 0 | — |
case-20 | pass→pass | 13,327 | 6,930 | -48% | 1 | 1 | 0% | 2,625 | 2,936 | +12% | 0 | 0 | — |
case-21 | pass→pass | 10,289 | 8,848 | -14% | 1 | 1 | 0% | 2,018 | 3,294 | +63% | 0 | 0 | — |
case-23 | pass→pass | 6,628 | 4,494 | -32% | 1 | 1 | 0% | 1,179 | 2,261 | +92% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +13 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 7/26/2026 | +9% |
Other measured skills in the registry, with their headline benchmark lift.