ComputeSilhouetteScores: Calculate the silhouette score of a clustering.

View source: R/ComputeSilhouetteScores.R

ComputeSilhouetteScoresR Documentation

Calculate the silhouette score of a clustering.

Description

This function will compute the silhouette score for each cluster identified by Seurat's Louvain modularity optimization community detection algorithm.

Usage

ComputeSilhouetteScores(seurat.obj = NULL, dist.metric = "cosine", avg = TRUE)

Arguments

seurat.obj

The input object for which silhouette score will be computed. Defaults to NULL.

dist.metric

Which distance metric should be used? Defaults to "cosine", but any of the metrics used by dist will work.

avg

Should the average scores for each cluster be returned, or should a dataframe of every observation's cluster identity and score be returned? Defaults to TRUE.

Value

If avg = TRUE, returns the average silhouette score per cluster, else returns a cell-level dataframe of the cluster identities & silhouette scores.

Author(s)

Jack Leary

See Also

CosineDist.

Examples

## Not run: 
ComputeSilhouetteScores(seurat.obj)
ComputeSilhouetteScores(seurat.obj,
                        dist.metric = "euclidean",
                        avg = FALSE)

## End(Not run)

jr-leary7/SCISSORS documentation built on April 20, 2023, 8:21 p.m.