| getGeneCounts {icetea} | R Documentation |
Get gene-level counts from TSS data
getGeneCounts( CSobject, transcriptGRL, regionAroundTSS = 500, outfile = NA, ncores = 1 ) ## S4 method for signature 'CapSet' getGeneCounts( CSobject, transcriptGRL, regionAroundTSS = 500, outfile = NA, ncores = 1 )
CSobject |
The |
transcriptGRL |
A GRangesList object containing transcripts, created using transcriptsBy(txdb) |
regionAroundTSS |
integer, indicating how many bases downstream of TSS to count |
outfile |
character. Tab-separated output file name (if required) |
ncores |
integer. No. of cores/threads to use |
data.frame with gene-level counts for all genes in the txdb object
# load a txdb object
library("TxDb.Dmelanogaster.UCSC.dm6.ensGene")
seqlevelsStyle(TxDb.Dmelanogaster.UCSC.dm6.ensGene) <- "ENSEMBL"
# get transcripts by gene (only X chromsome, for simplicity)
seqlevels(TxDb.Dmelanogaster.UCSC.dm6.ensGene) <- "X"
dm6trans <- transcriptsBy(TxDb.Dmelanogaster.UCSC.dm6.ensGene, "gene")
# load a CapSet object
cs <- exampleCSobject()
# get gene counts, counting reads around 500 bp of the TSS
gcounts <- getGeneCounts(cs, dm6trans)