feat: persist multi-omics WGCNA at upload via pgx$wgcna_mox slot#477
Merged
Conversation
- move wgcna.get_modTraits, wgcna.getTopGenesAndSets (+ multi/consensus variants), wgcna.describeModules from pgx-wgcna.R to a dedicated pgx-wgcna-report.R module; new wgcna.getTopModules absorbs the prior wrapper and adds a min_modules floor (default 5L) so downstream consumers always get a renderable selection - add wgcna.ensureStats() to lazily populate wgcna\$net\$labels and wgcna\$stats for older PGX files that ship without them; idempotent guard prevents wgcna.getGeneStats errors on example-data and similar - harden probe2symbol with a NULL-guard on annot_table so callers can drop their local resolve_symbols defensive wrappers; behaviour unchanged when annot_table is provided
- new pgx-drugs-report.R exports drugs.analysisInfo, drugs.enrichmentTable, drugs.moaEnrichment, drugs.supportBucket; promoted from omicsplayground board.drugconnectivity so on-the-fly fgsea MOA enrichment and L1000-vs-sensitivity NES direction semantics are reusable across boards and pipelines - lift %||% to utils.R as a backward-compat null-coalesce helper (Depends R >= 3.5 — base R 4.4 operator not yet available)
- some L1000 / CMap drug MOA and target strings carry mixed-encoding bytes (eg the 0xD0 byte in 'serotonin<d0>norepinephrine reuptake inhibitor'); enc2utf8 alone does not strip these, so strsplit's regex engine fails with 'input string is invalid' and 'unable to translate to a wide string' warnings - replace enc2utf8 with iconv(from='UTF-8', to='UTF-8', sub='') which re-parses the input as UTF-8 and silently drops invalid byte sequences; downstream tokenisation only needs the ASCII separators (pipe / semicolon / comma) so dropping the offending bytes does not lose any information that the splitter would have used
- add .semquery (semquery index store), .active_plans (in-progress plan files) and .agents_context (cross-agent scratch notes) to .Rbuildignore so devtools::install / R CMD build no longer complain about non-portable hidden directories inside the package root
- add wgcna_mox branch to compute_extra() gated on
pgx$datatype %in% c('multi-omics','multiomics'); calls
wgcna.compute_multiomics() with the multiwgcna board's parameter
set (deepsplit=2, power=NULL, ngenes=2000, minmodsize=10,
minKME=0.3, compute.enrichment=TRUE) and writes the result to
pgx$wgcna_mox alongside the existing single-omics pgx$wgcna so
both representations coexist (deprecation deferred)
- until now the multi-omics WGCNA only existed as a Shiny reactive
in the webapp's multiwgcna board and was never persisted, so any
downstream consumer (AI reports, copilot context, re-analysis)
saw a NULL wgcna_mox slot on multi-omics PGX files
- new block uses info() rather than message() for non-error
progress lines (matches the convention emerging across compute
pipeline); error reporting keeps the message() + ERROR_WGCNA_MOX
marker-file pattern shared by the other compute_extra branches
ESCRI11
approved these changes
May 28, 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.
Before: multi-omics WGCNA lived only in webapp reactive
r_multiwgcna. Never written topgx. Downstream sawNULLslot. AI reports, Copilot context, and re-analysis are all blind to it.Now, if
wgcna %in% compute_extra, andpgx$datatype %in% c("multi-omics","multiomics")then callwgcna.compute_multiomics()atpgx.Compute().