Correlation between cell bins for the given labels and features.
Usage
CellBinsFeatureCorrelation.SingleCellExperiment(object, labels, method)
# S4 method for class 'SingleCellExperiment'
CellBinsFeatureCorrelation(object, labels = NULL, method = "pearson")
Arguments
- object
An object of
SingleCellExperiment
class obtained with the functionBinCellClusterProbability()
.- labels
Character of label(s) from the label provided to the function
BinCellClusterProbability()
. By defaultNULL
, i.e., all labels are used.- method
Character specifying the correlation method to use. One of
"pearson"
,"kendall"
or"spearman"
. By default"pearson"
is used.
Value
A data frame with the correlation coefficient for each feature (rows) across labels (columns).
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
# Pearson correlated features with "Monocyte"
cor.features.mono <- CellBinsFeatureCorrelation(object = cellstate.sce,
labels = "Monocyte")
} # }