Calculate batch silhouette width from an embedding
rs_batch_silhouette_width.RdComputes the average silhouette width on batch labels using pairwise distances in the embedding space. Values near 0 indicate good batch mixing, values near 1 indicate batch separation.
Arguments
- embedding
Numeric matrix. The embedding to assess (e.g. PCA or corrected embedding). Rows are cells, columns are dimensions.
- batch_vector
Integer vector. The integers indicate to which batch a given cell belongs.
- max_cells
Integer or NULL. If not NULL, subsample to this many cells for performance. Defaults to 5000.
- seed
Integer. Seed for subsampling reproducibility.