feature-counts
Quick Start
- Command:
featureCounts - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/featureCounts - Version: 2.1.1
- Full options: see references/help.md
When To Use This Tool
- Convert aligned RNA-seq BAM/SAM files into gene-level count matrices.
- Count reads at exon level with
-f, or junction-supporting reads with-J. - Handle stranded, paired-end, and multi-mapping policies explicitly.
- Prefer this after
STARorsubjuncwhen you need a simple, transparent counting step.
Common Patterns
# 1) Standard gene-level counting for paired-end, reversely stranded RNA-seq
featureCounts \
-a genes.gtf \
-o counts.txt \
-T 8 \
-p --countReadPairs \
-s 2 \
sample.bam
# 2) Exon-level counting instead of gene-level summarization
featureCounts \
-a genes.gtf \
-o exon_counts.txt \
-T 8 \
-f \
-t exon \
-g gene_id \
sample.bam
# 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-gaccordingly. - Set library-specific flags explicitly:
-p,--countReadPairs,-s,-M,--fraction,-Q. - Review both
counts.txtandcounts.txt.summarybefore downstream DE analysis.
Guardrails
- Chromosome names must match between BAM and annotation; use
-Aalias mapping if they do not. - For paired-end libraries,
-palone assumes paired reads, but--countReadPairsis what switches counting from reads to fragments. - Strandness is easy to invert; verify whether the library is
0,1, or2before counting the whole cohort. -Muses theNHtag to detect multi-mappers; do not enable it blindly if aligner tags are inconsistent.- Annotation format defaults to
GTF; specify-F SAFwhen using SAF input.