From af9aa5a8f4baec6fff4907460ee075c254625666 Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Mon, 16 Sep 2024 14:01:50 -0500 Subject: [PATCH] Add deparse to all estimation methods --- R/monolixControl.R | 6 ++++++ R/nonmemControl.R | 7 +++++++ R/pknca.R | 7 +++++++ R/poped.R | 7 +++++++ R/zzz.R | 4 ++++ 5 files changed, 31 insertions(+) diff --git a/R/monolixControl.R b/R/monolixControl.R index 2fafdfcc..1c97151f 100644 --- a/R/monolixControl.R +++ b/R/monolixControl.R @@ -208,6 +208,12 @@ monolixControl <- function(nbSSDoses=7, .ret } +rxUiDeparse.monolixControl <- function(object, var) { + .default <- monolixControl() + .w <- nlmixr2est::.deparseDifferent(.default, object, "genRxControl") + nlmixr2est::.deparseFinal(.default, object, .w, var) +} + .monolixControlToFoceiControl <- function(env, assign = TRUE) { .monolixControl <- env$monolixControl .ui <- env$ui diff --git a/R/nonmemControl.R b/R/nonmemControl.R index f6573bd0..509b9994 100644 --- a/R/nonmemControl.R +++ b/R/nonmemControl.R @@ -254,6 +254,13 @@ nonmemControl <- function(est=c("focei", "imp", "its", "posthoc"), .ret } +rxUiDeparse.nonmemControl <- function(object, var) { + .default <- nonmemControl() + .w <- nlmixr2est::.deparseDifferent(.default, object, "genRxControl") + nlmixr2est::.deparseFinal(.default, object, .w, var) +} + + #' @export getValidNlmixrCtl.nonmem <- function(control) { .ctl <- control[[1]] diff --git a/R/pknca.R b/R/pknca.R index ef3161b9..8f60b2d9 100644 --- a/R/pknca.R +++ b/R/pknca.R @@ -431,6 +431,13 @@ pkncaControl <- function(concu = NA_character_, doseu = NA_character_, timeu = N ) } +rxUiDeparse.pkncaControl <- function(object, var) { + .default <- pkncaControl() + .w <- nlmixr2est::.deparseDifferent(.default, object, "genRxControl") + nlmixr2est::.deparseFinal(.default, object, .w, var) +} + + #' @export getValidNlmixrCtl.pknca <- function(control) { orig <- control diff --git a/R/poped.R b/R/poped.R index dad76c70..906b1c59 100644 --- a/R/poped.R +++ b/R/poped.R @@ -2896,6 +2896,13 @@ popedControl <- function(stickyRecalcN=4, .ret } +rxUiDeparse.popedControl <- function(object, var) { + .default <- popedControl() + .w <- nlmixr2est::.deparseDifferent(.default, object, "genRxControl") + nlmixr2est::.deparseFinal(.default, object, .w, var) +} + + .popedFamilyControl <- function(env, ...) { .ui <- env$ui diff --git a/R/zzz.R b/R/zzz.R index ebb5dd99..0b3205de 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -25,5 +25,9 @@ rxode2.api <- names(rxode2::.rxode2ptrs()) rxode2::.s3register("nlmixr2est::nmObjGetFoceiControl", "monolix") rxode2::.s3register("nlmixr2est::nmObjHandleControlObject", "monolixControl") rxode2::.s3register("nlmixr2est::nlmixr2", "pkncaEst") + rxode2::.s3register("rxode2::rxUiDeparse", "monolixControl") + rxode2::.s3register("rxode2::rxUiDeparse", "nonmemControl") + rxode2::.s3register("rxode2::rxUiDeparse", "pkncaControl") + rxode2::.s3register("rxode2::rxUiDeparse", "popedControl") .iniRxode2Ptr() }