基于注释文件把 RNA-seq 比对 reads 计数到 gene/exon/feature。Assigns aligned RNA-seq reads to genes, exons, or other genomic features.
mamba install -c bioconda subread
单样本 gene count:
featureCounts -T 8 -a genes.gtf -o counts.txt sample.sorted.bam
多样本批量计数:
featureCounts -T 12 -p -B -C -a genes.gtf -o gene_counts.txt *.sorted.bam
指定 strandedness:
featureCounts -T 8 -s 2 -a genes.gtf -o stranded_counts.txt *.bam
-a:注释文件。-o:输出 counts 文件。-T:线程数。-p:paired-end fragments 计数。-s:链特异性,0 unstranded,1 stranded,2 reversely stranded。-t / -g:feature 类型和分组字段,默认常用于 exon 到 gene_id。-s 错误会显著降低 assigned reads,需按建库类型确认。-p 要和分析目标一致。