compute_silhouette | R Documentation |
Given a projected object and its reference, calculate silhouette coefficient for query cells with respect to reference cells with the same cell labels.
compute_silhouette(
ref,
query = NULL,
reduction = "pca",
ndim = NULL,
label_col = "functional.cluster",
normalize.scores = FALSE,
min.cells = 20
)
ref |
Reference object |
query |
Query object. If not specified, the silhouette coefficient of only the reference will be calculated |
reduction |
Which dimensionality reduction to use for euclidian distance calculation |
ndim |
Number of dimensions in the dimred to use for distance calculation. If NULL, use all dimensions. |
label_col |
Metadata column with cell type annotations. Must be present both in reference and query |
normalize.scores |
Whether to normalize silhouette scores by the average cell type silhouettes of the reference |
min.cells |
Only report silhouette scores for cell type with at least this number of cells |
A dataframe with average silhouette coefficient for each cell type
data(query_example_seurat)
ref <- load.reference.map()
q <- Run.ProjecTILs(query_example_seurat, ref=ref, fast.umap.predict=TRUE)
combined <- compute_silhouette(ref, query=q)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.