-
Notifications
You must be signed in to change notification settings - Fork 7
VSSO unit mismatch between App and exported script (ADPP) #1151
Copy link
Copy link
Open
Labels
Next SprintThis issue will be picked on the next sprintThis issue will be picked on the next sprintbugSomething isn't workingSomething isn't working
Description
Problem
When customizing VSSO units in the app (e.g. mg/(ug/mL) → mL), the ADPP output from the app and the ADPP output from running the exported script may show different units for VSSO.
Root cause
The app and the script apply custom units pre-calculation via rows_update on the PKNCAdata units table, but they use different join keys:
- App (
inst/shiny/modules/tab_nca.R:126-137): Uses dynamicby_colscomputed fromintersect(names(data$units), names(custom_units)), excludingPPSTRESUandconversion_factor. This includes group columns (e.g.PARAM). - Script (
R/PKNCA.R,PKNCA_update_data_object): Uses hardcodedby = c("PPTESTCD", "PPORRESU"), ignoring group columns.
When the custom units table contains group columns (which it does — PKNCA_build_units_table includes them), the script's rows_update treats those group columns as columns to update rather than join keys. This can cause:
- Incorrect matching across analytes sharing the same
PPTESTCD+PPORRESU - Group column values being overwritten
Expected behavior
The script should produce the same ADPP output (including units) as the app for all parameters.
Suggested fix
Align the join logic in PKNCA_update_data_object with the app's tab_nca.R:
# In R/PKNCA.R, PKNCA_update_data_object, replace:
by = c("PPTESTCD", "PPORRESU")
# With:
by_cols <- intersect(names(data$units), names(custom_units_table))
by_cols <- setdiff(by_cols, c("PPSTRESU", "conversion_factor"))Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Next SprintThis issue will be picked on the next sprintThis issue will be picked on the next sprintbugSomething isn't workingSomething isn't working
Type
Projects
Status
No status