Description Usage Arguments Value Examples
View source: R/helper_functions.R
CID.smooth
uses k-nearest neighbors to identify cells which
correspond to a different label than the majority of their first-degree neighbors. If so,
those annotations are "smoothed."
1 | CID.smooth(ac, dM)
|
ac |
list containing a character vector where each element is a cell type or cell state assignment. |
dM |
distance matrix (see ?CID.GetDistMat). |
A character vector with smoothed labels
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
# load data classified previously (see SignacFast)
P <- readRDS("celltypes.rds")
S <- readRDS("pbmcs.rds")
# get edges from default assay from Seurat object
default.assay <- Seurat::DefaultAssay(S)
edges = S@graphs[[which(grepl(paste0(default.assay, "_nn"), names(S@graphs)))]]
# get distance matrix
D = CID.GetDistMat(edges)
# smooth labels
smoothed = CID.smooth(ac = P$CellTypes, dM = D[[1]])
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.