Repository navigation
Keep a target number of WGCNA edges instead of a frozen cutoff - #138
Merged
Merged
Conversation
Training graphs were binarized with a per-dataset adjacency_threshold copied from an old explorer sweep. Those cutoffs do not keep a fixed edge density once the train fold, node set, or corrections change, so graphs that were supposed to be comparable were not. WGCNA training now requires adjacency_target_connectivity and keeps the strongest train-fold edges nearest to that density. STRING still uses adjacency_threshold. There is no silent fallback from one to the other. The stats explorer still sweeps a cutoff, and it has to say so with wgcna_binarization=fixed_threshold. Cache directories follow the setting that actually built the graph, so a density-targeted WGCNA cache cannot be reused as a cutoff cache. Co-authored-by: Cursor <cursoragent@cursor.com>
johmathe
approved these changes
Sep 24, 2026
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.
Why
WGCNA graphs were binarized with a per-dataset
adjacency_thresholdcopied from an old explorer sweep. That cutoff does not keep a fixed edge density once the train fold, node set, or corrections change. Graphs that were supposed to be comparable were not.What changed
WGCNA training requires
adjacency_target_connectivity. The builder keeps the strongest train-fold edges nearest to that density (10% in the dataset YAMLs). STRING still usesadjacency_threshold.There is no silent fallback. Missing the parameter that the method actually uses is an error. The website stats explorer still sweeps a cutoff, and it has to say so with
wgcna_binarization=fixed_threshold.Cache directories follow the setting that built the graph, so a density-targeted WGCNA cache cannot be reused as a cutoff cache.
baseline.pylooks up GNN feature artifacts with the same name.What this PR does not change
split_typestaysfixedonmain. That is a separate default-protocol change.Tests
Covers fail-loud validation, exact nearest-edge counts, deterministic ties, WGCNA vs STRING cache names, config consistency, and the stats explorer opting into
fixed_threshold.