quantifyGenes: Quantify expression of genes

Description Usage Arguments Value See Also Examples

View source: R/quantify.R

Description

Obtain gene-level expression estimates by summing clusters annotated to the same gene. Unannotated transcripts (NAs) are discarded.

Usage

1
quantifyGenes(object, genes, inputAssay = "counts", sparse = FALSE)

Arguments

object

RangedSummarizedExperiment: Cluster-level expression values.

genes

character: Name of column in rowData holding gene IDs (NAs will be discarded).

inputAssay

character: Name of assay holding values to be quantified, (usually counts).

sparse

logical: If the input is a sparse matrix, TRUE will keep the output matrix sparse while FALSE will coerce it into a normal matrix.

Value

RangedSummarizedExperiment with rows corresponding to genes. Location of clusters within genes is stored as a GRangesList in rowRanges. seqinfo and colData is copied over from object.

See Also

Other Quantification functions: quantifyCTSSs2(), quantifyCTSSs(), quantifyClusters()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(exampleUnidirectional)

# Annotate clusters with geneIDs:
library(TxDb.Mmusculus.UCSC.mm9.knownGene)
txdb <- TxDb.Mmusculus.UCSC.mm9.knownGene
exampleUnidirectional <- assignGeneID(exampleUnidirectional,
                                      geneModels=txdb,
                                      outputColumn='geneID')

# Quantify counts within genes:
quantifyGenes(exampleUnidirectional, genes='geneID', inputAssay='counts')

# For exceptionally large datasets,
# the resulting count matrix can be left sparse:
quantifyGenes(exampleUnidirectional,
              genes='geneID',
              inputAssay='counts',
              sparse=TRUE)

CAGEfightR documentation built on Nov. 8, 2020, 5:42 p.m.