waldronlab / waldronlab/agent-protocols

Protocol: prevalence filtering of microbiome features

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

Nobody has claimed this yet.

atomic-protocol good-first-protocol microbiome statistics
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: Data Transformation

What

Remove features detected in fewer than a specified fraction of samples, before any transformation or modelling.

Why it matters

Why this is separate from CLR. The original draft bundled prevalence filtering with the centred log-ratio transformation. Splitting them was requested in review, and it is right for two reasons: they have different primary sources, which the one-citation rule makes decisive, and — more practically — the downstream analyses should be runnable with or without CLR. Filtering is nearly always wanted; the transformation is a choice. Bundling them would have forced both or neither.

Note also that filtering and transformation are order-dependent: filtering changes which features enter CLR's geometric-mean denominator, so the composition order is itself a decision the composite protocols must record.

Worth cross-referencing the repository's existing
independent-filtering-variance
protocol, which filters on a different criterion and answers a different question. A short note in each pointing at the other would help readers pick.

Source material

  • waldronlab/curatedMetagenomicDataAnalysespython_tools/aggregate_taxa_profile.py, R/filter_sort.R
  • Applied in: Manghi et al., Nat Commun 2025, 10.1038/s41467-025-66888-1 — features present in < 1% of samples excluded; the 305-species oral set defined by ≥ 1% prevalence in oral samples

Scope

In: the prevalence threshold as a stated default with justification; the sample set prevalence is computed over, and whether that is before or after cohort subsetting — this materially changes the result and must be pinned; what counts as "detected" (nonzero, or above a detection floor); whether filtering is applied per dataset or across the pooled cohort in a multi-study design; the record of how many features were removed.

Out: any transformation; variance-based filtering (see the existing protocol).

Frontmatter starting point

type: "atomic"
category: "Data Transformation"
citation: "10.12688/f1000research.8986.1"   # Callahan et al. 2016, F1000Research
tags: [prevalence-filter, filtering, microbiome, preprocessing]

Citation settled. The Bioconductor workflow for microbiome data analysis (Callahan, Sankaran, Fukuyama, McMurdie & Holmes, F1000Research 2016) is the reasonable primary source for prevalence filtering as applied to microbiome data: it defines prevalence as the number of samples in which a taxon appears at least once, sets an explicit threshold, and gives the rationale — avoiding effort spent on rarely-seen taxa, and removing spurious taxa generated as artifacts of OTU clustering.

Note that it uses 5% where the cMD paper uses 1%. Both are defensible; the protocol should present the threshold as a parameter, cite Callahan for the method, and record which threshold a given analysis chose and why. The rationale Callahan gives is also worth carrying across: the argument for filtering is strongest for heuristically clustered OTU data and weaker for the sequence-resolved profiles cMD uses, which is itself a reason to make the threshold a considered choice rather than a default.

Acceptance criteria

  • The 1% default is stated with justification, and is a parameter
  • Specifies whether prevalence is computed before or after cohort subsetting
  • Specifies per-dataset vs. pooled application for multi-study designs
  • Cites Callahan et al. 2016, and notes the 5% vs 1% divergence rather than presenting one as canonical

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, PROTOCOL_STANDARD.md, and protocols/independent-filtering-variance/protocol.md for format and tone. Use the cited Callahan et al. 2016 source and the issue's acceptance criteria to document the parameter, prevalence scope, detection rule, dataset pooling, and removal count, then run the provided Rscript validation command; done means all four criteria pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
bioinformatics, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.