From c45c48fd2bd652852aaf0a5688c1f4c379dd58b4 Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Wed, 16 Aug 2023 21:25:19 -0500 Subject: [PATCH 1/4] rename err. to rxerr. to reflect rxode2 changes --- R/validate.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/validate.R b/R/validate.R index bbafefa8..463fc379 100644 --- a/R/validate.R +++ b/R/validate.R @@ -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") @@ -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", From 9df3ffe89a32930b775d2a74c01c1178395e35ce Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Wed, 16 Aug 2023 21:31:12 -0500 Subject: [PATCH 2/4] Update using ssLag new options --- R/buildParser.R | 12 ++++++++++++ R/rxSolve.R | 18 ++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/R/buildParser.R b/R/buildParser.R index 4d478766..c26200c2 100644 --- a/R/buildParser.R +++ b/R/buildParser.R @@ -103,6 +103,18 @@ 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") + safeZero=TRUE + } if (missing(safeZero)) { .minfo("using safeZero=FALSE since NONMEM does not use protection by default") safeZero=TRUE diff --git a/R/rxSolve.R b/R/rxSolve.R index 132c0d90..27d4b230 100644 --- a/R/rxSolve.R +++ b/R/rxSolve.R @@ -36,11 +36,24 @@ 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) { 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") + safeZero = TRUE + } if (missing(safeZero)) { .minfo("using safeZero=FALSE since NONMEM does not use protection by default") safeZero = TRUE @@ -128,5 +141,6 @@ 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) } From 867b7f668fcc9d7cd20991eb7be4f84b27a1f2ad Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Wed, 16 Aug 2023 21:33:26 -0500 Subject: [PATCH 3/4] Change version requirement --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 85760c7c..0ae41db9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -37,7 +37,7 @@ Imports: dparser, lotri, Rcpp, - rxode2 (>= 2.0.12), + rxode2 (> 2.0.13), magrittr, cli, tools, From 08709e74cf75d35016964d05144fa89b05ae36b9 Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Sat, 26 Aug 2023 21:42:12 -0500 Subject: [PATCH 4/4] Add new option ss2cancelAllPending --- R/buildParser.R | 8 ++++++-- R/rxSolve.R | 14 ++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/R/buildParser.R b/R/buildParser.R index c26200c2..bbd6c58e 100644 --- a/R/buildParser.R +++ b/R/buildParser.R @@ -113,11 +113,15 @@ } if (missing(ssAtDoseTime)) { .minfo("using ssAtDoseTime=TRUE like NONMEM, specify directly to change") - safeZero=TRUE + 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)) { diff --git a/R/rxSolve.R b/R/rxSolve.R index 27d4b230..2ff900ac 100644 --- a/R/rxSolve.R +++ b/R/rxSolve.R @@ -37,7 +37,8 @@ rxSolve.nonmem2rx <- function(object, params = NULL, events = NULL, maxwhile = 1e+05, atolSens = 1e-08, rtolSens = 1e-06, ssAtolSens = 1e-08, ssRtolSens = 1e-06, simVariability = NA, nLlikAlloc = NULL, useStdPow = FALSE, naTimeHandle = c("ignore", "warn", "error"), - addlKeepsCov = FALSE, addlDropSs = TRUE, ssAtDoseTime = TRUE) { + addlKeepsCov = FALSE, addlDropSs = TRUE, ssAtDoseTime = TRUE, + ss2cancelAllPending = FALSE) { if (missing(covsInterpolation)) { covsInterpolation <- "nocb" .minfo("using nocb interpolation like NONMEM, specify directly to change") @@ -52,11 +53,15 @@ rxSolve.nonmem2rx <- function(object, params = NULL, events = NULL, } if (missing(ssAtDoseTime)) { .minfo("using ssAtDoseTime=TRUE like NONMEM, specify directly to change") - safeZero = TRUE + 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)) { @@ -142,5 +147,6 @@ rxSolve.nonmem2rx <- function(object, params = NULL, events = NULL, rtolSens = rtolSens, ssAtolSens = ssAtolSens, ssRtolSens = ssRtolSens, simVariability = simVariability, nLlikAlloc = nLlikAlloc, useStdPow = useStdPow, naTimeHandle = naTimeHandle, addlKeepsCov = addlKeepsCov, - addlDropSs = addlDropSs, ssAtDoseTime = ssAtDoseTime) + addlDropSs = addlDropSs, ssAtDoseTime = ssAtDoseTime, + ss2cancelAllPending = ss2cancelAllPending) }