Repository navigation
fix: validate linear methylation inputs after preprocessing - #1
Open
SproutSeeds wants to merge 1 commit into
Open
SproutSeeds wants to merge 1 commit into
SproutSeeds wants to merge 1 commit into
Conversation
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.
This supports bio-learn/biolearn#212. Validating raw input rejects a missing CpG that DunedinPACE normally supplies during preprocessing. It also misses the reverse case: preprocessing can remove a required CpG, leaving the model to return a partial score.
I restored validation after preprocessing and before scoring. The shared validator receives the processed methylation matrix and original metadata, preserving the new
required_features()API andMissingFeaturesError. The validation wrapper leaves the caller's data intact.The 11 new regression cases cover both preprocessing directions, strict missing inputs, metadata, tolerant RNA behavior, default and outer DunedinPACE imputation, prediction parity and input preservation. Four fail on the original feature branch and all pass with this repair. I also gave the existing synthetic model fixture an explicit identity preprocessor, matching normal model construction.
Verification:
0d714f5preserve the complete and recoverable DunedinPACE predictions and strict rejection behavior.git diff --checkpassed.Full
make teston Python 3.12: 231 passed, 5 skipped, 1 failed. The same geo2r JSON decoding failure intest_series_has_no_matrix_data_erroroccurs on the unchanged feature branch, where 220 tests passed and 5 skipped. A separate proposed fix for that network test is in bio-learn/biolearn#218.Cody