calcComposition: Calculate composition of CAGE data.

Description Usage Arguments Value See Also Examples

View source: R/calc.R

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

1
2
3
4
5
6
7
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

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

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

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

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