nonmem2rx 0.1.11
Regenerate the
rxSolve.nonmem2rx()method so it no longer passes theordersolver argument, which was removed fromrxode2::rxSolve(). Passing it caused solving a translated model to fail withunused argument: 'order'against the current CRANrxode2.nonmem2rx()’sinputDataargument now also accepts adata.frameof the already read-in NONMEM input dataset (in addition to a file path). This is useful when importing a model from a different system where you have the data to validate against but the file paths in the control stream do not match (#186). The columns are assumed to be in$INPUTorder and the usual$INPUTnames,DROP,IGNORE/ACCEPTfilters and record subsetting are applied.ADVAN5/ADVAN7general linear models (which NONMEM itself solves with matrix exponentials) are now translated to rxode2’s native matrix-exponentialmatExp()model (cmt()declarations plusk_<from>_<to>rate constants) by default, instead of explicitd/dt()ODEs. The previous ODE translation is retained and can be selected with the newmatexp=FALSEargument (oroptions(nonmem2rx.matexp=FALSE)). Other model types are unaffected, and if the installed rxode2 does not supportmatExp()the ODE translation is used with a warning.NONMEM mixture models (
$MIX) now translate to the native rxode2/nlmixr2 mixture support (mix()), replacing the previousrxord()simulation of the sub-population. When the mixture probabilities are simple parameters (e.g.P(1)=THETA(5)), the imperativeMIXNUM/MIXESTbranching in$PK/$PREDis collapsed into readablemix()calls (e.g.V <- mix(VCM, p1, VCF)), the probabilities are registered on the model (ui$mixProbs) so the model estimates natively underfoceiandsaem, andMIXEST/MIXNUMmap to the reservedmixestcomponent. Models whose probabilities are not simple parameters fall back to the previousrxord()translation. Simulation-based validation remains gated for mixtures because NONMEM’s per-subject sub-population assignment is not recoverable for a faithful prediction comparison.Support the NONMEM
$DATAnumeric-comparison operators.EQN.and.NEN.inIGNORE=/ACCEPT=filters (#195). These request that the data item be converted to numeric before being compared, so they now translate toas.numeric(.data$COL) == value/!= value..NEN.was previously unparseable (silently dropping the filter), and.EQN.was treated as a plain==without the numeric coercion.Support assignment to the NONMEM
COM(#)communication array (declared with$ABBREVIATED COMRES=#). Previously only readingCOM(#)was translated, so control streams that assignedCOM(#)(e.g.IF(NEWIND.LE.1) COM(1)=-1) failed to parse (#228). ACOM(#)assignment now translates to the rxode2 sticky variablerxCOM_#_, which retains its value from record to record like the NONMEM COM array (see the rxode2 sticky variable vignette).Add optional LLM-assisted residual error detection to
as.nonmem2rx()(via theellmerpackage) for models imported without a residual error specification ($predDf). When nochatengine is supplied, the default engine is now chosen dynamically:getOption( "nonmem2rx.llmProvider")is honored first (accepting any exportedellmer::chat_*engine by name), otherwise the first provider with a configured API key is auto-detected (e.g.ANTHROPIC_API_KEY,OPENAI_API_KEY,GEMINI_API_KEY), instead of always requiring Claude. Anyellmerchat object may also be passed directly through the newchatargument.Add integer overflow guards in the C-level string buffer (
src/sbuf.c).sAppendN,sAppend, andaddLinepreviously computed the new allocation size assbb->o + 2 + n + SBUF_MXBUF(or analogous expression). When the user-controllednwas large enough this expression overflowedintto a negative value, whichR_Reallocthen converted to a huge unsigned size and crashed. The guard converts this into a clean R error.Document known
(int)strlen(gBuf)cast in all 10 NONMEM-record parser entry-points (src/abbrec.c,src/abbrev.c,src/data.c,src/input.c,src/lst.c,src/model.c,src/omega.c,src/sub.c,src/tab.c,src/theta.c). Inputs at or aboveINT_MAXbytes cause silent length truncation passed todparse(). A long-term fix will switch each call site toudparse()once dparser-R ships that symbol to CRAN.Fix implicit
ptrdiff_ttointtruncation inrc_dup_str(src/records.c). When the parser passes a string segment longer thanINT_MAXbytes (or a NUL-terminated string of that length), the pointer difference /strlenresult was silently cast toint, truncating the length to a wrong (often negative) value. The new guard rejects such inputs with an informative R error.
nonmem2rx 0.1.10
Bug fix for covariance matrices that span multiple FORTRAN output pages
Bug fix for multiple errors are imported using
nonmem2rx()Change NONMEM import for mixture models to prepend NM to MIXNUM and related import items so they will not interact with rxode2/nlmixr2’s handling of mixture models.
nonmem2rx 0.1.9
CRAN release: 2025-11-27
Try to make sure all the values that can be numeric are numeric #208
Use qs2 since qs is being archived
nonmem2rx 0.1.8
CRAN release: 2025-08-29
Better handling of
ytypeAdded work-around for new Rstudio completion
nonmem2rx 0.1.7
CRAN release: 2025-07-15
- Added
$ERROR (ONLY OBS)support -
ifstatements can be upper or lower case #196
nonmem2rx 0.1.6
CRAN release: 2024-11-28
Add more flexible replacement of ETA and other values #188
Add ability to use
nonmem2rxwith a NONMEM control stream text input
nonmem2rx 0.1.5
CRAN release: 2024-09-18
Be more forgiving in the validation and remove IDs without observations when solving the
IPREDproblem.Binary linkage to dparser changed to structure only, meaning
nonmem2rxmay not have to be updated ifdparseris updated.
nonmem2rx 0.1.4
CRAN release: 2024-05-29
When reading NONMEM results from xml will try
nm:prefixed tags and non-nm:prefixed tags.Omega and Sigma prior estimates are currently ignored (theta priors were already ignored)
Improve reading in
thetavalues from thexmlRead all NONMEM files using latin1 encoding to allow single byte parser to work
When lines in the NONMEM input dataset start with
#they are now ignored.When all IDs are zero, NONMEM assumes restarting time gives different IDs; this is now reflected in NONMEM translation of IDs.
With
linCmt()parsing, expand the scope of conflicting parameters that will be renamed with an import.Added better parsing for
ELSEwhere there is anotherIFon the next line.Prefixed conflicting
VPwithrxm.whenlinCmt()models to be more accommodating when importing linear compartment models.
nonmem2rx 0.1.3
CRAN release: 2023-12-12
Added explicit requirement for rxode2 2.0.13
Added support of
DADT(#)statements on the right side of the equation, i.e.DADT(3) = DADT(1) + DADT(2)(#164)Added support of
ADVAN#, TRANS#(#161)Added more NONMEM-specific solving options
Fixed security related format issues as requested by CRAN #167
Now
omega,thetaMat,dfObsanddfSubare incorporated into model function (by default). You can change this with thenonmem2rxkeepargumentUsing the
rxode22.0.13 makes sure that the solves for models where the endpoint is not determined in the typicalnlmixr2style will validate more often (due to a bug in solving inrxode2).
nonmem2rx 0.1.2
CRAN release: 2023-07-03
Added support for
ADVAN5andADVAN7modelsAdd parsing of accept/ignore characters for example
IGNORE=(C='C')(See Issue #140)Add more robust reading of NONMEM information (and add source) in
nminfo()(See issue #142)Since NONMEM does not protect divide by zeros by default, the default for
solveZerois changed tosolveZero = TRUEfornonmem2rxobjects.Fixed bug for renaming
etaandthetawhen they are renamed so that theui$iniDfdoes not match thetheta#oreta#(Issue #153)Turned off testing of the
as.nonmem2rxexample since it took too much time (according to CRAN)