Skip to content

Fix empty wgcna$gsea for custom-organism and lipidomics datasets - #478

Merged
ESCRI11 merged 1 commit into
edgyfrom
fix-wgcna-custom-genesets
Sep 2, 2026
Merged

ESCRI11 merged 1 commit into
edgyfrom
fix-wgcna-custom-genesets

Conversation

@ESCRI11

@ESCRI11 ESCRI11 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

source of problem

WGCNA module enrichment (wgcna$gsea) was empty for opg-exampledata: fission-custom and lipidomics

after gset.filter = "PATHWAY|HALLMARK|^GO|^C[1-9]" we get 0 gsets so an empty gsea field

fix

as we do on pgx.compute after filtering gsets i bring back test/custom/metabolite

test/custom im quite sure it's good to actually include. metabolite not so sure as it brings some metabolite_ontology/chemclass that might pollute the enrichment analysis for metabolite datasets that have metabolite_patwhays matches

maybe i can include all metabolomics ones if there are no matches?

before

image image

after

image image

@ESCRI11
ESCRI11 requested review from ivokwee and zitoa June 2, 2026 08:51
@zitoa

zitoa commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Fine by me. Q: why are you not dropping fallback TEST sets from the list?

@ESCRI11

ESCRI11 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

@zitoa sorry i now realize screenshots are a little bit wrong. fallback TEST are then only gsets for some datasets, in fact on the pictured fission-custom is one of those cases - those TEST are only auto generated for those datasets where they have 0 gsets, so keeping them is a way of not showing error plots

@ivokwee ivokwee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed: the 7-line filter exemption is correct and minimal. Keeping CUSTOM/TEST/METABOLITE sets through the reference-name filter fixes the empty wgcna$gsea for custom-organism and lipidomics datasets, and mirrors the CUSTOM exemption in pgx.compute() — consistent with the fallback-TEST rationale in the thread above. CI green, no conflicts.

@ivokwee
ivokwee changed the base branch from devel to edgy September 2, 2026 09:41
@ivokwee

ivokwee commented Sep 2, 2026

Copy link
Copy Markdown
Member

@ESCRI11 Approved. One blocker before this can merge: the branch is currently conflicting against `edgy`, so it needs a rebase first.

Also worth settling your open question from the description (always-keep METABOLITE sets vs. only-when-there-are-no-pathway-matches) on that rebase — happy to re-review whichever way you land it.

…filter

wgcna$gsea was empty for custom-organism (fission-custom) and lipidomics
datasets: after gset.filter = "PATHWAY|HALLMARK|^GO|^C[1-9]" no genesets
were left.

Exempt CUSTOM/TEST sets unconditionally (for custom organisms they are the
only applicable sets, mirroring the CUSTOM exemption in pgx.compute), and
METABOLITE sets only as a fallback when nothing matches the filter.
METABOLITE_PATHWAY already matches "PATHWAY", so an unconditional exemption
would only add METABOLITE_ONTOLOGY/CHEMCLASS and drown real pathway hits --
this settles the open question from the PR description.

The enrichment body now lives in WGCNAplus, which greps the same colnames
after row-subsetting, so the augmented filter is applied there.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KNgu8HbV8R9GCU78PKPM4
@ESCRI11
ESCRI11 force-pushed the fix-wgcna-custom-genesets branch from 2507246 to 79abf45 Compare September 2, 2026 10:05
@ESCRI11
ESCRI11 merged commit a9713e1 into edgy Sep 2, 2026
1 of 3 checks passed
@ESCRI11
ESCRI11 deleted the fix-wgcna-custom-genesets branch September 2, 2026 12:25
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.

3 participants