Documentation

2.4 Folder layout of an installation and a first sanity check

An installation of nlmx is small. This section shows where the pieces live and then runs the smoke test that every installation should pass: generate the demo project, check its dataset, and fit its base model. The test takes under ten seconds, and it exercises the executable, the reading of data and control streams, the estimation engine, the writing of results and the logging.

2.4.1 What an installation consists of

From a release archive, an installation is the executable and the licence:

nlmx-<version>-<platform>/
├── nlmx            the program (nlmx.exe on Windows)
└── LICENSE

Put the executable anywhere (Section 2.2). The executable needs nothing else: the fonts that the figures use are embedded, and the manual that Maxson searches is compiled in.

The model file of the assistant is the only thing that is not inside. nlmx ask runs a language model that you supply (a file in GGUF format, about 2 GB) from a folder called models next to the executable, or from a path you give (Chapter 34). Every other command runs without it.

Optional companions. The project also provides a folder of exposure-response test data (data/er) for learning Chapters 32 and 33: a subject-level dataset, a longitudinal one, a script that makes them, and 13 ready-made settings files that run from a quick start to a full analysis, plus the short per-command guides (docs/). They are not needed to run nlmx.

Where a project lives. nlmx has no installation of projects. A project is a folder you make: data, models, settings files, and one output folder per command run, as in Figure 1.1.1. The demo project made by nlmx generate is the model for such a folder.

2.4.2 The generated demo project

nlmx generate --output demo writes a complete, synthetic project and fits its base model. It is the data used by the guided tour of Chapter 3 and by every worked example of this book.

$ nlmx generate --output demo --no-color
…
   1.83s ok    fit of run101: OFV = -2880.2130 after 9 iteration(s) (converged), THETA = [3.3446, 43.7421, 1.0973, 0.1760, 0.0235]
   1.83s stage covariance step (observed information at the optimum)
Example project written to demo
Next: nlmx cov --config demo/nlmx.covar --output demo/out
   2.55s ok    example project written — total elapsed 2.55s
[exit 0]

The project it writes:

demo/
├── README.md                what the project is and which commands to try
├── data/analysis.csv        200 subjects, 2,200 records, 13 columns (ID TIME AMT ADDL II EVID MDV DV CMT WT SEX EGFR CRCL)
├── models/
│   ├── run101.ctl           the base model: one compartment, first-order absorption (ADVAN2 TRANS2)
│   └── run101.ext .cov .cor .coi .phi    the results of its maximum-likelihood fit
├── nlmx.covar               the covariate settings (Chapter 25)
├── nlmx.vpc                 the predictive-check settings (Chapter 27)
└── run101_files.txt         an explicit file list for --files (Section 4.1)

Chapter 3 walks through it. For now, three facts matter for the smoke test: the data are synthetic, so there is no confidentiality issue in sharing any output of the book; the base model fitted at generation reaches an objective function value of −2880.213; and an installation that agrees with the author's should reach the same value, to the printed digits, when the control stream is fitted again (a different processor family can change the last digit; Section 4.3).

2.4.3 The smoke test

Run three commands on the demo project. Each one must end with [exit 0] (or, in a shell, echo $? printing 0).

  1. The program identifies itself. nlmx version --no-color prints the banner of Figure 2.1.1 with the version you installed.
  2. The dataset passes the checks. nlmx qc-data data/analysis.csv --no-color -o out_qcd ends with the verdict READY WITH WARNINGS and 99 checks: 75 PASS, 8 COMMENT, 4 WARN, 0 FAIL, 12 N/A (the four warnings are real features of the synthetic data, discussed in Section 3.2).
  3. The model fits. nlmx fit models/run101.ctl --no-color -o out_fit ends with OBJECTIVE FUNCTION VALUE (OFV): -2880.2130 and fit complete — OFV -2880.2130 (converged).

What a pass tells you: the executable runs on your system, reads CSV and NM-TRAN, evaluates the likelihood of an ADVAN2 model with ETAs and a combined error, optimises it, computes the covariance step and writes the NONMEM-format files. What it does not tell you: that every feature works on your data, or that the numbers agree with NONMEM's for your model (nlmx validate does that for a model with NONMEM results, Chapter 5; Chapter 42 describes the full test suite).

2.4.4 Worked example X2.1: run the smoke test on each platform

This example runs the smoke test of Section 2.4.3 in a temporary folder with one script. There is one script for Linux and macOS and one for Windows PowerShell; both are in the companion files, and both do the same three things: print the version, run the data checks on the demo project, and fit its base model.

bash smoke-test.sh                       # uses the nlmx found on the PATH
bash smoke-test.sh /path/to/nlmx         # or a specific executable
.\smoke-test.ps1                         # uses the nlmx found on the PATH
.\smoke-test.ps1 C:\path\to\nlmx.exe    # or a specific executable

The output of the smoke-test part, recorded on Linux (x86-64):

== smoke test
║ ┌──────────────────────────────────────────────────────────────────┐ ║
║ │ NLMX                                                      v4.2.1 │ ║
║ │ Complete PK/PD pharmacometrics software that talks with you      │ ║
║ │ QC, NCA, PopPK/PD fitting, covariates, VPC, sims, E-R, assistant │ ║
║ │ For Clinical Pharmacology, Pharmacometrics & Data Science        │ ║
Example project written to demo
   0.01s ok    READY WITH WARNINGS — review the warnings before analysis — 99 checks: 75 PASS, 8 COMMENT, 4 WARN, 0 FAIL, 12 N/A
OBJECTIVE FUNCTION VALUE (OFV): -2880.2130
smoke test passed in /tmp/tmp.XXXXXXXXXX

Platform status in this book. The Linux run above is a real recording. The macOS and Windows commands use the same program and the same arguments; they were not recorded for this book. If the smoke test fails on your system, the first things to check are the version (nlmx version), the working folder, and whether a file called nlmx in the current folder shadows the executable on the PATH.