# nlmx qc-data configuration (plain text, TOML syntax, .qcd extension) # # Quality control of a NONMEM-style dataset before modelling: whether NM-TRAN # will read the file, whether the columns and records are consistent (EVID, # MDV, AMT, CMT, RATE, ADDL, II, SS, TIME), whether the dosing and the # observations make sense (BLQ, outliers, pre-dose samples), whether each # individual is complete, and whether the covariates are usable. Every check # answers one question and ends as PASS, WARN, FAIL, COMMENT or N/A in # qc_checklist.csv and the report. # # 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-data -c nlmx.qcd # Every check and setting is described in docs/QC-DATA.md. [data] # file = "data/pk.csv" # the dataset (or give it on the command line) id = "ID" # column names (any case) time = "TIME" dv = "DV" amt = "AMT" evid = "EVID" mdv = "MDV" cmt = "CMT" rate = "RATE" addl = "ADDL" ii = "II" ss = "SS" # Row filter (R syntax), as NONMEM IGNORE/ACCEPT: rows that fail it are left # out of the checks, doses and observations alike. Quoted text compares as text. # filter = 'STUDY != 3' # obs_filter = "DVID == 1" # observation rows only (doses are always kept) # Grouping columns (study, arm, formulation): constant within an individual # unless listed in [subjects] time_varying_groups. groups = [] # e.g. ["STUDY", "ARM"] # lloq = 0.05 # lower limit of quantification (enables the BLQ checks) # blq = "BLQ" # a column flagging BLQ samples (non-zero) dv_log = false # DV is ln(concentration) [columns] # Optional columns that switch on further checks (any case). # tad = "TAD" # time after the latest dose: compared with the dosing history # nominal_time = "NTIM" # scheduled time: compared with TIME # dvid = "DVID" # observation type (parent, metabolite, PD): listed per type # lloq_column = "LLOQ" # the LLOQ of each record (when it differs by assay or study) [file] delimiter = "auto" # auto | comma | tab | space | semicolon ignore = "@" # the IGNORE option you plan to put in $DATA: # @ skip the header and every record starting with a letter or @ # # the NM-TRAN default: skip records with # in column 1 # C (any character) skip records with it in column 1 # none no IGNORE: every line is data max_line_length = 1000 # characters; NM-TRAN stops reading longer records (FSD 67000 in # NONMEM 7.5 and later, 160 in older versions) [header] required = ["ID", "TIME", "DV"] # columns that must exist recommended = ["AMT", "EVID", "MDV", "CMT"] # columns whose absence is only noted max_name_length = 20 # NM-TRAN labels are at most 20 characters max_items = 50 # data items NM-TRAN accepts (DROP columns do not count) extra_reserved = [] # more names that may not be used as column labels [values] text_columns = [] # columns that hold text on purpose (to be DROPped in $INPUT) missing_markers = ["NA", "N/A", "#N/A", "NAN", "NULL", "NIL", "NONE", "MISSING", "-", "--", "?", "..", "ND", "NS", "NR", "NQ"] # text that stands for a missing value elsewhere but cannot be read by NM-TRAN sentinels = [-99, -999, -9999, -99999, 99999, 999999] # numbers used as missing codes (reported where a covariate or DV has one) max_abs = 1e10 # values larger in magnitude are suspect max_field_length = 24 # NM-TRAN data items are at most 24 characters max_id_digits = 15 # IDs with more digits lose precision as numbers [events] evid_values = [0, 1, 2, 3, 4] # EVID values NONMEM knows ss_values = [0, 1, 2, 3] # SS values NONMEM knows (3 from NONMEM 7.3) max_cmt = 99 # largest compartment number (a negative CMT turns it off) # min_infusion_duration = 0.01 # AMT / RATE shorter than this is suspect # max_infusion_duration = 24 # AMT / RATE longer than this is suspect [time] first_dose_at_zero = true # the first dose of an individual is at time 0 zero_tolerance = 1e-9 # how close to 0 counts as 0 max_time = 100000 # a larger TIME suggests dates, seconds or clock times # max_gap = 720 # report gaps between consecutive records longer than this tad_tolerance = 0.01 # allowed difference between TAD and the time since the dose nominal_tolerance = 0.5 # allowed difference between TIME and the nominal time ... nominal_relative = 0.1 # ... or this fraction of the nominal time, whichever is larger [dosing] require_dose = true # every individual with observations needs a dose (false: PD or baseline data) require_observation = true # every dosed individual needs observations dose_ratio = 10 # a dose this many times above or below the typical dose is suspect ... rare_dose_fraction = 0.02 # ... when it is rarer than this fraction of the doses irregular_cv = 0.25 # coefficient of variation of the dosing intervals that counts as irregular # min_interval = 1 # shortest plausible interval between doses [observations] negative_ok = false # DV may be negative (PD, change from baseline) zero_ok = false # DV of 0 is genuine (not BLQ, not pre-dose) max_blq_fraction = 0.2 # fraction of BLQ observations above which to warn blq_tolerance = 0.000001 # relative tolerance when comparing DV with the LLOQ predose_tolerance = 0.0 # pre-dose concentrations up to this are accepted (endogenous compounds) min_per_individual = 2 # fewest observations of an individual outlier_k = 4.5 # outliers: robust z-score beyond this (MAD scale) at similar times after the dose ... outlier_min_fold = 3.0 # ... and at least this fold away from the typical value outlier_bins = 10 # time bins (equal counts) for the comparison outlier_min_n = 8 # fewest observations in a bin outlier_dose_normalise = true # compare concentrations per unit dose when there are several dose levels rebound_fold = 5.0 # spike: a value this many times above both neighbours sampling_bins = 0 # bins of the sampling-design table and plot (0 = automatic) [subjects] min_records = 2 # fewest records of an individual record_count_k = 5.0 # records per individual beyond this many robust SDs are reported (0 = off) time_varying_groups = [] # grouping columns allowed to change within an individual [covariates] columns = [] # the covariates to check (default: every column that is not a NONMEM # data item, a bookkeeping column or text) exclude = [] # columns that are never covariates categorical = [] # covariates to treat as categorical (default: whole numbers with few levels) continuous = [] # covariates to treat as continuous time_varying = [] # covariates that change within an individual max_levels = 12 # most levels of a covariate detected as categorical min_level_n = 3 # fewest individuals of a level before it is called rare max_missing_fraction = 0.0 # fraction of records of an individual that may lack a covariate value outlier_iqr = 3.0 # Tukey fences: beyond this multiple of the IQR from the quartiles (0 = off) collinearity_r = 0.8 # |r| (continuous) or Cramér's V (categorical) at which to warn check_derived = true # BMI and BSA against weight and height derived_tolerance = 0.1 # allowed relative difference max_relative_change = 0.5 # time-varying covariates: largest relative change between records (0 = off) time_varying_fraction = 0.5 # a covariate is time-varying when more than this fraction of the # individuals with several values have changing values [covariates.ranges] # Plausible ranges [low, high]; a value outside is reported. The covariates # named here are checked; an empty list ([]) removes a built-in range. AGE = [0, 120] WT = [0.3, 350] WGT = [0.3, 350] BW = [0.3, 350] HT = [20, 250] HGT = [20, 250] BMI = [8, 80] BSA = [0.05, 3.5] [covariates.levels] # Expected levels of categorical covariates; any other value is reported. # SEX = [0, 1] # RACE = [1, 2, 3, 4] [checks] skip = [] # check IDs or categories that are not run, e.g. ["REC13", "COV"] only = [] # run only these (IDs or categories); [] = all # categories: file header values records time dosing observations # subjects covariates nonmem, or the first three letters of the IDs: # FIL HDR VAL REC TIM DOS OBS SUB COV NMT [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" # Can the file be read, and does it have a header and at least one data record? # FIL02 = "error" # Is the file free of a byte-order mark (BOM) at its start? # FIL03 = "warning" # Is the file plain ASCII, without accented, typographic or other non-ASCII characters? # FIL04 = "warning" # Are the line endings the same on every line (no mix of CRLF and LF, no lone CR)? # FIL05 = "warning" # Is one field delimiter used throughout (not commas and tabs mixed)? # FIL06 = "warning" # Is the file free of blank lines between the records? # FIL07 = "error" # Does every data record begin with a number (no comment lines, text lines or flagged records)? # FIL08 = "error" # Does every record have as many fields as the header has columns? # FIL09 = "warning" # Are there no trailing or doubled delimiters (empty extra fields)? # FIL10 = "error" # Are the data fields free of quotation marks? # FIL11 = "warning" # Is every record shorter than the line-length limit? # FIL12 = "warning" # Does the last line end with a line terminator? # header — Header and column names # HDR01 = "error" # Are the required columns present (ID, TIME and DV by default)? # HDR02 = "warning" # Are the recommended NONMEM columns present (AMT, EVID, MDV and CMT by default)? # HDR03 = "error" # Is the first line a header of names (not numbers), with no blank names? # HDR04 = "error" # Are the column names unique, ignoring upper and lower case? # HDR05 = "error" # Are the column names valid NM-TRAN labels (letters, digits and underscore, beginning with a letter)? # HDR06 = "error" # Is every column name within the length limit (20 characters)? # HDR07 = "warning" # Are the column names free of NM-TRAN reserved words and abbreviated-code functions? # HDR08 = "warning" # Is the number of columns within the NM-TRAN limit (50 data items, DROP not counted)? # values — Values and data types # VAL01 = "error" # Are ID, TIME, DV, AMT, EVID, MDV, CMT, RATE, ADDL, II and SS numeric in every record? # VAL02 = "warning" # Are the other columns numeric, or text columns that you will DROP in $INPUT? # VAL03 = "error" # Are missing values written as blank or '.', and not as NA, NaN, NULL, N/A, - or similar? # VAL04 = "error" # Do the numbers use a decimal point (no decimal commas or thousands separators)? # VAL05 = "error" # Do ID and TIME have a value in every record? # VAL06 = "warning" # Are the numbers free of sentinel codes for 'missing' (-99, -999, ...)? # VAL07 = "warning" # Are all numbers finite and of a magnitude NONMEM handles (not above 1e10)? # VAL08 = "error" # Is every field at most 24 characters long (the NM-TRAN data item limit)? # VAL09 = "error" # Are the IDs whole numbers of at most 15 digits, and do different ID strings stay different as numbers? # VAL10 = "warning" # Is every column filled in at least once (no completely empty columns)? # records — Records and NONMEM data items # REC01 = "error" # Is EVID 0, 1, 2, 3 or 4 in every record? # REC02 = "error" # Is MDV 0 or 1 in every record? # REC03 = "error" # Is MDV consistent with EVID (MDV = 1 on every record that is not an observation)? # REC04 = "error" # Does every observation record (EVID 0, MDV 0) have a DV? # REC05 = "comment" # Which observations are excluded on purpose (EVID 0 with MDV 1)? # REC06 = "warning" # Do dose and other-event records have no DV (blank, '.' or 0)? # REC07 = "warning" # Does every dose record (EVID 1 or 4) have a positive AMT? # REC08 = "error" # Are AMT and II non-negative, RATE 0 or above (or -1, -2), and ADDL a non-negative whole number? # REC09 = "error" # Do observation records (EVID 0) have no dose amount? # REC10 = "error" # Is CMT a whole number within the range of compartments (|CMT| at most 99)? # REC11 = "comment" # Which compartments receive the doses and which are observed, and is CMT given on every record when it is used? # REC12 = "error" # Is RATE positive only on dose records with a positive AMT? # REC13 = "warning" # Are the infusion durations (AMT / RATE) within the limits you set? # REC14 = "error" # Does ADDL > 0 come with II > 0, and is II > 0 used with ADDL or SS? # REC15 = "error" # Are ADDL, II and SS used on dose records only? # REC16 = "error" # Is SS one of 0, 1, 2, 3, and is SS > 0 on a dose record with II > 0? # REC17 = "warning" # Are there no duplicated records (all fields identical; doses are checked by REC19)? # REC18 = "warning" # Are there no two observations of one individual at one time and compartment with different DV? # REC19 = "warning" # Are there no two doses of one individual at one time and compartment (a double dose)? # REC20 = "comment" # Which reset and other-type events (EVID 2, 3, 4) are in the data? # time — Time # TIM01 = "error" # Is TIME non-decreasing within each individual (a lower time only on a reset record)? # TIM02 = "error" # Are the records of each ID together in one block (no ID reappears after another)? # TIM03 = "warning" # Is TIME free of negative values? # TIM04 = "warning" # Is the largest TIME plausible for the time unit (below the limit you set)? # TIM05 = "comment" # Which observations share a time with a dose of the same individual, and do they come before or after the dose? # TIM06 = "warning" # Is the time between consecutive records of an individual below the gap limit you set? # TIM07 = "warning" # Does the TAD column equal the time since the latest dose? # TIM08 = "warning" # Is the actual TIME close to the nominal time? # TIM09 = "comment" # Which observations come before the first dose of the individual? # dosing — Dosing # DOS01 = "warning" # Does every individual with observations have at least one dose record? # DOS02 = "warning" # Does every individual with a dose have at least one observation? # DOS03 = "warning" # Is the first dose of each individual at TIME 0? # DOS04 = "comment" # Does the dose amount stay the same within each individual? # DOS05 = "warning" # Are all dose amounts near the usual dose levels (no unit slips of 10 times or more)? # DOS06 = "comment" # Are the dosing intervals regular within each individual? # DOS07 = "comment" # What are the dose levels, routes (compartments) and regimens? # observations — Observations # OBS01 = "error" # Does the dataset have observation records? # OBS02 = "warning" # Is DV free of negative values? # OBS03 = "warning" # Are the DV values of 0 explained (before the first dose or flagged as BLQ)? # OBS04 = "warning" # Are BLQ observations handled consistently (flag agrees with the LLOQ, one imputation rule)? # OBS05 = "warning" # Is the fraction of BLQ observations below the limit you set? # OBS06 = "warning" # Are there concentrations far from those of other individuals at similar times after the dose? # OBS07 = "warning" # Are there isolated spikes within an individual's profile (a value far above both neighbours after the peak)? # OBS08 = "warning" # Are the concentrations before the first dose zero or below the quantification limit? # OBS09 = "warning" # Does every individual have at least the minimum number of observations? # OBS10 = "warning" # Does every individual have at least one quantifiable concentration after the first dose? # OBS11 = "warning" # Is the scale of DV as declared (natural concentrations or their logarithm)? # OBS12 = "comment" # Which observation types are present (DVID or compartment) and how many records has each? # OBS13 = "comment" # What is the sampling design (observations per individual and times after the dose)? # subjects — Individuals # SUB01 = "comment" # How many individuals, records, doses and observations does the dataset have? # SUB02 = "warning" # Does every individual have more than one record? # SUB03 = "warning" # Do the grouping columns stay constant within each individual? # SUB04 = "warning" # Is the number of records per individual free of extreme values? # SUB05 = "warning" # Does every individual have at least one observation that is used (MDV 0)? # SUB06 = "comment" # Does every individual start with a dose or event record (not an observation)? # covariates — Covariates # COV01 = "comment" # Which covariates were examined, and are they continuous, categorical or time-varying? # COV02 = "warning" # Are the covariates free of missing values (blank, '.' or a sentinel code)? # COV03 = "warning" # Are the covariate values within plausible ranges? # COV04 = "warning" # Are the baseline covariates constant within each individual? # COV05 = "warning" # Do the categorical covariates have the expected levels, none of them rare? # COV06 = "warning" # Are the continuous covariates free of extreme values (beyond the Tukey fences)? # COV07 = "comment" # Is every covariate variable (more than one value)? # COV08 = "warning" # Are the continuous covariates free of strong pairwise correlation (|r| below the limit)? # COV09 = "warning" # Are derived covariates consistent with their parts (BMI and BSA from weight and height)? # COV10 = "warning" # Do the magnitudes of AGE, WT and HT suggest the usual units (years, kg, cm)? # COV11 = "warning" # Do time-varying covariates change plausibly between consecutive records? # nonmem — NONMEM readiness # NMT01 = "error" # Will the IGNORE option you plan to use skip the header line and nothing else? # NMT02 = "comment" # Which $DATA and $INPUT statements fit this file? # NMT03 = "comment" # Which special data items are used, and what do they require of the model? [output] # directory = "pk_qc_data" # default: /_qc_data html = true # report.html: verdict, checklist, findings, tables, figures json = true # qc_summary.json tables = true # qc_columns.csv, qc_subjects.csv, qc_dosing.csv, qc_sampling.csv, # qc_events.csv and the covariate tables flagged_dataset = false # qc_flagged_data.csv: the dataset with a QC_FLAG column per record nonmem_statements = true # qc_nonmem.txt: suggested $INPUT and $DATA max_findings = 1000 # findings kept per check examples = 5 # findings quoted in the checklist comment fail_on = "never" # never | error | warning: the exit status is 7 when the data have # an error (or a warning) finding, for scripts and pipelines [figures] concentration = true # all concentration-time profiles, dose-normalised by dose level concentration_yscale = "log" # log | linear max_profiles = 0 # draw at most this many profiles (0 = all) sampling = true # sampling times after the dose swimmer = true # one line per individual: doses, observations, BLQ, flagged records swimmer_per_page = 40 # individuals per page of the swimmer plot swimmer_max_pages = 10 # most pages drawn (0 = all); individuals with findings come first distributions = true # DV, observations per individual covariates = true # covariate distributions covariate_nrow = 3 # panels per page of the covariate plots: rows ... covariate_ncol = 3 # ... and columns correlation = true # correlation heat map of the continuous covariates missingness = true # missing values per covariate findings = true # findings per check [plots] # Figures of the analysis (plots/*.png), in the style of ggplot2's # theme_classic(). They are written by default; --no-plots turns them off. enabled = true # --no-plots width = 7 # --plot-width in `units` height = 5 # --plot-height units = "in" # --plot-units in | cm | mm | px dpi = 300 # --plot-dpi PNG resolution base_size = 11 # --plot-base-size base font size (points) format = "png" # --plot-format png | svg | both title = true # --plot-no-title turns it off legend = true # --plot-no-legend turns it off [plots.colors] # --plot-colors any #RRGGBB, #RGB or colour name # observed = "#000000" # observations in the swimmer plot # outer = "#2A78D6" # doses, histogram bars # median = "#EB6834" # additional doses (ADDL) # points = "#9E9E9E" # concentration profiles, BLQ and MDV = 1 records # outside = "#D62728" # rings around records with a warning or an error # reference = "#4D4D4D" # time span of an individual