Interval Parameters as options for to compute Ratio Parameter Calculations#1224
Open
Interval Parameters as options for to compute Ratio Parameter Calculations#1224
Conversation
Wire int_parameters from NCA settings into ratios_table_server so the ratio module can read the current interval/partial parameter definitions. Closes #1135 Co-authored-by: Ona <no-reply@ona.com>
Add .build_interval_param_options() to construct range-suffixed entries (e.g. AUCINT_0-20) from the int_parameters table. Merge them into ratio_param_options() so they appear in the Test/Ref Parameter dropdowns. Refs #1135
Add parse_interval_parameter() to detect range-suffixed parameters (e.g. AUCINT_0-20) and extract the base PPTESTCD + start/end values. Add .filter_interval_results() to pre-filter the result data to only the specific interval rows before computing ratios. calculate_ratio_app() now parses both test and ref parameters, filters the result data when intervals are involved, and passes the base PPTESTCD to calculate_ratios(). Non-interval parameters are unaffected — parse_interval_parameter() returns is_interval=FALSE and no filtering occurs. Refs #1135
Cover parse_interval_parameter() parsing logic (range suffix, decimals, regular params, multi-part base names) and calculate_ratio_app() end-to-end with interval parameters as test/ref, verifying correct interval filtering and backward compatibility with non-interval params. Refs #1135
.filter_interval_results() now uses start_dose/end_dose (dose-relative times) instead of absolute start/end when available. int_parameters defines intervals relative to dose time, so the filter must match against dose-relative columns to correctly identify intervals across multiple doses. Falls back to absolute start/end when dose-relative columns are absent (e.g. in unit tests with simplified data). Refs #1135
js3110
approved these changes
Apr 14, 2026
When either test or ref is an interval parameter, start/end cannot be used as join keys because different interval parameters have different ranges (e.g. AUCINT_0-20 vs CAVGINT_0-30). The correct rows are already selected by .filter_interval_results(), so start/end are redundant as match columns. Also adds the interval parameter tests that were missing from the previous commit (only a blank line was inserted). Refs #1135 Co-authored-by: Ona <no-reply@ona.com>
Collaborator
Author
|
While reviewing myself I realized that doing a ratio of two interval parameters (e.g, Now it should be fixed |
…PPTESTCD When test and ref are different intervals of the same parameter (e.g. AUCINT_0-2 vs AUCINT_2-4), the sequential filtering was removing the ref's rows during the test filter pass. Now builds a single removal mask that preserves rows matching either requested range. Refs #1135 Co-authored-by: Ona <no-reply@ona.com>
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.
Issue
Closes #1135
Description
Interval/partial parameters (e.g.
AUCINT_0-20,AUMCINT_0-30) can now be selected as Test or Reference parameters in the Ratio Calculations table.Key changes:
Wiring:
int_parametersreactive from NCA settings is passed intoratios_table_serverso the ratio module can read the current interval definitions.UI dropdown:
.build_interval_param_options()constructs range-suffixed entries from theint_parameterstable (e.g.AUCINT_0-20), filtering out incomplete rows. These are merged intoratio_param_options()alongside the existing main-interval parameters.Ratio computation:
parse_interval_parameter()detects range-suffixed parameters and extracts the base PPTESTCD + start/end values..filter_interval_results()pre-filtersres$resultto only the matching interval rows beforecalculate_ratios()runs. Usesstart_dose/end_dose(dose-relative times) sinceint_parametersdefines intervals relative to dose time. Non-interval parameters are unaffected.Definition of Done
int_parameters()appear in the ratio Test/Ref Parameter dropdowns with range suffix (e.g.AUCINT_0-20)int_parameters()changescalculate_ratio_app()correctly parses range-suffixed parameters and filters bystart/endHow to test
AUCINT_0-20.Contributor checklist
.scsschange was done, rundata-raw/compile_css.RNotes to reviewer
devtools::document(),lintr::lint_package(), anddevtools::test()could not be run locally. CI will validate these.PARAM_start-end) follows the same convention already used indescriptive_statistics.R,nca_results.R, andparameter_plots.R.parse_interval_parameter()supports decimal start/end values (e.g.AUCINT_0.5-12.5).