Skip to content

Protocol/CBEA - #47

Merged
lwaldron merged 9 commits into
waldronlab:mainfrom
ohih8:protocol/cbea-bugsigdb-enrichment-pr
Oct 17, 2026
Merged

lwaldron merged 9 commits into
waldronlab:mainfrom
ohih8:protocol/cbea-bugsigdb-enrichment-pr

Conversation

@ohih8

@ohih8 ohih8 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Closes #18

Added a protocol for CBEA. As usual with the protocols, I did some internal testing but more formal testing is needed to ensure the accuracy and efficacy of the protocol.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Taxonomic aggregation and null-inference instructions leave choices that can change enrichment results.

2 open findings
What changed in this PR

Adds an atomic CBEA protocol for testing BugSigDB microbial signatures against compositional abundance data, addressing issue #18.

Changes:

  • Defines input requirements, taxonomy harmonization, background universe, and set-size bounds.
  • Describes balance scoring, significance testing, multiple-testing adjustment, and reporting.
  • Documents pooled versus per-dataset execution and interpretation limits.
File Description
protocols/​cbea-bugsigdb-enrichment/​protocol.md Adds the CBEA enrichment workflow, citations, parameters, and reporting requirements.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread protocols/cbea-bugsigdb-enrichment/protocol.md Outdated
Comment thread protocols/cbea-bugsigdb-enrichment/protocol.md Outdated
@lwaldron

Copy link
Copy Markdown
Member

I know the issue said to do this for BugSigDB signatures, but I'm now thinking this should be an enrichment protocol for any microbial signatures, with BugSigDB as an example.

@lwaldron lwaldron 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.

I know the issue said to do this for BugSigDB signatures, but I'm now thinking this should be an enrichment protocol for any microbial signatures, with BugSigDB as an example. But the protocol looks good!

Rename to cbea-signature-enrichment with BugSigDB as the worked example.
Address Copilot review: define aggregation by summing relative abundances
with warnings for excluded rows, and specify the pooled cross-sample null,
correlation adjustment, and upper-tail p-values by naming the CBEA functions.

Drafted with Claude Code.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The example does not reliably apply the recorded seed, and the stated null conflicts with the sampling procedure.

2 open issues
2 resolved since last review

Review effort: Balanced

Comment thread protocols/cbea-signature-enrichment/protocol.md Outdated
Comment thread protocols/cbea-signature-enrichment/protocol.md Outdated
The exported cbea() methods do not forward parallel_backend, so seed with
set.seed() instead. State the null as random subsets drawn from the whole
universe, matching fit_scores().

Drafted with Claude Code.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The statistical inference needs domain-expert validation, and the executable examples require corrections.

No open issues 🎉

2 previously missed issues

In code that hasn't changed since last review

Medium severity Pass the imported BugSigDB result to getSignatures()

protocols/​cbea-signature-enrichment/​protocol.md:73

getSignatures() needs the imported BugSigDB data; it does not retrieve the preceding import result automatically. This example therefore fails with a missing-argument error. Bind the import result and pass it to getSignatures(), as the cited Figure3.Rmd does.

Medium severity Use the selected distribution instead of hardcoded norm

protocols/​cbea-signature-enrichment/​protocol.md:244

The parameters permit selecting mnorm, but this call always uses norm. Following the snippet after selecting the mixture model produces normal-model p-values that disagree with the recorded distribution. Pass the selected distribution to keep the call consistent with Steps 4.3–4.5.

2 resolved since last review

Review effort: Balanced

Pass the imported object to getSignatures() and use the selected
distribution in the cbea() call.

Drafted with Claude Code.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The mixture-model adjustment can miscalibrate significance calls, and pooled taxon alignment remains undefined.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Pooled mode lacks a policy for aligning taxa across datasets

protocols/​cbea-signature-enrichment/​protocol.md:115

Pooled mode does not define how to align taxa before combining datasets. Positive tables with taxa {A, B, C} and {B, C, D} need a merge policy: a union introduces missing values or zeros forbidden by Step 1, while an intersection changes the universe and subsequent balances. Require identical, pre-aligned taxon identifiers, or explicitly define the merge and upstream preprocessing policy. Revalidate the combined table before proceeding so pooling cannot bypass the finite, strictly positive input requirement.

Review effort: Balanced

Comment on lines +89 to +92
- `distribution`: `norm`, a normal distribution fitted to the null scores.
`mnorm`, the two-component normal mixture from the same paper, is the only
permitted alternative and must be recorded if chosen.
- `correlation_adjustment`: enabled (`adj = TRUE` in `CBEA::cbea()`).
Drafted with Claude Code.
The mnorm correlation adjustment in CBEA 0.99.4 computes the mixture
standard deviation without squaring component terms, so only norm is
permitted. Pooled mode now merges datasets on the union of taxa with
zero replacement applied to the combined table.

Drafted with Claude Code.
@lwaldron

Copy link
Copy Markdown
Member

OK looking good after some avoidance of upstream issues! Thanks @ohih8 , merging.

@lwaldron
lwaldron merged commit fc373d1 into waldronlab:main Oct 17, 2026
1 check passed
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.

Protocol: CBEA: competitive balances for taxonomic enrichment analysis against BugSigDB signatures

3 participants