Frequency of cells per cell cluster probability bin by group for each label.
The label has to be specified beforehand to the function BinCellClusterProbability()
.
Usage
TabulateCellBinsByGroup.SingleCellExperiment(object, group, relative, margin)
# S4 method for class 'SingleCellExperiment'
TabulateCellBinsByGroup(object, group, relative = FALSE, margin = 1)
Arguments
- object
An object of
SingleCellExperiment
class obtained with the functionBinCellClusterProbability()
.- group
Character specifying the
colData
variable from theSingleCellExperiment
object provided to the functionBinCellClusterProbability()
to use as categorical group variable.- relative
Logical specifying if relative proportions of cell bins per
group
should be returned. By defaultFALSE
, i.e., absolute values are returned.- margin
If
relative
isTRUE
, proportions should be calculated by: rows (1
, the default); columns (2
); or overall (NULL
).
Value
A list of tables with the frequency of cells per bin of cell cluster probability by group for each label.
Examples
if (FALSE) { # \dontrun{
# Packages
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))
# Prepare data
sce <- PrepareData(object = sce)
# Multi-level integration - 'L = 4' just for highlighting purposes
set.seed(123)
sce <- RunParallelDivisiveICP(object = sce, batch.label = "batch", L = 4,
threads = 2)
# Cell states SCE object for a given cell type annotation or clustering
cellstate.sce <- BinCellClusterProbability(object = sce, label = "cell_type",
icp.round = 4, bins = 20)
cellstate.sce
# Tabulate cell bins by group
# give an interesting variable to the "group" parameter
cellbins.tables <- TabulateCellBinsByGroup(object = cellstate.sce,
group = "batch",
relative = TRUE,
margin = 1)
} # }