Skip to content

Keep a target number of WGCNA edges instead of a frozen cutoff - #138

Merged
cornelislouisa merged 1 commit into
mainfrom
guille/dynamic-wgcna-connectivity
Sep 24, 2026
Merged

cornelislouisa merged 1 commit into
mainfrom
guille/dynamic-wgcna-connectivity

Conversation

@cornelislouisa

Copy link
Copy Markdown
Collaborator

Why

WGCNA graphs were binarized with a per-dataset adjacency_threshold copied 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 uses adjacency_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.py looks up GNN feature artifacts with the same name.

What this PR does not change

Tests

31 passed

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.

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>
@cornelislouisa
cornelislouisa merged commit b64d39e into main Sep 24, 2026
3 checks 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.

2 participants