subsetByComposition: Subset by composition across samples

Description Usage Arguments Value See Also Examples

View source: R/subsetBy.R

Description

A convenient wrapper around calcComposition and subset.

Usage

1
2
3
4
5
6
7
8
subsetByComposition(
  object,
  inputAssay = "counts",
  outputColumn = "composition",
  unexpressed = 0.1,
  genes = "geneID",
  minSamples = 1
)

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 allowed.)

minSamples

numeric: Only features with composition in more than this number of samples will be kept.

Value

RangedSummarizedExperiment with composition values added as a column in rowData and features with less composition than minSamples removed.

See Also

Other Subsetting functions: subsetByBidirectionality(), subsetBySupport()

Other Calculation functions: calcBidirectionality(), calcComposition(), calcPooled(), calcShape(), calcSupport(), calcTPM(), calcTotalTags(), subsetByBidirectionality(), subsetBySupport()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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')
exampleUnidirectional <- subset(exampleUnidirectional, !is.na(geneID))

# Keep only clusters more than 10% in more than one sample:
calcComposition(exampleUnidirectional)

# Keep only clusters more than 5% in more than 2 samples:
subsetByComposition(exampleUnidirectional, unexpressed = 0.05, minSamples=2)

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