-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: AUC start 0 (which also needs Feature: C0 imputation) #138
Conversation
…rt for non-c0 parameters
…d renamed (select_X)
…adjust reshape for it
Merge remote-tracking branch 'origin/main' into bug/auc-start-0 # Conflicts: # inst/shiny/tabs/nca.R # inst/shiny/tabs/outputs.R
Merge branch 'bug/auc-start-0' of https://github.com/pharmaverse/aNCA into bug/auc-start-0 # Conflicts: # R/create_start_impute.R
…to slice data. route_column (unneeded argument) was removed
…into bug/auc-start-0
Thanks for your reviews and feedback, I hope that now all looks fine! @js3110 @m-kolomanski |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, looks much better, thank you for all the hard work! I still do have some feedback, most of it regards style and consistency rather thank quality of the code, but also there seems like some of my comments from the previous review were not addressed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: For all the test files, please utilize describe
and it
when writing tests, you can check test-general_lineplot.R, test-utils-slope_selector.R or test-utils.R for good examples. Also this blogpost might be useful to better explain the idea behind it.
R/create_start_impute.R
Outdated
mutate( | ||
impute = case_when( | ||
!!sym(time_column) == start & !is.na(!!sym(conc_column)) ~ NA, | ||
DOSNO == 1 & | ||
(tolower(!!sym(route_column)) == "extravascular" | | ||
!!sym(duration_column) > 0 | | ||
!!sym(analyte_column) != !!sym(drug_column)) ~ "start_conc0", | ||
DOSNO > 1 & | ||
(tolower(!!sym(route_column)) == "extravascular" | | ||
!!sym(duration_column) > 0 | | ||
!!sym(analyte_column) != !!sym(drug_column)) ~ "start_predose", | ||
tolower(!!sym(route_column)) == "intravascular" & | ||
!!sym(duration_column) == 0 & | ||
!!sym(analyte_column) == !!sym(drug_column) & | ||
is.possible.c0.logslope ~ "start_logslope", | ||
tolower(!!sym(route_column)) == "intravascular" & | ||
!!sym(duration_column) == 0 & | ||
!!sym(analyte_column) == !!sym(drug_column) ~ "start_c1" | ||
) | ||
) %>% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: this comment seems to not have been resolved at all? It is still quite hard to decipher what exactly we are checking here.
@Gero1999 it looks good and thank you for all the hard work on this! Unfortunately I have noticed a couple of things:
Let me know if you have any questions or want any support :) |
Co-authored-by: Mateusz Kołomański <[email protected]>
Co-authored-by: Mateusz Kołomański <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my side, looks good! Thank you for all the hard work, this is a lengthy change, sure it was not easy!
I am approving, but before merge, please remove the inst/WORDLIST.txt
file, as it is redundant - the spelllcheck only uses WORDLIST
file.
all_concs <- conc[time >= start & time <= end] | ||
all_times <- time[time >= start & time <= end] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick, style:
all_concs <- conc[time >= start & time <= end] | |
all_times <- time[time >= start & time <= end] | |
all_concs <- conc[time >= start & time <= end] | |
all_times <- time[time >= start & time <= end] |
impute = case_when( | ||
# Start concentration already present: No imputation (NA) | ||
!!sym(time_column) == start & !is.na(!!sym(conc_column)) ~ NA, | ||
|
||
# 1st dose with not IV bolus or analyte =! drug : Start concentration is 0 | ||
is.first.dose & (!is.ivbolus | !is.analyte.drug) ~ "start_conc0", | ||
|
||
# Posterior doses not IV bolus or analyte =! drug : Start concentration shifts to predose | ||
!is.first.dose & (!is.ivbolus | !is.analyte.drug) ~ "start_predose", | ||
|
||
# IV bolus with analyte = drug : Start concentration is log-backextrapolated (if possible) | ||
is.ivbolus & is.analyte.drug & is.possible.c0.logslope ~ "start_logslope", | ||
|
||
# IV bolus with analyte = drug and not possible logslope: Start concentration is 1st conc | ||
is.ivbolus & is.analyte.drug ~ "start_c1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks clean, thank you for additional comments with explanations!
inst/WORDLIST.txt
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue(non-blocking): Please remove this file, it is redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !!
Issue
Closes #2 #60
Description
After running NCA, AUC calculations always consider the discrete start (start at where first concentration sample was collected). This can indeed alter slightly the real values of the AUC. This is a consequence of 2 problems:
Change description.
Definition of Done
C0 imputation option for the user specified in Setup > Data Selection
How to test
if
C0 exists
~C0=C0
if
DOSNO=1 & IV bolus (ADOSEDUR=0, ROUTE=intravascular)
~C0=0
if
DOSNO>1 & not IV bolus
~C0=predose
if
IV bolus and monoexponential data
~logslope
if
IV bolus and not monoexponential data
~C0=C1
Contributor checklist
Notes to reviewer
Anything that the reviewer should know before tacking the pull request?