angerami Claude Opus 4.8 commited on
Commit
21da706
Β·
1 Parent(s): 1b89601

Add tight-pair bond ultrametricity scores

Browse files

For each tight pair (a,b) β€” mutual nearest neighbors or the k smallest-D pairs β€”
average the Rammal index u over triples where (a,b) is the shortest edge; the
bond score 1-<u> separates the ultrametric backbone (high) from specific
contacts (low). Compared against a null computed the same way on a distance
matrix with shuffled off-diagonals; low-score pairs are expected to match the
most-negative D-C residual pairs, and bimodality marks the backbone-vs-contact
split.

tight_pair_scores returns the pair indices, per-bond scores, and null so they
can be cross-referenced against the R eigenvectors. Persisted to the .npz/summary
and surfaced in the dashboard with live method (MNN / smallest-D) and k controls,
a score-vs-null histogram, and a flagged low-score table tagged with residual
overlap.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

3 files changed +147 -1
Files changed (3)
apps/ultrametricity_view.py+53-1
scripts/run_ultrametricity.py+9
src/transformer_analysis/ultrametricity.py+85