SGD
is a evaluation metric for Spatial Transcriptomics data. It addresses the limitations of existing clustering evaluation metrics by accounting for label agreement, spatial locations, and error severity simultaneously.
To install the package from GitHub, use the following command:
# Install the package from GitHub
if (!requireNamespace("devtools", quietly = TRUE)) {
install.packages("devtools")
}
devtools::install_github("YihDu/SGD")
SGD provides a unbiased clustering evaluation metric for spatial transcriptomics data. It accounts for the label agreement between the clustering results and the ground truth, spatial label distribution, and the mislabel severity simultaneously.
true_labels : numeric or factor
Ground truth labels of the dataset. These represent the actual class labels that we wish to compare with the predicted clusters.
cluster_labels : numeric or factor
The predicted labels or clusters generated by the clustering algorithm.
spatial_coordinates : matrix or data.frame
A matrix or data frame that contains the spatial or positional coordinates of the data points. These coordinates are used to account for the spatial relationships in the analysis.
match_cluster_labels : logical (default = TRUE)
If TRUE, the function will attempt to match the cluster labels with the ground truth labels. This is useful when the cluster labels are not in the same order as the ground truth labels.
params : list (optional)
A list of additional parameters that control the behavior of the function.