-
Notifications
You must be signed in to change notification settings - Fork 13
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
RXR-1851: add function to calculate auc pre-ss #91
Conversation
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
one consideration is that this requires standard mapping of doses into the first compartment, and so won't support drugs like tacrolimus where we often have a mix of oral/iv dosing. do you think it makes sense to add some documentation or warnings somewhere? one option could be to check reg
for multiple type
arguments. the user is more likely to be aware of the limitation if supplying dose/interval/t_inf since the "type" argument is not present.
R/calc_auc_analytic.R
Outdated
dose = NULL, | ||
interval = NULL, | ||
t_inf = NULL, | ||
parameters, |
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.
it would be tidier to put the parameters argument second, since then you can pass arguments by position more conveniently
calc_auc_analytic("1cmt_iv_bolus", pars, reg)
calc_auc_analytic("1cmt_iv_bolus", pars, dose = 1000, interval = 24, t_inf = 1)
R/calc_auc_analytic.R
Outdated
if(is.null(dose) || is.null(interval)) { | ||
stop("Specify `regimen` or `dose` and `interval`") | ||
} | ||
if(is.null(t_inf) || t_inf == 0) t_inf <- 1e-6 |
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.
if(is.null(t_inf) || t_inf == 0) t_inf <- 1e-6 | |
if(is.null(t_inf) || any(t_inf == 0)) t_inf[t_inf > 0] <- 1e-6 |
t_inf can be of length > 1. the suggested code handles this situation.
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.
I actually intended it to be a single value, like dose and amount, that just specify the ongoing regimen. I will make that more clear in the code.
Right now it can only be used for iv models, so it shouldn't be an issue. The linear oral models in PKPDsim don't calculate AUC. |
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
This adds a convenience function to calculate AUC (and conc) using linear models, based on just the PK parameters.