| calcComposition {CAGEfightR} | R Documentation |
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.
calcComposition( object, inputAssay = "counts", outputColumn = "composition", unexpressed = 0.1, genes = "geneID" )
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.) |
object with composition added as a column in rowData.
Other Calculation functions:
calcBidirectionality(),
calcPooled(),
calcShape(),
calcSupport(),
calcTPM(),
calcTotalTags(),
subsetByBidirectionality(),
subsetByComposition(),
subsetBySupport()
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')