Skip to content

Protocol: Prevalence Filtering - #44

Merged
lwaldron merged 3 commits into
waldronlab:mainfrom
ohih8:protocol/prevalence-filtering
Oct 18, 2026
Merged

lwaldron merged 3 commits into
waldronlab:mainfrom
ohih8:protocol/prevalence-filtering

Conversation

@ohih8

@ohih8 ohih8 commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Closes #22

Adds a prevalence-filtering atomic protocol.

Testing of this protocol was done by GPT 5.6-Luna and all tests were passed (of course, testing also needs to be done with other models). The testing, while helpful, was mostly for my own diagnostic purposes to make sure the protocol worked at a baseline level and so was not written down to follow the proper testing formulation, as that is still in development, so testing is not included (especially since test cases were not based on pre-existing data so may be slightly biased to favor the protocol, again tests were not the most scientific).

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

Detection-floor ambiguity and floating-point boundary handling can produce inconsistent retained feature sets.

2 open issues
What changed in this PR

Adds an atomic microbiome prevalence-filtering protocol for use before separate transformations or downstream analyses.

Changes:

  • Defines a configurable 1% threshold, detection rules, and cohort/dataset scopes.
  • Specifies validation, filtering, and provenance reporting.
  • Explains threshold rationale and distinguishes prevalence filtering from variance filtering.
File Description
protocols/​prevalence-filtering/​protocol.md Adds the filtering procedure, parameters, citations, and scope boundaries.

Review effort: Balanced

Comment on lines +52 to +54
- `detection_rule`: a feature is detected when its abundance is greater than zero.
This is the default rule. A positive detection floor may be selected instead,
but its value and units must be recorded.
Comment on lines +125 to +130
If a threshold expressed as a fraction does not correspond to an integer number of
samples, apply the comparison to the unrounded fraction rather than silently
rounding the threshold. Equivalently, a feature passes when
`n_detected >= prevalence_threshold * n_samples`. Record the number of retained and
removed features and the smallest retained and largest removed prevalence values
when those sets are non-empty.
Correct the second author ORCID. State that a detection floor uses a
strict comparison, drop the n_detected multiplication form that can
disagree with the division in floating point, and move the testing note
out of the protocol.

Drafted with Claude Code.
@lwaldron
lwaldron merged commit 3f91632 into waldronlab:main Oct 18, 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: prevalence filtering of microbiome features

3 participants