calcComposition {CAGEfightR}R Documentation

Calculate composition of CAGE data.

Description

For every feature, count in how many samples it is expressed above a certain fraction (e.g. 10 percent) within a grouping, usually genes. This count is refered to as the 'composition' value.

Usage

calcComposition(object, inputAssay = "counts", outputColumn = "composition",
  unexpressed = 0.1, genes = "geneID")

Arguments

object

RangedSummarizedExperiment: CAGE data quantified at CTSS, cluster or gene-level.

inputAssay

character: Name of assay holding input expression values.

outputColumn

character: Name of column in rowRanges to hold composition values.

unexpressed

numeric: Composition will be calculated based on features larger than this cutoff.

genes

character: Name of column in rowData holding genes (NAs are not currently allowed.)

Value

object with composition added as a column in rowData.

See Also

Other Calculation functions: calcBidirectionality, calcPooled, calcShape, calcSupport, calcTPM, calcTotalTags, subsetByBidirectionality, subsetByComposition, subsetBySupport

Examples

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',
                                      swap='thick')

# Calculate composition values:
exampleUnidirectional <- subset(exampleUnidirectional, !is.na(geneID))
calcComposition(exampleUnidirectional)

# Use a lower threshold
calcComposition(exampleUnidirectional,
                unexpressed=0.05,
                outputColumn='lenientComposition')

[Package CAGEfightR version 1.0.0 Index]