Repository navigation
Fixed Foldseek similarities, 2D split ratios, and cluster stratification - #36
Open
weitse-hsu wants to merge 6 commits into
Open
weitse-hsu wants to merge 6 commits into
weitse-hsu wants to merge 6 commits into
Conversation
Author
|
Hi @Old-Shatterhand, thanks for approving the CI runs. I’ve pushed 65ce26a to fix the pre-existing test collection issues. Running the suite also exposed a Foldseek identifier-handling regression introduced by this PR, which I’ve corrected in the same commit. Both CI commands now pass locally. Please let me know if there’s anything you’d like clarified or adjusted. Thanks for taking a look! |
This file contains hidden or 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
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.
This PR corrects Foldseek similarity calculations, repeated ratio conversion in C2/I2, and incorrect class counts passed to the solver after clustering or overflow splitting. It includes regression tests for each fix.
Foldseek similarities
Foldseek labels such as
protein.pdb_Awere not mapped consistently to entity names, so matrix construction could miss the aggregated chain scores. The matrix loop also counted columns from zero when iterating over a sliced name list, placing scores in the wrong cells and sometimes overwriting the diagonal.The fixes make identifier handling consistent and start the column index at
i + 1, while preserving the existing chain-selection and scoring rules. In the multichain regression fixture, the expected similarity is 0.51; upstream returns 0.10, and the patched version returns 0.51.See 5dc67a5, d7b6405, and 37ca771.
C2/I2 split ratios
Overflow preprocessing already converts requested ratios into per-axis targets, but the solvers converted them again. For an
8:1:1request, this changed the weight targets from approximately 58.6/20.7/20.7% to 45.7/27.2/27.2%.The solvers now use the targets returned by preprocessing for both weight and stratification constraints. Public arguments are unchanged, but direct callers of the internal C2/I2 solvers must pass already-converted, overflow-adjusted targets. These are per-axis targets, not a guarantee of exact proportions among retained interactions.
See 9d16024.
Cluster stratification
C2 passed entity-level interaction counts to the solver instead of cluster totals. For example, a cluster with counts
[3,1]could receive its representative entity’s[1,1].Overflow splitting also left class counts attached to old cluster memberships. This could preserve the overall totals while assigning counts to the wrong clusters. The patch passes cluster totals to C2 and rebuilds both entity- and interaction-class counts after splitting.
See 870abd3 and 37ca771.
Tests
All 70 focused regression cases pass; the same tests on upstream produce 59 failures and 11 passes. Validation includes native SCIP cases and real Foldseek runs checked against independently calculated similarities. Broader comparisons found no new failures in existing tests.
I could not complete full-suite collection because of missing
pytest_casesand a pre-existing syntax error intest_stratification.py. Separate overflow defects and memory/scalability work are outside this PR.