Combine multiple objects
Examples
data(SingleCellExperiment_splatter, package = "AcidTest")
## SingleCellExperiment ====
x <- SingleCellExperiment_splatter
colnames(x) <- paste0(
"cell",
AcidBase::strPad(
x = as.character(seq_len(ncol(x))),
width = 4L,
side = "left",
pad = "0"
)
)
y <- x
colnames(y) <- paste0(
"cell",
AcidBase::strPad(
x = as.character(seq_len(ncol(y)) + ncol(y)),
width = 4L,
side = "left",
pad = "0"
)
)
## Combine the two objects.
c <- combine(x, y)
#> → Combining objects into `RangedSummarizedExperiment`.
#> → Binding columns in `assays()`: "counts".
#> → Checking row data.
#> → Updating column data.
#> → Updating metadata.
sampleData(c)
#> DataFrame with 4 rows and 2 columns
#> sampleName interestingGroups
#> <factor> <factor>
#> sample3 sample3 sample3
#> sample4 sample4 sample4
#> sample1 sample1 sample1
#> sample2 sample2 sample2
print(c)
#> class: SingleCellExperiment
#> dim: 100 800
#> metadata(2): date combine
#> assays(1): counts
#> rownames(100): gene001 gene002 ... gene099 gene100
#> rowData names(10): broadClass description ... ncbiGeneId seqCoordSystem
#> colnames(800): cell0001 cell0002 ... cell0799 cell0800
#> colData names(1): sampleId
#> reducedDimNames(0):
#> mainExpName: NULL
#> altExpNames(0):