# 3) Count exon-exon junction support
featureCounts \
-a genes.gtf \
-G genome.fa \
-o counts.txt \
-J \
sample.bam
Recommended Workflow
Start from coordinate-sorted BAM files aligned to the same assembly as the annotation.
Decide gene-level vs feature-level summarization and set -f, -t, and -g accordingly.
Set library-specific flags explicitly: -p, --countReadPairs, -s, -M, --fraction, -Q.
Review both counts.txt and counts.txt.summary before downstream DE analysis.
Guardrails
Chromosome names must match between BAM and annotation; use -A alias mapping if they do not.
For paired-end libraries, -p alone assumes paired reads, but --countReadPairs is what switches counting from reads to fragments.
Strandness is easy to invert; verify whether the library is 0, 1, or 2 before counting the whole cohort.
-M uses the NH tag to detect multi-mappers; do not enable it blindly if aligner tags are inconsistent.
Annotation format defaults to GTF; specify -F SAF when using SAF input.
1---2name: feature-counts3description: Use when you need to assign aligned sequencing reads to genes or genomic features for expression quantification from SAM/BAM files4---56# feature-counts
78## Quick Start
9- **Command:** `featureCounts`
10- **Local executable:** `/home/vimalinx/miniforge3/envs/bio/bin/featureCounts`
11- **Version:** 2.1.1
12- **Full options:** see [references/help.md](references/help.md)
1314## When To Use This Tool
1516- Convert aligned RNA-seq BAM/SAM files into gene-level count matrices.
17- Count reads at exon level with `-f`, or junction-supporting reads with `-J`.
18- Handle stranded, paired-end, and multi-mapping policies explicitly.
19- Prefer this after `STAR` or `subjunc` when you need a simple, transparent counting step.
2021## Common Patterns
2223```bash
24# 1) Standard gene-level counting for paired-end, reversely stranded RNA-seq
25featureCounts \
26 -a genes.gtf \
27 -o counts.txt \
28 -T 8 \
29 -p --countReadPairs \
30 -s 2 \
31 sample.bam
32```
3334```bash
35# 2) Exon-level counting instead of gene-level summarization
36featureCounts \
37 -a genes.gtf \
38 -o exon_counts.txt \
39 -T 8 \
40 -f \
41 -t exon \
42 -g gene_id \
43 sample.bam
44```
4546```bash
47# 3) Count exon-exon junction support
48featureCounts \
49 -a genes.gtf \
50 -G genome.fa \
51 -o counts.txt \
52 -J \
53 sample.bam
54```
5556## Recommended Workflow
57581. Start from coordinate-sorted BAM files aligned to the same assembly as the annotation.
592. Decide gene-level vs feature-level summarization and set `-f`, `-t`, and `-g` accordingly.
603. Set library-specific flags explicitly: `-p`, `--countReadPairs`, `-s`, `-M`, `--fraction`, `-Q`.
614. Review both `counts.txt` and `counts.txt.summary` before downstream DE analysis.
6263## Guardrails
64- Chromosome names must match between BAM and annotation; use `-A` alias mapping if they do not.
65- For paired-end libraries, `-p` alone assumes paired reads, but `--countReadPairs` is what switches counting from reads to fragments.
66- Strandness is easy to invert; verify whether the library is `0`, `1`, or `2` before counting the whole cohort.
67- `-M` uses the `NH` tag to detect multi-mappers; do not enable it blindly if aligner tags are inconsistent.
68- Annotation format defaults to `GTF`; specify `-F SAF` when using SAF input.
Run npx skillmds add vimalinx/feature-counts in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Use when you need to assign aligned sequencing reads to genes or genomic features for expression quantification from SAM/BAM files It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
vimalinx (@vimalinx) published this skill. Their other Agent Skills are listed on their SkillMD profile.