Ai report module for moxwgcna - #518
Open
ivokwee wants to merge 8 commits into
Open
Conversation
pgx$wgcna_mox has a different shape from pgx$wgcna: there is one WGCNA network per omics layer under $layers, the top level carries no $datExpr/$datTraits/$net/$stats/$modTraits, the top-level $gsea covers only the first layer, and $annot is keyed "<layer>:<feature>" while the layer features themselves are bare (proteomics groups brace-wrapped). ai.wgcna_mox.create_report() previously just delegated to the single-omics path, which reads all of those from the top level. New builders run every per-module primitive against the owning layer and reuse the single-omics extractors/renderers unchanged: - .moxwgcna_prepare_layers() fills stats per layer, aliases $gse<-$gsea, and re-keys the annotation to each layer's feature vocabulary (symbol lookup went from 0/2000 to 1992/2000 gx and 1329/2000 px on demo-soy1-multiomics). - .moxwgcna_select_modules() interleaves the per-layer rankings so one dominant omics layer cannot take every slot in the report. - Cross-layer eigengene pairs are reported ahead of within-layer ones, plus a per-layer scope table and per-module cross-omics coordination. - Methods collapses per-layer parameters when they agree, else renders "gx=20, px=14", with a per-layer table appended. .moxwgcna_is_grey() replaces .wgcna_is_grey() here: the latter matches anything ending in "grey" and so counted the real GXdarkgrey colour module as the unassigned bin. The modules-summary table also no longer duplicates the header that wgcna_report_data.md already ships. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BBCcsorp96dDzTvNvswmx8
resolve_functions() read a single fixed column (gene_title, else gene_name, else description). For non-model organisms gene_title is a placeholder for nearly every feature -- 7 of 2000 informative on the soybean multi-omics demo -- so every hub gene in both the WGCNA and moxWGCNA reports rendered as "hypothetical protein", while a usable description sat unused in ortholog_description. Descriptions now resolve per feature through a fallback chain (gene_title, ortholog_description, gene_name, description), skipping placeholder values and values that merely repeat the identifier -- the latter matters because gene_name mirrors symbol in several annotation sources, and in a multi-omics annotation it mirrors the layer-prefixed id while the feature itself is bare. A known human_ortholog that differs from the feature's own symbol is appended as "[ortholog: XXX]", outside the max_chars budget so it cannot be truncated away; for a non-model organism it is often the only recognizable handle in the row, and it is what the enrichment gene sets are keyed on. Human datasets are unaffected: gene_title wins the chain as before, and the ortholog tag is suppressed because the ortholog equals the symbol. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BBCcsorp96dDzTvNvswmx8
ivokwee
marked this pull request as draft
September 7, 2026 08:45
ivokwee
marked this pull request as ready for review
September 7, 2026 08:58
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.
Report module for multiomcis WGCNA. Structure of moxWGCNA is quite different than normal WGCNA, so delegation did not work. This is create by Claudio, please check carefully.
currently this error:
