This is a test version of Biostars. For the public version, visit https://www.biostars.org.
number of .bam reads mapping to genes in gff format

Hi,

I have a gff file containing a gene set and I also have a .bam file with read mappings to the genome. How can I get the number of reads that map to each gene (which as Start/Stop codon, CDS, intron specified in the gff file).

Any help will be greatly appreciated.

Thanks,
-n

mapping bams gff

2 answers

You can use featureCounts, htseq-count, or Rsamtools with GenomicFeatures in R (you'd need to use the findOverlaps() function). featureCounts and htseq-count are probably the easier options.

+1 for featureCounts speed.

You can use the intersect sub-command of bedtools with the -c option.

Log in to answer this question.