Per-cluster Confidence Score: Calculates the Mahalanobis distance from user-defined query clusters to their nearest reference centroid after initial projection into reference PCA space. All query cells in a cluster get the same score. Higher distance indicates less confidence. Due to the instability of estimating covariance with small numbers of cells, we do not assign a score to clusters smaller than u * d, where d is the dimensionality of the embedding and u is specified.
calcPerClusterMappingMetric(
reference,
query,
query_cluster_labels,
metric = "mahalanobis",
u = 2,
lambda = 0
)A data.frame of per-cluster mapping metric scores for each user-specified query cluster.
Reference object as returned by Symphony buildReference()
Query object as returned by Symphony mapQuery()
Vector of user-defined labels denoting clusters / putative novel cell type to calculate the score for
Uses Mahalanobis by default, but added as a parameter for potential future use
Do not assign scores to clusters smaller than u * d (see above description)
Optional ridge parameter added to covariance diagonal to help stabilize numeric estimates