-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run HDBSCAN directly on genetic distances and compare clusters to those from embeddings #119
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds a rule to apply HDBSCAN clustering to the genetic distance matrix that we use to produce the embeddings. We name this clustering "method" as "genetic" and include it in the grid search to find the optimal distance threshold per method for early H3N2 HA data. Related to #99
Updates the early flu workflow to use the new `--distance-matrix` input argument to the `pathogen-cluster` command and adds the "genetic" method to the logic for plotting cluster accuracy by distance threshold. Adds the corresponding cluster accuracy table and figure for early flu.
Adds clustering of genetic distances to the early SC2 workflow and updates the downstream figures and tables to include the optimal distance thresholds for genetic distance clusters by pathogen and clade type.
huddlej
force-pushed
the
cluster-by-distances
branch
from
July 30, 2024 22:41
a29f896
to
b269d6a
Compare
Updates results for late SC2 based on updated optimal cluster parameter. Also updates the flu cluster accuracy replication figure for an unclear reason.
Increases the range of distance thresholds to use for the grid search across clusters for flu and SC2 from an upper limit of 7 to 20. This increase comes from the initial result that the optimal threshold for genetic distance clusters of SC2 data plateaued at the highest distance threshold which suggested that higher thresholds might yield more accurate clusters. These results confirm that higher distance thresholds produce more accurate genetic clusters, while clusters from the embedding methods had reached their optimal values in the original range of the analysis.
Adds genetic clusters to early flu analyses including tables for monophyly, mutations, and within and between cluster distances and the Auspice JSON.
Fixes a bug in the late flu and HA/NA workflows where -1 cluster labels from HDBSCAN did not count toward the VI distance between clusters and known genetic groups. All workflows should count these -1 labels toward the VI distance, since we want to penalize methods that produce clusters with more unclustered samples than others. While the early flu and both early and late SC2 workflows included -1 labels, the late flu and HA/NA workflows did not.
Updates late flu and HA/NA accuracies to reflect the inclusion of -1 cluster labels in the accuracy calculations. This change in the workflow logic had little effect on the results.
Adds genetic distance cluster results and methods to text.
Fixes an off-by-one error with cluster counts where the "-1" label was being counted toward the number of clusters per method, causing all counts in Supplementary Table S1 to be one higher than expected for several rows.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds rules to all natural flu and SARS-CoV-2 workflows to apply HDBSCAN clustering to the genetic distance matrix that we use to produce the embeddings. We name this clustering "method" as "genetic" and include it in the grid search to find the optimal distance threshold per method for early H3N2 HA data. This PR updates tables, figures, and manuscript text to reflect the inclusion of these genetic distance clusters as a point of comparison to embedding clusters.
Development checklist
Related issues
Depends on blab/pathogen-embed#33
Closes #99