# nlmx qc-nm configuration (plain text, TOML syntax, .qcn extension) # # Quality control of a NONMEM control stream: whether NM-TRAN will accept it # (records, names, $INPUT against the dataset, $DATA, ADVAN/TRANS/TOL, the # abbreviated code, $THETA/$OMEGA/$SIGMA, $ESTIMATION, $TABLE) and whether # it follows good practice (INTERACTION, MAXEVAL, protected LOG/SQRT, # labels, a covariance step). Every check answers one question and ends as # PASS, WARN, FAIL, COMMENT or N/A in qc_nm_checklist.csv and the report. # The corrections in [fix] are written to a copy (_qc.ctl); the # original control stream is never changed. # # Every key is optional; the values shown are the defaults. Command-line # options override the file. Relative paths resolve against this file's # folder. Use it with: nlmx qc-nm -c nlmx.qcn # Every check, correction and setting is described in docs/QC-NM.md. [input] # control_stream = "models/run1.ctl" # the control stream (or give it on the command line) # data = "data/pk.csv" # --data: read this dataset instead of the file named in $DATA check_data = true # --no-data-check: false = do not open the dataset delimiter = "auto" # auto | comma | tab | space | semicolon (the dataset) max_rows = 1000000 # dataset lines read at most [nonmem] version = "7.5" # --nm-version: 7.2 … 7.6 (METHOD=NUTS needs 7.4 or later) max_line_length = 160 # characters per line; older NM-TRAN versions stop at 160, # recent ones accept longer lines, so this is a portability limit max_label_length = 20 # characters of $INPUT labels and variable names max_conditions = 100 # IGNORE/ACCEPT conditions in $DATA extra_records = [] # record names to accept in addition to NONMEM's (site extensions) [code] undefined = true # COD06: report variables used before or without a definition unused = true # COD03-05: report THETA/ETA/EPS that the code never uses protection = true # COD08: report unprotected LOG, SQRT and divisions protected_functions = ["LOG", "LOG10", "SQRT"] # functions whose argument must be positive zero_risk = ["W", "IPRED", "F", "SD"] # denominators that can be zero (W = 0 when the error is 0, …) known_variables = [] # names defined elsewhere (verbatim code, $INFN), not reported as undefined mu_reference = true # COD11: suggest MU referencing for EM and Bayesian methods [parameters] bound_margin = 0.01 # a THETA within this fraction of its range from a bound is "at the bound" min_cv = 1.0 # OMEGA values with a CV (%) below this … max_cv = 300.0 # … or above this are reported (PAR08) zero_theta = true # PAR04: report estimated THETAs that start at 0 labels = true # DOC02: report unlabelled THETA/OMEGA/SIGMA values [estimation] interaction = true # EST03: report METHOD=1 without INTERACTION when the error depends on F maxeval = 9999 # the MAXEVAL the maxeval correction writes tol = 9 # the TOL the tol correction writes require_covariance = false # EST07: true = a missing $COVARIANCE is a warning (else a comment) covariance_text = "$COVARIANCE PRINT=E UNCONDITIONAL" # the record the covariance correction inserts [tables] require = true # TAB04: report a missing diagnostics table options = ["ONEHEADER", "NOPRINT"] # options every $TABLE should have (TAB03; the table_options correction adds them) diagnostics = ["ID", "TIME", "DV", "PRED", "IPRED", "CWRES"] # items some $TABLE should list (TAB04) extra_items = [] # more names accepted as $TABLE items [fix] enabled = true # --no-fix: false = report only, no corrected copy # output = "run1_qc.ctl" # --fix-output: file name of the corrected copy (default _qc) header_comment = true # write a ;; comment at the top of the copy listing the corrections # problem_text = "my model" # the description of an inserted $PROBLEM (default: the file name) skip = [] # --skip-fixes: corrections to leave out, e.g. ["bounds", "tol"] # Each correction on (true) or off (false); the defaults are shown. ascii = true # remove a byte-order mark; replace typographic quotes, dashes, µ, × and non-breaking spaces by ASCII line_endings = true # use the line ending of the majority of the lines throughout tabs = true # replace tab characters by spaces trailing_space = true # remove white space at the ends of the lines wrap_lists = true # split long $INPUT and $TABLE lines into several lines problem = true # insert a $PROBLEM record when the file has none sizes_first = true # move $SIZES before $PROBLEM record_names = false # write abbreviated record names in full ($EST -> $ESTIMATION) input_from_header = false # rewrite $INPUT from the dataset header (text columns as =DROP) drop_text = true # add =DROP to $INPUT labels of text columns that the code does not use ignore = true # add IGNORE=@ to $DATA (or replace IGNORE=#) when the header would be read as data tol = true # add TOL to $SUBROUTINES for the general ADVANs bounds = true # order THETA bounds and move initial values inside them and away from zero zero_fix = true # FIX zero diagonal OMEGA/SIGMA values; make negative variances positive block_pd = true # shrink the covariances of a block that is not positive definite interaction = true # add INTERACTION to METHOD=1 when the residual error depends on the prediction maxeval = true # add MAXEVAL to the classical methods that lack it posthoc = true # add POSTHOC to METHOD=0 when individual estimates are needed covariance = false # add $COVARIANCE after the last $ESTIMATION table_files = true # give duplicated $TABLE file names a numbered suffix table_options = true # add ONEHEADER and NOPRINT to $TABLE records table_items = false # remove repeated and undefined $TABLE items ignore_numeric = true # write .EQ./.NE. as .EQN./.NEN. in IGNORE/ACCEPT when a numeric value would be missed as text table_unused = false # add variables that are defined but never used to the first $TABLE [checks] skip = [] # check IDs or categories not run, e.g. ["DOC", "EST09"] only = [] # run only these (IDs or categories); [] = all # categories: file records input data subroutines code parameters # estimation tables documentation, or the three letters of the IDs: # FIL REC INP DAT SUB COD PAR EST TAB DOC [severity] # The severity of a check: "error" (FAIL), "warning" (WARN), "comment" # (COMMENT) or "off". The defaults are shown; remove the # to change one. # file — File and format # FIL01 = "error" # Is the control stream a readable, non-empty text file? # FIL02 = "warning" # Is the file free of a byte-order mark and of non-ASCII characters? # FIL03 = "comment" # Are the line endings consistent (all CRLF or all LF)? # FIL04 = "warning" # Are the lines within the line-length limit? # FIL05 = "comment" # Is the file free of tab characters? # FIL06 = "comment" # Is the file free of trailing white space? # FIL07 = "comment" # How many problems ($PROBLEM records) does the file hold? # records — Records # REC01 = "error" # Does the control stream start with $PROBLEM (after $SIZES and comments)? # REC02 = "error" # Is every record name one that NM-TRAN knows? # REC03 = "comment" # Are the record names written in full (not abbreviated)? # REC04 = "error" # Is each single-use record given at most once per problem? # REC05 = "error" # Are the records the model needs present ($INPUT, $DATA, a model, $THETA)? # REC06 = "error" # Is the model either $PRED or PREDPP ($SUBROUTINES with $PK and $ERROR), not both? # REC07 = "warning" # Are the records in a usual order ($INPUT and $DATA before the code, parameters before $ESTIMATION, $ESTIMATION before $COVARIANCE and $TABLE)? # REC08 = "error" # Does every record that needs content have it? # REC09 = "error" # Is $SIZES (when present) before $PROBLEM? # REC10 = "warning" # Do the files named by $INCLUDE, $MSFI and $ETAS/$PHIS FILE= exist? # input — $INPUT # INP01 = "error" # Are the $INPUT labels valid names (a letter first, letters, digits and _, within the length limit)? # INP02 = "error" # Are the $INPUT labels unique? # INP03 = "error" # Are the data items NONMEM needs in $INPUT (ID and DV; TIME and AMT for PREDPP)? # INP04 = "error" # Are reserved names kept out of the $INPUT labels (THETA, ETA, EPS, PRED, RES, WRES …)? # INP05 = "error" # Are DROPped data items left out of the code (they stay usable in IGNORE/ACCEPT)? # INP06 = "comment" # Are EVID and MDV given, or can NONMEM infer them? # INP07 = "comment" # Do the $INPUT labels match the dataset header (number and names)? # INP08 = "error" # Are the dataset columns that hold text DROPped in $INPUT? # data — $DATA and the dataset # DAT01 = "error" # Does $DATA name a dataset that exists (relative to the control stream)? # DAT02 = "error" # Will the IGNORE option skip the header line of the dataset? # DAT03 = "error" # Do the IGNORE/ACCEPT conditions use $INPUT labels and valid operators, without mixing IGNORE=(list) and ACCEPT? # DAT04 = "warning" # Is the number of IGNORE/ACCEPT conditions within NONMEM's limit? # DAT05 = "error" # Do the dataset's CMT values exist in the model? # DAT06 = "error" # Does the dataset have at least as many columns as $INPUT has labels? # DAT07 = "comment" # How many records and individuals will NONMEM read after IGNORE/ACCEPT? # DAT08 = "error" # Are the dataset lines that are not data (comments, notes, a second header) skipped by the IGNORE option? # DAT09 = "warning" # Do .EQ./.NE. conditions on numbers match the dataset as intended (they compare text: 0 is not 0.0)? # DAT10 = "warning" # Does every IGNORE/ACCEPT condition select some records, and do observations remain? # subroutines — $SUBROUTINES, $MODEL and PK parameters # SUB01 = "error" # Is the ADVAN known and the TRANS valid for it? # SUB02 = "error" # Is TOL given for the general ADVANs (6, 8, 9, 13, 14, 15)? # SUB03 = "error" # Does a general ADVAN have $MODEL, and an ODE ADVAN $DES? # SUB04 = "error" # Are the basic PK parameters required by ADVAN/TRANS assigned in $PK? # SUB05 = "warning" # Is the scale S of the observation compartment set in $PK? # SUB06 = "error" # Do the compartment numbers of Fn, ALAGn, Rn, Dn, Sn and A(n) exist in the model? # SUB07 = "error" # Does $DES define DADT(n) for every compartment, and for no other? # code — Abbreviated code # COD01 = "error" # Does the abbreviated code parse (syntax)? # COD02 = "error" # Are IF/THEN/ELSE/ENDIF and DO WHILE/ENDDO balanced? # COD03 = "error" # Are the THETA(n) indices within $THETA, and is every THETA used? # COD04 = "error" # Are the ETA(n) indices within $OMEGA, and is every ETA used? # COD05 = "error" # Are the EPS(n)/ERR(n) indices within $SIGMA, and is every EPS used? # COD06 = "warning" # Is every variable defined before it is used (or a data item or NONMEM name)? # COD07 = "error" # Is Y defined in $ERROR (PREDPP) or $PRED? # COD08 = "warning" # Are LOG, SQRT and divisions protected against zero or negative values? # COD09 = "error" # Are the variable names valid (within the length limit, not reserved words)? # COD10 = "error" # Does each block use only what NONMEM allows there (no EPS in $PK, DADT only in $DES, A(n) not in $PK)? # COD11 = "comment" # Are MU-referencing statements present for the EM and Bayesian methods? # COD12 = "warning" # Is every variable defined in $PK, $ERROR, $PRED or $DES used later or written to a $TABLE? # parameters — $THETA, $OMEGA and $SIGMA # PAR01 = "error" # Do $THETA, $OMEGA and $SIGMA parse? # PAR02 = "error" # Are the THETA bounds ordered, with the initial value inside them? # PAR03 = "warning" # Are the THETA initial values away from their bounds? # PAR04 = "warning" # Are the estimated THETAs started away from zero? # PAR05 = "error" # Are the diagonal OMEGA/SIGMA values positive, and zeros FIXed? # PAR06 = "error" # Are the OMEGA/SIGMA blocks positive definite? # PAR07 = "error" # Does each BLOCK(n) have n(n+1)/2 values, and does SAME follow a block of the same size? # PAR08 = "comment" # Are the OMEGA initial values plausible (CV between 1 % and 300 %)? # PAR09 = "comment" # Are FIXed THETAs written without bounds that would be ignored? # estimation — $ESTIMATION and $COVARIANCE # EST01 = "warning" # Is there an $ESTIMATION (or $SIMULATION) record? # EST02 = "error" # Are the methods and options of $ESTIMATION valid together? # EST03 = "warning" # Is INTERACTION set when the residual error depends on the prediction? # EST04 = "comment" # Is MAXEVAL given for the classical methods? # EST05 = "warning" # Do likelihood models (F_FLAG, LIKELIHOOD, -2LL, M3) use LAPLACIAN? # EST06 = "comment" # Is the sequence of methods sensible (an EM method followed by IMP or an evaluation)? # EST07 = "comment" # Is a $COVARIANCE step requested? # EST08 = "warning" # Does FO (METHOD=0) have POSTHOC when tables or code need individual estimates? # EST09 = "comment" # Are the $ESTIMATION and $COVARIANCE options known? # tables — $TABLE # TAB01 = "error" # Are the $TABLE file names unique? # TAB02 = "error" # Is every $TABLE item a data item, a variable of the code or a NONMEM output? # TAB03 = "comment" # Do the $TABLE records use ONEHEADER and NOPRINT? # TAB04 = "comment" # Is there at least one $TABLE with the diagnostics (ID, TIME, DV, PRED, IPRED, CWRES)? # TAB05 = "comment" # Is each item listed only once per $TABLE? # TAB06 = "warning" # Does every $TABLE with NOPRINT have FILE= (otherwise the table is written nowhere useful)? # documentation — Documentation # DOC01 = "comment" # Does $PROBLEM carry a description? # DOC02 = "comment" # Are the THETA, OMEGA and SIGMA values labelled with comments? # DOC03 = "comment" # Does the file have a header comment (description, author, date)? [output] # directory = "run1_qc_nm" # default: /_qc_nm html = true # report.html: verdict, checklist before/after the corrections, findings, changes json = true # qc_nm_summary.json diff = true # qc_nm_changes.diff: unified diff of the original and the corrected copy tables = true # qc_nm_parameters.csv and qc_nm_variables.csv max_findings = 1000 # findings kept per check examples = 5 # findings quoted in the checklist comment fail_on = "never" # never | error | warning: exit status 6 when the (corrected) control # stream still has an error (or a warning), for scripts and pipelines