Merge: Merge datasets into one by determining a common genes

Description Usage Arguments Details Value Examples

View source: R/merge.R

Description

Merge the count data from different batches into one object

Usage

1
Merge(objects, use.de.genes = TRUE)

Arguments

objects

A list of SingleCellExperiment objects, each representing a SingleCellExperiment object from a single batch.

use.de.genes

logical to specify if DE genes shoud be computed, when FALSE the batches are merged on the set of common genes across batches.

Details

Concatenate the expression counts of all cells from different batches into one expression count object. The merging is done on the set of union of DE genes obtained from the clustering of each batch.

Value

A SingleCellExperiment object with an additional column named Batch in colData column. The column stores the origin of the batch for each cell. The different batches are labeled in the order as appearing in the input list.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(SingleCellExperiment)
ncells <- 500
ngenes <- 2000
counts.1 <- matrix(rpois(ncells*ngenes, lambda = 10), ncol=ncells, nrow=ngenes, byrow=TRUE)
rownames(counts.1) <- paste0("Gene", seq_len(ngenes))
colnames(counts.1) <- paste0("Cell", seq_len(ncells))
sce.1 <- SingleCellExperiment(assays = list(counts = counts.1))

counts.2 <- matrix(rpois(ncells*ngenes, lambda = 15), ncol=ncells, nrow=ngenes, byrow=TRUE)
rownames(counts.2) <- paste0("Gene", seq_len(ngenes))
colnames(counts.2) <- paste0("Cell", seq_len(ncells))
sce.2 <- SingleCellExperiment(assays = list(counts = counts.2))

mix_sce <- Merge(list(sce.1, sce.2), use.de.genes =FALSE)

debsin/dropClust documentation built on Nov. 4, 2019, 10:22 a.m.