Skip to content

Ai report module for moxwgcna - #518

Open
ivokwee wants to merge 8 commits into
develfrom
ai-report-moxwgcna
Open

Ai report module for moxwgcna#518
ivokwee wants to merge 8 commits into
develfrom
ai-report-moxwgcna

Conversation

@ivokwee

@ivokwee ivokwee commented Sep 7, 2026

Copy link
Copy Markdown
Member

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:
image

ivokwee and others added 6 commits September 5, 2026 07:53
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
ivokwee requested a review from phisanti September 7, 2026 08:45
@ivokwee
ivokwee marked this pull request as draft September 7, 2026 08:45
@ivokwee
ivokwee marked this pull request as ready for review September 7, 2026 08:58
@ivokwee
ivokwee changed the base branch from edgy to devel September 9, 2026 13:45
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.

1 participant