mergeSCESet: Merge SCESet objects

Description Usage Arguments Details Value Examples

View source: R/SCESet-methods.R

Description

Merge two SCESet objects that have the same features but contain different cells/samples.

Usage

1
mergeSCESet(x, y, fdata_cols = NULL, pdata_cols = NULL)

Arguments

x

an SCESet object

y

an SCESet object

fdata_cols

a character vector indicating which columns of featureData of x and y should be retained. Alternatively, an integer or logical vector can be supplied to subset the column names of fData(x), such that the subsetted character vector contains the columns to be retained. Defaults to all shared columns between fData(x) and fData(y).

pdata_cols

a character vector indicating which columns of phenoData of x and y should be retained. Alternatively, an integer or logical vector to subset the column names of pData(x). Defaults to all shared columns between pData(x) and pData(y).

Details

Existing cell-cell pairwise distances and feature-feature pairwise distances will not be valid for a merged SCESet object. These entries are subsequently set to NULL in the returned object. Similarly, new experimentData will need to be added to the merged object.

If fdata_cols does not include the definition of feature controls, the control sets may not be defined in the output object. In such cases, a warning is issued and the undefined control sets are removed from the featureControlInfo of the merged object.

It is also strongly recommended to recompute all size factors using the merged object, and re-run normalize before using exprs. For arbitrary x and y, there is no guarantee that the size factors (and thus exprs) are comparable across objects.

Value

a merged SCESet object combining data and metadata from x and y

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data("sc_example_counts")
data("sc_example_cell_info")
pd <- new("AnnotatedDataFrame", data = sc_example_cell_info)
example_sceset <- newSCESet(countData = sc_example_counts, phenoData = pd)
mergeSCESet(example_sceset[, 1:20], example_sceset[, 21:40])

## with specification of columns of fData
example_sceset <- calculateQCMetrics(example_sceset)
mergeSCESet(example_sceset[, 1:20], example_sceset[, 21:40], fdata_cols = c(1, 7))

## with specification of columns of pData
mergeSCESet(example_sceset[, 1:20], example_sceset[, 21:40], pdata_cols = 1:6)
mergeSCESet(example_sceset[, 1:20], example_sceset[, 40], pdata_cols = 3)

dynverse/scaterlegacy documentation built on Feb. 17, 2020, 5:07 a.m.