From e218c59ad176d224f59437f3abc0dc1ec28ca895 Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Wed, 18 Sep 2024 11:19:43 -0500 Subject: [PATCH] Update mlxtran and remove file if present --- R/equation.R | 1 + R/mlxtran.R | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/R/equation.R b/R/equation.R index 534ff0a..32e33d8 100644 --- a/R/equation.R +++ b/R/equation.R @@ -301,6 +301,7 @@ mlxTxt <- function(file, retFile=FALSE) { .m2 <- c("", .lines) lapply(.m2, .mlxtranParseItem) + .mlxEnv$parsedFile <- TRUE if (retFile) return(file) .ret <- .mlxtranFinalize(.mlxEnv$lst, equation=TRUE, update=FALSE) attr(.ret, "dirn") <- .dirn diff --git a/R/mlxtran.R b/R/mlxtran.R index ef4e7c1..1712e8d 100644 --- a/R/mlxtran.R +++ b/R/mlxtran.R @@ -11,6 +11,7 @@ .mlxEnv$lst <- list(mlxtran="") .mlxEnv$isDesc <- FALSE .mlxEnv$desc <- "" + .mlxEnv$parsedFile <- FALSE } #' This parses a single line from something like readLines @@ -107,7 +108,11 @@ } } if (!is.null(.ret$MODEL$LONGITUDINAL)) { - .ret$MODEL$LONGITUDINAL$LONGITUDINAL <- .longitudinal(.ret$MODEL$LONGITUDINAL$LONGITUDINAL) + .long <- .longitudinal(.ret$MODEL$LONGITUDINAL$LONGITUDINAL) + if (.mlxEnv$parsedFile) { + .long$file <- NULL + } + .ret$MODEL$LONGITUDINAL$LONGITUDINAL <- .long if (!is.null(.ret$MODEL$LONGITUDINAL$DEFINITION)) { .ld <- .longDef(.ret$MODEL$LONGITUDINAL$DEFINITION) .monolix2rx$endpointPred <- .getMonolixPreds(.ld) @@ -178,7 +183,11 @@ if (!is.null(.mlxEnv$lst$MODEL$LONGITUDINAL)) { .long <- .longitudinal(.mlxEnv$lst$MODEL$LONGITUDINAL$LONGITUDINAL) .file <- .long$file + .mlxEnv$parsedFile <- FALSE mlxTxt(.long$file, retFile=TRUE) + if (.mlxEnv$parsedFile) { + .minfo(paste0("integrated model file '", .file ,"' into mlxtran object")) + } } .mlxtranFinalize(.mlxEnv$lst, equation=equation, update=update) }