-
Notifications
You must be signed in to change notification settings - Fork 15
RXR-2394: lagtime updates #122
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
Conversation
roninsightrx
left a comment
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.
few comments
jasmineirx
left a comment
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.
in general looks good! a couple minor comments
Co-authored-by: Jasmine Hughes <43552465+jasmineirx@users.noreply.github.com>
Co-authored-by: Jasmine Hughes <43552465+jasmineirx@users.noreply.github.com>
| lagtime_ode <- attr(ode, "lagtime") | ||
| # override from ode if not specified by user and defined in ode | ||
| if(is.null(lagtime) && !is.null(lagtime_ode) && !lagtime_ode %in% c("NULL", "undefined")) { | ||
| if(is.null(lagtime) && !is.null(lagtime_ode) && lagtime_ode[1] != "NULL" && lagtime_ode[1] != "undefined") { |
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.
should this be a !any(lagtime_ode %in% c("NULL", "undefined"))
Lagtime was previously handled by just adding the lagtime for a given compartment to each dose given into that compartment. So on the level of the event table created that was used as input for the simulation. However, this introduced the problem that the lagtime could not be estimated by PKPDmap (because it is essentially fixed).
To solve this, I moved the functionality that adapted the event table from happening before the core simulation into the core simulation function itself, right before the actual simulation. Now, this core function requires an additional lagtime parameter, which is then used to adapt the event table.
Related PR in PKPDmap