featureCounts is a program that counts how many reads map to genomic features, such as genes, exon, promoter and genomic bins.
featureCounts can be used to count how many reads align to genes as follows:
$ featureCounts -p -O -T n -a example_genome_annotation.gtf -o example_featureCounts_output.txt sorted_example_alignment.bam
In this command…
-pspecies that fragments (or templates) will be counted instead of reads. This is only applicable for paired-end reads.
-Oassigns reads to all their overlapping meta-features.
-Tspecifies the number (
n) of threads to be used.
-ais the genome annotation file (
-ospecifies the name of the output file, which includes the read counts (
sorted_example_alignment.bamis an alignment file: in this file, the reads we want to count are aligned to the same genome as the annotation file.
In this video,
featureCounts is used to assign reads in an alignment file (
sorted_example_alignment.bam) to genes in a genome annotation file (
-sspecifies strand-specific read counting.
0for unstranded reads,
1for stranded reads and
2for reversely stranded reads. This depends on the library used in the sequencing protocol.
subreaduser guide: http://bioinf.wehi.edu.au/subread-package/SubreadUsersGuide.pdf