Skip to content

Add Ward linkage clustering protocol - #46

Merged
lwaldron merged 5 commits into
waldronlab:mainfrom
ohih8:protocol/ward-linkage-signature-matrix-clustering
Oct 18, 2026
Merged

lwaldron merged 5 commits into
waldronlab:mainfrom
ohih8:protocol/ward-linkage-signature-matrix-clustering

Conversation

@ohih8

@ohih8 ohih8 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Adds the Ward-linkage signature similarity matrix clustering protocol.

The protocol:

  • specifies Ward minimum-variance hierarchical linkage;
  • defines required similarity matrix and distance prerequisites;
  • preserves the original similarity values while applying dendrogram ordering;
  • documents annotations, tie handling, and clustering provenance;
  • keeps similarity calculation and preprocessing out of scope.

Closes #9

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Merge tie-breaking and dendrogram orientation need explicit conventions to produce reproducible results across implementations.

2 open issues
What changed in this PR

Adds a reusable Ward-linkage protocol for clustering and displaying signature similarity matrices.

Changes:

  • Defines matrix and Ward-compatible distance prerequisites.
  • Describes clustering, annotated heatmaps, and provenance recording.
  • Preserves similarity values and excludes preprocessing.
File Description
protocols/​ward-linkage-signature-matrix-clustering/​protocol.md Adds the clustering protocol, input requirements, outputs, and interpretation limits.

Review effort: Balanced

Comment on lines +76 to +78
Use a deterministic tie rule and record it when two candidate merges have the
same objective increase. Record the linkage method, distance representation,
tie rule, merge sequence or dendrogram, and any software and version used.
Comment on lines +87 to +90
Use the leaf order of the Ward dendrogram to order both rows and columns of
the original similarity matrix. Apply the identical order to every annotation
track. Do not replace the similarity values with distances or reorder rows
and columns independently.
…rule

Take the similarity-to-distance conversion (1 - s) into this protocol as
issue waldronlab#9 specifies, state that the Ward criterion is applied to squared
distances (ward.D2, not ward.D), give the Lance-Williams update, define
the default tie rule by input index, and require the leaf order to be
recorded.

Drafted with Claude Code.
@lwaldron
lwaldron merged commit bef43e3 into waldronlab:main Oct 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Protocol: cluster and display a signature similarity matrix

3 participants