Skip to content

Commit

Permalink
Merge pull request #160 from nlmixr2/159-sslag-options
Browse files Browse the repository at this point in the history
159 sslag options
  • Loading branch information
mattfidler authored Aug 27, 2023
2 parents 3d114f0 + 08709e7 commit f9c6be3
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Imports:
dparser,
lotri,
Rcpp,
rxode2 (>= 2.0.12),
rxode2 (> 2.0.13),
magrittr,
cli,
tools,
Expand Down
18 changes: 17 additions & 1 deletion R/buildParser.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,25 @@
covsInterpolation <- "nocb"
.minfo("using nocb interpolation like NONMEM, specify directly to change")
}
if (missing(addlKeepsCov)) {
.minfo("using addlKeepsCov=TRUE like NONMEM, specify directly to change")
addlKeepsCov <- TRUE
}
if (missing(addlDropSs)) {
.minfo("using addlDropSs=TRUE like NONMEM, specify directly to change")
addlDropSs <- TRUE
}
if (missing(ssAtDoseTime)) {
.minfo("using ssAtDoseTime=TRUE like NONMEM, specify directly to change")
ssAtDoseTime <- TRUE
}
if (missing(safeZero)) {
.minfo("using safeZero=FALSE since NONMEM does not use protection by default")
safeZero=TRUE
safeZero <- TRUE
}
if (missing(ss2cancelAllPending)) {
.minfo("using ss2cancelAllPending=FALSE since NONMEM does not cancel pending doses with SS=2")
ss2cancelAllPending <- FALSE
}
if (!missing(nStud)) {
if (missing(dfSub)) {
Expand Down
26 changes: 23 additions & 3 deletions R/rxSolve.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,32 @@ rxSolve.nonmem2rx <- function(object, params = NULL, events = NULL,
rate2 = TRUE, dur2 = TRUE), resample = NULL, resampleID = TRUE,
maxwhile = 1e+05, atolSens = 1e-08, rtolSens = 1e-06, ssAtolSens = 1e-08,
ssRtolSens = 1e-06, simVariability = NA, nLlikAlloc = NULL,
useStdPow = FALSE) {
useStdPow = FALSE, naTimeHandle = c("ignore", "warn", "error"),
addlKeepsCov = FALSE, addlDropSs = TRUE, ssAtDoseTime = TRUE,
ss2cancelAllPending = FALSE) {
if (missing(covsInterpolation)) {
covsInterpolation <- "nocb"
.minfo("using nocb interpolation like NONMEM, specify directly to change")
}
if (missing(addlKeepsCov)) {
.minfo("using addlKeepsCov=TRUE like NONMEM, specify directly to change")
addlKeepsCov <- TRUE
}
if (missing(addlDropSs)) {
.minfo("using addlDropSs=TRUE like NONMEM, specify directly to change")
addlDropSs <- TRUE
}
if (missing(ssAtDoseTime)) {
.minfo("using ssAtDoseTime=TRUE like NONMEM, specify directly to change")
ssAtDoseTime <- TRUE
}
if (missing(safeZero)) {
.minfo("using safeZero=FALSE since NONMEM does not use protection by default")
safeZero = TRUE
safeZero <- TRUE
}
if (missing(ss2cancelAllPending)) {
.minfo("using ss2cancelAllPending=FALSE since NONMEM does not cancel pending doses with SS=2")
ss2cancelAllPending <- FALSE
}
if (!missing(nStud)) {
if (missing(dfSub)) {
Expand Down Expand Up @@ -128,5 +146,7 @@ rxSolve.nonmem2rx <- function(object, params = NULL, events = NULL,
resampleID = resampleID, maxwhile = maxwhile, atolSens = atolSens,
rtolSens = rtolSens, ssAtolSens = ssAtolSens, ssRtolSens = ssRtolSens,
simVariability = simVariability, nLlikAlloc = nLlikAlloc,
useStdPow = useStdPow)
useStdPow = useStdPow, naTimeHandle = naTimeHandle, addlKeepsCov = addlKeepsCov,
addlDropSs = addlDropSs, ssAtDoseTime = ssAtDoseTime,
ss2cancelAllPending = ss2cancelAllPending)
}
4 changes: 2 additions & 2 deletions R/validate.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
}
if (!is.null(.rx$predDf)) {
for (.v in .rx$predDf$var) {
.params[[paste0("err.", .v)]] <- 0
.params[[paste0("rxerr.", .v)]] <- 0
}
}
.wid <- which(tolower(names(.params)) == "id")
Expand Down Expand Up @@ -236,7 +236,7 @@
}, double(1), USE.NAMES = TRUE))
if (!is.null(.rx$predDf)) {
.params <- c(.params, setNames(rep(0, length(.rx$predDf$cond)),
paste0("err.", .rx$predDf$var)))
paste0("rxerr.", .rx$predDf$var)))
}
.minfo("solving pred problem")
.predSolve <- try(rxSolve(.model, .params, .nonmemData, returnType = "tibble",
Expand Down

0 comments on commit f9c6be3

Please sign in to comment.