waldronlab / waldronlab/agent-protocols

Protocol: random forest classification of microbiome profiles

Open
#31 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

atomic-protocol machine-learning microbiome
Dominant language
No language data
Stars
0
Forks
1
Avg merge
1h 2m
Merged PRs (30d)
9

Description

Tier: D (cMD paper) · Type: atomic · Category: Machine Learning

What

Train and apply a random forest classifier to microbial abundance profiles, with the hyperparameters and feature-handling choices that the microbiome literature has settled on — stated as defaults with their provenance, not left to library defaults.

Why it matters

Split from the LODO protocol, per review. Random forests get used with ordinary cross-validation all the time; tying them to one validation scheme would have made both halves less useful. This protocol says how to fit the model; a validation protocol says how to evaluate it.

The value here is specificity to the domain. A generic "use a random forest" instruction helps nobody — the useful content is the parameter set that microbiome studies actually use, the fact that different published analyses use different ones, and what the differences do.

Defaults: follow Pasolli 2016

Two published parameterizations exist and they disagree. Adopt Pasolli's as the protocol's defaults.

Pasolli et al. 2016 — the default Manghi et al. 2025 (cMD) — variant
Trees 500 10,000
Features per split √(total features) 1% of features
Impurity criterion Gini Entropy

Record the cMD variant in ## Notes as a published alternative with its source, so anyone reproducing
that paper knows what to change — but the protocol's stated defaults are Pasolli's, matching the
parameterization the citation/publication_doi pair points at.

Pasolli also specifies an embedded feature-selection strategy: rank features by importance, retrain on
progressively larger subsets of {5, 10, 20, … 200}, and keep the subset size that maximizes accuracy.
Include it as a defined optional step with its own rationale, not folded silently into the fit.

Source material

  • Pasolli, Truong, Malik, Waldron & Segata (2016), PLoS Comput Biol, 10.1371/journal.pcbi.1004977 — the microbiome parameterization and the feature-selection strategy
  • waldronlab/curatedMetagenomicDataAnalysescMD3_paper_analyses/ML/ml_tests_on_diseases_rf.py, figure4_complete_ml.py; the external metaml tool
  • Applied in: 10.1038/s41467-025-66888-1

Scope

In: the hyperparameters as stated defaults with their source; which features enter the model and on what scale (and therefore whether a transformation protocol is required or optional); class imbalance handling; the embedded feature-selection procedure, as an optional step with its own rationale; what the model outputs and what feature importances may and may not be read as.

Out: the validation scheme — LODO or otherwise; performance metrics.

Frontmatter starting point

type: "atomic"
category: "Machine Learning"
citation: "10.1023/A:1010933404324"        # Breiman 2001 — random forests. VERIFY
publication_doi: "10.1371/journal.pcbi.1004977"   # Pasolli 2016 — source of the microbiome parameterization
protocols_used:
  - name: "prevalence-filtering"
  - name: "clr-transformation"      # optional: see note
tags: [machine-learning, random-forest, classification, microbiome]

Breiman proposed random forests; Pasolli proposed this parameterization for microbiome data. The
one-citation rule puts Breiman in citation and Pasolli in publication_doi — this split is confirmed
as the intended reading. The same pattern — a general method with a domain-specific published
parameterization — will recur, so it is worth writing up in ## Notes as a precedent.

Acceptance criteria

  • Every hyperparameter is a stated default with a named source
  • Pasolli's parameterization is the stated default; the cMD variant is recorded in ## Notes with its source
  • The embedded feature-selection strategy is a defined optional step, not implicit
  • Contains no validation scheme — it composes with lodo-cross-validation, it does not assume it
  • States plainly what random forest feature importance does not establish

Cite the method's origin, not its users

PROTOCOL_STANDARD.md is explicit: an atomic protocol carries "strictly 1 citation... corresponding
to the primary literature where the method was originally published."
Find the paper that proposed
the method. Do not cite a paper that merely applied it — including the BugSigDB and curatedMetagenomicData
papers, which are the source of the analysis these protocols were extracted from but almost never the
source of the method.

Tracing a method back to its first publication is real work, and it is part of the task, not a
formality. Three things to expect:

  • Candidate DOIs in this issue are leads, not answers. Anything marked VERIFY has not been checked.
  • Some methods predate modern citation practice or have no single identifiable origin. If that is
    genuinely the case, say so in the pull request rather than reaching for a convenient recent paper.
    Raise it as an issue in waldronlab/agent-protocol-standard — the standard may need a way to express
    "classical method, no primary source".
  • If you cannot name one paper that proposed everything the protocol does, it is more than one
    protocol.
    That test has now split four protocols out of this batch: enrichment into three methods,
    filtering from transformation, LODO from random forest, and PERMANOVA from ANOSIM.

Where the lab's own paper genuinely did propose the method — the oral-to-gut score, and LODO
cross-validation in Pasolli et al. 2016 — citing it is correct. That is the exception, not the pattern.

Before you start

Read CONTRIBUTING.md and
PROTOCOL_STANDARD.md.
The format is defined in the standard repo, not this one. Protocols are prose, not code: they say what to do
and why, precisely enough that two people — or two agents, in two languages — get the same answer. The existing
independent-filtering-variance
protocol is the model to imitate for tone and level of detail.

Validate locally before opening the PR:

git clone https://github.com/waldronlab/agent-protocol-standard.git
Rscript agent-protocol-standard/scripts/validate-protocol.R protocols

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read CONTRIBUTING.md and PROTOCOL_STANDARD.md first, then inspect the independent-filtering-variance protocol for style. Review cMD3_paper_analyses/ML/ml_tests_on_diseases_rf.py and figure4_complete_ml.py alongside the cited Pasolli source, and run the documented R validation command. Done means the protocol meets every acceptance criterion and passes local validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
machine-learning, python, r
Domain
documentation, machine-learning
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.