Cell cluster probability distribution
Source:R/CellStateMethods.R
CellClusterProbabilityDistribution.RdPlot cell cluster probability distribution per label by group.
Usage
CellClusterProbabilityDistribution.SingleCellExperiment(
object,
label,
group,
probability
)
# S4 method for class 'SingleCellExperiment'
CellClusterProbabilityDistribution(
object,
label,
group,
probability = "scaled_mean_probs"
)Arguments
- object
An object of
SingleCellExperimentclass with aggregated cell cluster probability available incolData(object), which can be obtained after runningSummariseCellClusterProbability().- label
Character specifying the
colDatavariable to use as cell type/cluster label.- group
Character specifying the
colDatavariable to use as categorical group variable.- probability
Character specifying the aggregated cell cluster probability variable available in
colData, used to plot its distribution. One of"mean_probs","scaled_mean_probs","median_probs","scaled_median_probs". The availability of these variables incolDatadepends on the parameters given to the functionSummariseCellClusterProbability()beforehand. By default assumes that"scaled_mean_probs"is available incolData, which is only true ifSummariseCellClusterProbability()function was run withfuns = "mean"andscale.funs = TRUE.
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)
# Summarise cell cluster probability
sce <- SummariseCellClusterProbability(object = sce, icp.round = 4) # saved in 'colData'
# Search for differences in probabilities across group(s)
# give an interesting variable to the "group" parameter
prob.dist <- CellClusterProbabilityDistribution(object = sce, label = "cell_type",
group = "batch",
probability = "scaled_mean_probs")
prob.dist # print plot
} # }