Added synthesis/degradation toggle to turnover response curves#211
Conversation
* Repurposed the increasing-trend checkbox in protein_turnover template to pick H_frac (synthesis) vs L_frac (degradation) in prepare_turnover_for_dose_response() and downstream curve fit, plot, and download paths * Defaulted zero-timepoint anchor to response = 1 for degradation (pre-existing light pool intact) and 0 for synthesis (no heavy incorporated yet) * Set turnover plot y-axis label to "Turnover Ratio" * Added 6 unit tests covering column selection and zero-timepoint behavior; no testServer() dependency See ai/todos/active/TODO-MSShiny-20260519_turnover_synthesis_vs_degradation.md Co-Authored-By: Claude <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR extends protein turnover dose-response modeling to support both synthesis and degradation modes by introducing an ChangesProtein Turnover Increasing/Decreasing Mode Support
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Motivation & Context
The protein turnover analysis module previously only supported analyzing synthesis (the incorporation of heavy isotopes measured by H_frac). This PR extends the functionality to also support degradation analysis (the loss of light isotopes measured by L_frac) by repurposing the existing "increasing-trend" checkbox as a synthesis/degradation toggle. This allows the dose-response curve fitting, visualization, and analysis workflows to handle both turnover mechanisms with appropriate response anchors at time zero.
Changes
Core Function Changes
prepare_turnover_for_dose_response()inR/statmodel-server-comparisons.R:increasing(defaultTRUE) to the function signatureH_fracwhenincreasing=TRUE(synthesis) andL_fracwhenincreasing=FALSE(degradation)H_fracresponse = 0for synthesis cases andresponse = 1for degradation cases (previously always set to 0)Server Logic Updates
R/module-statmodel-server.R:increasingflag from the "increasing-trend" checkbox inputincreasingflag consistently to bothprepare_turnover_for_dose_response()anddoseResponseFit()callsR/statmodel-server-visualization.R:increasingboolean and pass it to bothprepare_turnover_for_dose_response()andvisualizeResponseProtein()User Interface Updates
R/statmodel-server-options-modeling.R:H_fracfor synthesis,L_fracfor degradation)Unit Tests
Added six new unit tests in
tests/testthat/test-module-turnover.Rcovering:increasingargument (H_fracwhenTRUE,L_fracwhenFALSE)H_fracwhenincreasingparameter is not specified)response = 0for synthesis,response = 1for degradation)NAvalues in the selected fraction column)All tests are designed as unit tests that do not depend on
testServer()for simpler, more focused testing.