Repository navigation
Protocol: Prevalence Filtering - #44
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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).