NONMEM NMTRAN Pharmacometrics & PK/PD (.ctl, .mod)
@modelscript/nmtran (languages/nmtran) provides native WebAssembly GLR parsing, ADVAN1–ADVAN13 compartmental pharmacokinetic/pharmacodynamic (PK/PD) solving, multi-dose (AMT, RATE, II, ADDL) exposure calculation (DAEBuilder lowering, and SBML / Modelica projections for NONMEM NMTRAN clinical trial and population pharmacometrics control streams.
Supported Extensions & Standards
| Extension | Format | Description |
|---|---|---|
.ctl | NMTRAN Control Stream | NONMEM control file ($PROBLEM, $INPUT, $DATA, $SUBROUTINES, $PK, $DES, $ERROR, $THETA, $OMEGA, $SIGMA, $ESTIMATION) |
.mod | PsN / NONMEM Model | Perl-speaks-NONMEM (PsN) and Pirana pharmacometric model file |
Key Capabilities
1. Standard PREDPP Compartmental Library (ADVAN) & General ODEs ($DES)
- Parses
$SUBROUTINES(ADVAN11-compartment IV bolus,ADVAN21-compartment oral first-order absorption,ADVAN3/ADVAN42-compartment,ADVAN11/ADVAN123-compartment, andADVAN6/ADVAN13general non-linear differential equations$DESwithDADT(i)). - Evaluates typical parameter transformations in
$PK(e.g.,CL = THETA(1) * EXP(ETA(1)),V = THETA(2)) and proportional/additive residual error models in$ERROR.
2. Multi-Dose Regimen Simulation & Exposure Metrics
- Simulates intravenous bolus, zero-order infusion, and extravascular oral dosing regimens (
IIinter-dose interval,ADDLadditional doses) and automatically computes clinical exposure metrics:
3. DAE Lowering & Modelica / SBML Projection
- Lowers PK/PD compartmental differential equations into
@modelscript/runtime'sDAEBuilderarena and projects them into Modelica 3.x (nmtranToModelica) and SBML (nmtranToSbml).
Pre-Flight Diagnostics
10 rules10 error
| Code | Rule | Severity | Message |
|---|---|---|---|
M9401 | missing-problem-record | error | NMTRAN control stream is missing the required '$PROBLEM' record. |
M9402 | theta-bounds-violation | error | $THETA parameter 'THETA(<thetaIndex>)' violates bounds (lower=<lower>, init=<init>, upper=<upper>). |
M9403 | missing-des-block-for-general-advan | error | Subroutine '<advan>' requires a '$DES' differential equation block. |
M9404 | undefined-theta-reference | error | Block references 'THETA(<thetaIndex>)' beyond the number of declared '$THETA' parameters ('<maxTheta>'). |
M9405 | undefined-eta-reference | error | Block references 'ETA(<etaIndex>)' beyond the dimension of declared '$OMEGA' variance entries ('<maxOmega>'). |
M9406 | non-positive-omega-variance | error | $OMEGA diagonal variance entry 'OMEGA(<omegaIndex>)' must be positive (> 0) unless FIXED to 0 (got '<variance>'). |
M9407 | compartment-index-out-of-bounds | error | Compartment reference '<cmtIndex>' exceeds declared compartment count ('<maxCmt>'). |
M9408 | missing-error-prediction-y | error | $ERROR block does not define the required dependent prediction variable 'Y'. |
M9409 | missing-required-trans-parameter | error | Subroutine '<advan>' with '<trans>' requires pharmacokinetic parameter '<paramName>' in '$PK'. |
M9410 | negative-dosing-amount | error | Dosing record specifies a negative '<field>' value ('<value>'). |
Generated from languages/nmtran/src/errors.ts. All languages →
CLI Usage
bash
# Validate THETA bounds, OMEGA/SIGMA variance positivity, and ADVAN parametrization
msx lint TwoCompOralPK.ctl
# Parse and inspect NMTRAN control stream blocks
msx parse TwoCompOralPK.ctl
