Bin cell cluster probability by a given cell label.
Usage
BinCellClusterProbability.SingleCellExperiment(
object,
label,
icp.run,
icp.round,
funs,
bins,
aggregate.bins.by,
use.assay
)
# S4 method for class 'SingleCellExperiment'
BinCellClusterProbability(
object,
label,
icp.run = NULL,
icp.round = NULL,
funs = "mean",
bins = 20,
aggregate.bins.by = "mean",
use.assay = "logcounts"
)
Arguments
- object
An object of
SingleCellExperiment
class with ICP cell cluster probability tables saved inmetadata(object)$coralysis$joint.probability
. After running one ofRunParallelICP
orRunParallelDivisiveICP
.- label
Label of interest available in
colData(object)
to group by the bins of cell cluster probability.- icp.run
ICP run(s) to retrieve from
metadata(object)$coralysis$joint.probability
. By defaultNULL
, i.e., all are retrieved. Specify a numeric vector to retrieve a specific set of tables.- icp.round
ICP round(s) to retrieve from
metadata(object)$coralysis$joint.probability
. By defaultNULL
, i.e., all are retrieved. Only relevant if probabilities were obtained with the functionRunParallelDivisiveICP
, i.e., divisive ICP was performed. Otherwise it is ignored and internally assumed asicp.round = 1
, i.e., only one round.- funs
One function to summarise ICP cell cluster probability. One of
"mean"
or"median"
. By default"mean"
.- bins
Number of bins to bin cell cluster probability by cell
label
given. By default20
.- aggregate.bins.by
One function to aggregate One of
"mean"
or"median"
. By default"mean"
.- use.assay
Name of the assay that should be used to obtain the average expression of features across cell
label
probability bins.
Value
A SingleCellExperiment
class object with feature average expression by
cell label
probability bins.
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
} # }