Repository navigation
Pin dose_response hitcall against tcplfit2 - #189
Merged
Merged
Conversation
tl.dose_response's continuous hitcall ports tcplfit2's hitcontinner and toplikelihood, but the existing tests pin only orderings and ranges, which would not catch a wrong constant. Add one module that asserts the call against the values tcplfit2 0.1.9 reports for fixed inputs: a decisive curve, a scattered curve whose top sits near the cutoff so the call lands mid-range, and a flat response. Reference values are stored inline, so no dependency on R or tcplfit2 is added. Closes #90.
Address a cluster review: the earlier pin rested on one non-clamped point (clear=1.0 and miss=0.0 sit at the clip bounds). Add a second independent strong curve (strong_high=0.80) so two mid-range calls, from different curves, exercise the ported P2/P3 arithmetic. Record the tcplfit2 concRespCore recipe in the docstring so the values can be re-derived, note that a call below ~0.6 is not asserted because the four- and three-parameter fits part there, drop the redundant min_doses (4 is the default), and plain up two anthropomorphic lines.
- Tutorial: say in the hitcall paragraph that P1 is weighed over mantispy's two models, not tcplfit2's ten, so it is not tcplfit2's number, and that hitcall is NaN without marked controls or an explicit cutoff. - Tutorial: note the U2OS calls rest on one or two wells per group before reading the off-diagonal call as biology. - Docstring: state that hitcall assumes a non-negative distance-like response and the signed path is not exercised by the default.
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #189 +/- ##
=======================================
Coverage 87.33% 87.33%
=======================================
Files 88 88
Lines 8331 8331
=======================================
Hits 7276 7276
Misses 1055 1055
🚀 New features to boost your workflow:
|
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.
tl.dose_response's continuoushitcallports tcplfit2'shitcontinner/toplikelihood, buttests/test_tl_dose.pypins only orderings and ranges, so a wrong constant in the error model, Akaike weight or profile term would pass.Adds
tests/test_equivalence_tcplfit2.py: one parametrized test assertinghitcallagainst the values tcplfit2 0.1.9 reports for fixed, baseline-corrected inputs — a decisive curve (1.0), a scattered curve whose top sits near the cutoff so the call lands mid-range (0.711), and a flat response (0.0). Reference values are stored inline, so no runtime or test dependency on R or tcplfit2 is added.P1 (the Akaike weight against the constant model) is taken over mantispy's two models rather than tcplfit2's ten, so the scenarios are chosen where P1 saturates and the assertion rests on the ported P2/P3 arithmetic.
atol=0.02absorbs the four-parameter logistic fitting a slightly different top than tcplfit2's three-parameter Hill (mid-range case matches to 2.6e-3) while staying inside the shift a wrong constant causes (a chi-square-factor error moves it 0.066).Verified:
hatch test tests/test_tl_dose.py tests/test_equivalence_tcplfit2.py— 16 passed.Closes #90.
Also folds in four dose-response doc fixes a persona review surfaced (no behaviour change): the tutorial now states that P1 is weighed over mantispy's two models, not tcplfit2's ten, so it is not tcplfit2's number, and that
hitcallisNaNwithout marked controls or acutoff; it flags that the U2OS cross-line calls rest on one or two wells per group before reading the off-diagonal as biology; and thedose_responsedocstring states thathitcallassumes a non-negative distance-like response.