Skip to content

Wgcna updates needed for OPG PR1715#420

Merged
ivokwee merged 84 commits intodevelfrom
wgcna-upd3
Apr 1, 2026
Merged

Wgcna updates needed for OPG PR1715#420
ivokwee merged 84 commits intodevelfrom
wgcna-upd3

Conversation

@ivokwee
Copy link
Copy Markdown
Member

@ivokwee ivokwee commented Jan 16, 2026

Updates needed for OPG PR bigomics/omicsplayground#1715 (Improvements multiwgcna)

Note: this was previously wgcna-upd2 but something got corrupted in merging. This is a new branch tag.

@ESCRI11
Copy link
Copy Markdown
Contributor

ESCRI11 commented Jan 16, 2026

how come first PR of multiWGCNA we reverted was about 1.2k lines added and now 117?

@ivokwee
Copy link
Copy Markdown
Member Author

ivokwee commented Jan 16, 2026

how come first PR of multiWGCNA we reverted was about 1.2k lines added and now 117?

I am trying to revert to timepoint. Something got lost in wgcna-upd2, perhaps at reverting or at merging.

@ESCRI11
Copy link
Copy Markdown
Contributor

ESCRI11 commented Jan 16, 2026

ok got it, let us know when its ready to be tested again

@ivokwee
Copy link
Copy Markdown
Member Author

ivokwee commented Jan 16, 2026

wait... in wgcna-upd2 17 files changed (many man though). Now I have only 2 files, so I need to check and bring the changes into upd3 correctly.

@ivokwee
Copy link
Copy Markdown
Member Author

ivokwee commented Jan 16, 2026

OK I updated upd3 with needed changes from up2. I left out some unrelated changes and will PR seperately from: ai-llm.R (adding tidyprompt), and pgx-plotting.R (some layout changes).

phisanti and others added 29 commits February 19, 2026 11:12
- add guard after lasagna.prune_graph that detects 0-vertex result
  and renders an informative blank plot instead of crashing with
  "need finite 'xlim' values"
- message includes context-aware hints based on the active filters
  (edge threshold, prune, edge.sign) so the user knows what to adjust
- triggered when SP weighting + consensus + high edge threshold
  collectively zero out all edge weights, leaving no nodes to plot
  - cor() returns NaN for constant trait columns, which occurs when
    splitting by Condition (each group has only one condition value,
    giving zero variance for that trait)
  - NaN propagated into the second cor(kme) call used for hclust,
    crashing with 'NaN dissimilarity value'
  - fix 1: strip all-NaN columns from kme after the first cor(X,Y)
  - fix 2: guard the hclust cor() with !is.finite() to catch any
    remaining NaN/Inf regardless of origin
  - affected plot: consensus WGCNA Dendrograms with Condition split
- lapply over stats[p2] used x[, trait] which crashes when foldChange
  lacks the selected trait column — happens when splitting by Condition
  because constant-within-group traits are excluded from foldChange
  but still present in traitSignificance
- replace bare column indexing with safe_col() helper that pads
  missing columns with NA instead of erroring out
- fixes subscript out of bounds in consensus WGCNA Features Table
  when grouping by Condition
- wgcna.runPreservationWGCNA was calling wgcna.runConsensusWGCNA without
  summary=FALSE, triggering the AI annotation block added in 6b919d5
  which references DEFAULT_LLM before it is defined, crashing with
  'object DEFAULT_LLM not found'
- preservation WGCNA does not need AI module summaries, so passing
  summary=FALSE and ai_model=NULL is correct
- safe_col returned a matrix when length(tr)==1, causing do.call(cbind)
  to name all columns after the trait instead of the p2 stat names
  (traitSignificance, TSPvalue, foldChange, foldChangePvalue); fix by
  returning a named vector so list element names are used as col names
- wgcna.getConsensusGeneStats now returns NULL early if any layer's
  wgcna.getGeneStats returns NULL (trait absent from that layer's stats)
@ivokwee ivokwee merged commit 6b44e99 into devel Apr 1, 2026
1 check failed
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.

4 participants