Repository navigation
Return exact neutral roots during isoelectric bisection - #224
Merged
Merged
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 returns about
7.8525before the change, rather than6.015. Only the terminal groups ionize for this peptide, so the neutral point is the mean of their pKa values.An exactly zero charge at the midpoint falls into the branch that moves the left endpoint, which loses the root. Return an endpoint or midpoint immediately when its calculated charge is zero. The existing iteration remains the same for nonzero charges. Regression tests cover both endpoints, all three sequence representations, custom pKa values and a terminal override.
Independent analytic and Henderson-Hasselbalch/Brent references on peptides from four UniProt albumin/hemoglobin sequences agree with all 1,710 evaluations after the change, versus 990 before. All 990 previously correct records remain identical. These checks use default and custom pKa values, three pH brackets and all three input representations; the supplied example also fails with the default precision.
Validation uses Python 3.10/NumPy 1.26 and Python 3.12/NumPy 2.5, the project's per-file test commands, and an isolated wheel replay. The separate semi-specific digestion correction composes cleanly and preserves these results.
Each profile completes all 27 CI test files (491 tests, including one live-PostgreSQL service skip). On Python 3.10, ProForma and Unimod exceeded an initial 180-second bound and passed unchanged on targeted retries with a 600-second bound; both attempts are retained.