Aggregates feature expression by cell clusters, per batch if provided.
Source:R/IntegrationMethods.R
AggregateDataByBatch.Rd
The function aggregates feature expression by cell clusters, per batch if provided.
Usage
AggregateDataByBatch.SingleCellExperiment(object, batch.label, nhvg, p, ...)
# S4 method for class 'SingleCellExperiment'
AggregateDataByBatch(object, batch.label, nhvg = 2000L, p = 30L, ...)
Arguments
- object
An object of
SingleCellExperiment
class.- batch.label
Cluster identities vector corresponding to the cells in
mtx
.- nhvg
Integer of the number of highly variable features to select. By default
2000
.- p
Integer. By default
30
.- ...
Parameters to be passed to
ClusterCells()
function.
Examples
if (FALSE) { # \dontrun{
# Import package
suppressPackageStartupMessages(library("SingleCellExperiment"))
# Import data from Zenodo
data.url <- "https://zenodo.org/records/14845751/files/pbmc_10Xassays.rds?download=1"
sce <- readRDS(file = url(data.url))
# Run with a batch
set.seed(1204)
sce <- AggregateDataByBatch(object = sce, batch.label = "batch")
logcounts(sce)[1:10,1:10]
head(metadata(sce)$clusters)
# Run without a batch
set.seed(1204)
sce <- AggregateDataByBatch(object = sce, batch.label = NULL)
logcounts(sce)[1:10,1:10]
head(metadata(sce)$clusters)
} # }