From nlmixr2llm
Use this skill when the user wants to convert a Monolix project (`.mlxtran` + results folder) into an rxode2 / nlmixr2 model object for simulation, sharing, or qualification. Triggers include calls to `monolix2rx()` or `mlxtran()`, references to `.mlxtran` files, "translate this Monolix project", or babelmixr2's Monolix back-translation step.
How this skill is triggered — by the user, by Claude, or both
Slash command
/nlmixr2llm:monolix2rxThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
`monolix2rx` parses a Monolix `.mlxtran` project plus its results folder and produces an rxode2-based model object containing the structural model, fixed and random effects, and the information needed to qualify the translation against Monolix's own predictions. This can be further translated to a full nlmixr2 fit with `babelmixr2::as.nlmixr2()`.
monolix2rx parses a Monolix .mlxtran project plus its results folder and produces an rxode2-based model object containing the structural model, fixed and random effects, and the information needed to qualify the translation against Monolix's own predictions. This can be further translated to a full nlmixr2 fit with babelmixr2::as.nlmixr2().
Activate whenever the user is:
babelmixr2::as.nlmxir2())..mlxtran file structurally without running a full conversion (mlxtran()).library(monolix2rx)
pkgTheo <- system.file("theo", package = "monolix2rx")
mlxtranFile <- file.path(pkgTheo, "theophylline_project.mlxtran")
mod <- monolix2rx(mlxtranFile)
mod # rxode2-based model with Monolix estimates baked in
fit <- babelmixr2::as.nlmixr2(mod) # promote to nlmixr2 fit-like object
For just structural parsing (no conversion to rxode2):
proj <- mlxtran(mlxtranFile)
str(as.list(proj))
The returned mod is an rxode2-flavored model — solve it with rxSolve(mod, ev) like any other rxode2 model.
monolix2rx() needs the .mlxtran file and the results folder Monolix produced next to it (typically a sibling directory). If results are missing, you only get the structural model — no estimates, no qualification.summary.txt — run info, observation/dose counts, Monolix versionFisherInformation/covarianceEstimatesLin.txt — covariance of fixed effects.mlxtran$theta, $omega, compartments, μ-referencing table, and a normalized R-function model body. It is not an nlmixr2 fit object on its own. It can be converted to a full nlmixr2 fit with babelmixr2::as.nlmixr2()lib:bolus_1cpt_TlagVCl.txt) cannot be resolved by monolix2rx alone. Provide one of:
options(monolix2rx.library = "/path/to/library") pointing at a text-file mirror of the library, orlixoftConnectors (Monolix's R bridge) so the library can be looked up live, or.mlxtran at the text file.nonmem2rx, the translation must be checked against Monolix's own predictions before downstream use. Use the qualification helpers from the rxode2-validate article.et() and call rxSolve(mod, ev). For uncertainty propagation, pull the covariance via the parsed object.The skill is "done" only when the converted model has been executed and qualified, not just loaded:
monolix2rx() and confirm the object prints without warnings.rxode2-validate vignette workflow). Diffs should be effectively zero.| Symptom | Likely cause |
|---|---|
cannot find results folder | .mlxtran was passed but the sibling results directory is missing or in a non-standard location |
Library reference fails (lib:...txt not found) | Monolix library not configured — set options(monolix2rx.library=...) or install lixoftConnectors |
summary.txt / covarianceEstimatesLin.txt not found | run was incomplete or covariance step skipped — re-run Monolix with the SE step enabled |
Parameters present but $omega empty | random-effects parsing hit a feature monolix2rx doesn't translate — check the model body |
| IPRED disagrees with Monolix | unsupported Mlxtran feature (custom distributions, complex transforms, IOV with non-standard structure); inspect the generated rxode2 model and patch by hand |
| BLQ rows missing or wrong | BLQ handling differs between tools; verify the dataset's CENS/LIMIT columns survived translation |
.mlxtran and ignore the results folder if the user wanted estimates — the call will succeed but you'll miss $theta / $omega populated values.monolix2rx() as an nlmixr2 fit — it's an rxode2 modelbabelmixr2::as.nlmixr2() as a nlmixr2 fit.vignettes/articles/convert-nlmixr2.Rmd — promoting to nlmixr2 fit-likevignettes/articles/rxode2-validate.Rmd — qualification against Monolixvignettes/articles/simulate-new-dosing.Rmd, simulate-uncertainty.Rmd, simulate-extra-items.Rmd — downstream simulation patternsvignettes/articles/create-vpc.Rmd, create-augPred.Rmd, create-office.Rmd — reportingbabelmixr2's Monolix saves the model to a file and reads the outputs to construct a nlmixr2 fit. This backend uses monolix2rx to read Monolix results back into R after a Monolix fit. babelmixr2 also has a function as.nlmixr2() to convert the rxode2 model from monolix2rx to a nlmixr2 fit. If a babelmixr2 Monolix fit looks wrong, try to get around the failure by loading the same .mlxtran directly with monolix2rx() — that provides a different path to read a Monolix run into rxode2 and nlmixr2.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Searches MemPalace before answering questions about past work, people, projects, or prior decisions. Returns verbatim stored content instead of guessing from model memory.
npx claudepluginhub john-harrold/nlmixr2llm --plugin nlmixr2llm