Description Usage Arguments Details Value Examples
View source: R/convenience_funcs.R
merge_sce_coldata
returns the original SCE object with additional
ColData merged from another SCE object with overlapping cells. If there are
columns with the same name, the columns from the cmp_SCE will be suffixed
with "_cmp".
1 | merge_sce_coldata(orig_sce, cmp_sce)
|
orig_sce |
SCE object that is to be retained. |
cmp_sce |
SCE object with overlapping cells (cells must have the same names) and additional ColData to incorporate. |
This function is useful for example when analyzing the same dataset with Seurat and the DropletUtils/scater/scran pipeline and then needing to visualize column data from the two analyses on the same embedding. It seems easier to convert Seurat to SCE than from SCE to Seurat.
The original SCE object with additional ColData from the second SCE object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # load example dataset from Seurat
data("pbmc_small", package="Seurat")
pbmc_small_sce <- Seurat::as.SingleCellExperiment(pbmc_small)
pbmc_small_sce2 <- pbmc_small_sce
# remove some cells from pbmc_small_sce
pbmc_small_sce <- pbmc_small_sce[, c(-78:-80)]
# remove different cells from pbmc_small_sce2
pbmc_small_sce2 <- pbmc_small_sce2[, c(-7,-77)]
# add a fake ColData column to pbmc_small_sce2
pbmc_small_sce2$fake_col <- sample(x=7, size=ncol(pbmc_small_sce2), replace=TRUE)
merge_sce_coldata(pbmc_small_sce, pbmc_small_sce2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.