drisso / SingleCellExperiment

Clone of the Bioconductor repository for the SingleCellExperiment package, see https://bioconductor.org/packages/devel/bioc/html/SingleCellExperiment.html for the official development version.
63 stars 17 forks source link

Added prototype methods for combineCols. #60

Closed LTLA closed 3 years ago

LTLA commented 3 years ago

Ugh. Ugly but it mostly works.

library(SingleCellExperiment)
example(SingleCellExperiment)

# Dropping one of the reduced dims.
sce2 <- sce
reducedDim(sce2, "PCA") <- NULL

# Mocking up some alternative Experiments.
se1 <- SummarizedExperiment(list(counts=matrix(rpois(ncol(sce) * 5, 5), ncol=ncol(sce))))
rownames(se1) <- sprintf("SPIKE_%s", seq_len(nrow(se1)))
altExp(sce2, "THING") <- se1

combineCols(sce, sce2, use.names=FALSE)
## class: SingleCellExperiment 
## dim: 200 200 
## metadata(0):
## assays(2): counts logcounts
## rownames: NULL
## rowData names(0):
## colnames: NULL
## colData names(0):
## reducedDimNames(2): PCA tSNE
## mainExpName: NULL
## altExpNames(1): THING