| runCCI | R Documentation |
Generic function for scoring cell-cell interactions. Dispatches on the
class of x:
runCCI.blisa accepts a blisa object. If
CCI_scores are already present and overwrite = FALSE
(the default), the object is returned unchanged. Set
overwrite = TRUE with a counts_by_group to recompute and
replace existing scores. If no scores exist, counts_by_group
must be supplied and scores are computed and attached.
runCCI.default performs the raw computation given a
blisa object and a counts_by_group list, returning only
the scores data frame. Used internally by runCCI.blisa and
blisa.default.
runCCI(x, ...)
## S3 method for class 'blisa'
runCCI(x, counts_by_group = NULL, overwrite = FALSE, weighted = TRUE, ...)
## Default S3 method:
runCCI(x, counts_by_group, weighted = TRUE, ...)
x |
A |
... |
Additional arguments passed to the relevant method. |
counts_by_group |
Named list of gene-by-bin sparse count matrices, one
per group level (e.g. cell type). Typically the |
overwrite |
Logical. If |
weighted |
Logical. If |
See individual method documentation.
runCCI.blisa: the input blisa object with
CCI_scores populated (a wide data frame – rows are
"Sender->Receiver" group pairs, columns are LR pairs).
runCCI.default: a data frame with "Sender->Receiver"
row names and one column per significant LR pair containing the
interaction score 0.5 * log2(receiver * sender + 1).
runCCI(blisa): Method for a blisa object. If CCI_scores
are already present and overwrite = FALSE (the default), the object
is returned unchanged. Set overwrite = TRUE with a
counts_by_group to recompute and replace existing scores. If no
scores exist, counts_by_group must be supplied and scores are
computed and attached to x$CCI_scores.
runCCI(default): Default method. Performs the raw CCI computation and
returns only the scores data frame. Typically called internally; use
runCCI.blisa to compute and attach scores to a blisa object
in one step.
## Not run:
# Continuing from the blisa() example:
# result <- blisa(spe, bin_size = 50, group = "cell_type")
# CCI is computed automatically when group is supplied to blisa();
# access the scores directly:
head(result$CCI_scores)
# Or compute / recompute scores explicitly:
binned <- hexBinCells(
as.data.frame(SpatialExperiment::spatialCoords(spe)),
SummarizedExperiment::assay(spe, "counts"),
bin_size = 50, group = spe$cell_type
)
result2 <- runCCI(result, counts_by_group = binned$counts_by_group,
overwrite = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.