# nlmx custom: plots and tables of any dataset, on the fly. # # The data can be any delimited text, normally with a header: a CSV, a NONMEM table # (sdtab101), a .ext or .phi file, or a CSV written by another nlmx command # (sims metrics, NCA parameters, predictions.csv). # # nlmx custom data.csv -c study.custom # # Everything here can also be given on the command line (nlmx custom --help # lists the options under "Custom"); the command line wins over this file. # Lines that start with "#|" are examples: remove the "#|" to use them. # # Plots are written to /plots/.png (SVG with `--svg` or # format = "both" in [plots]); tables to /tables/.csv, .md and # .html. An R expression can be used wherever a column is named, for example # x = "log(CONC)" or color = "factor(DOSE)" (factor() makes the colours # discrete; a number with at most 12 different whole values is discrete # anyway; continuous(COL) forces a gradient). [data] # file = "sdtab101" # the dataset (or give it on the command line) delimiter = "auto" # auto | comma | semicolon | tab | space skip = 0 # lines to ignore at the top (a title line above the names, ...) header = true # false: no column names in the file; the columns are A, B, C, ... # The data steps, in this order: mutate, filter, distinct, sort, head, select. # mutate = ["LNDV = log(DV)", "OBESE = ifelse(WT > 100, 1, 0)"] # R syntax # filter = "EVID == 0 & DV > 0" # keep these rows # distinct = ["ID"] # the first row of each ID (a subject-level table) # sort = ["ID", "-TIME"] # a leading - sorts downwards # head = 100 # only the first rows # select = ["ID", "TIME", "DV", "PRED"] [output] # directory = "custom_out" # default: /_custom csv = true # tables as CSV markdown = true # tables as Markdown html = true # tables as HTML tables = true # false: no tables at all json = true # custom_summary.json digits = 3 # significant digits in the tables settings_file = true # custom_settings.custom: this run as a settings file (--no-settings-file) [plots] # Size and format of every plot (command line: --plot-width, --plot-height, # --plot-units, --plot-dpi, --plot-base-size, --plot-format). # width = 7 # height = 5 # units = "in" # in | cm | mm | px # dpi = 300 # base_size = 11 # font size in points # format = "png" # png | svg | both # enabled = true # false: tables only [style] # Defaults for every plot that does not set its own. # theme = "classic" # classic | bw | minimal | gray # palette = "okabe-ito" # okabe-ito | tableau | set1 | dark2 | pastel | viridis | grey, # or a list of colours "#0072B2,#D55E00", or LEVEL=colour pairs # legend_position = "right" # right | left | bottom | top | none # seed = 11456 # jitter # ------------------------------------------------------------------ plots # One [[plot]] table per plot. geom is one geom or a list that is layered: # point jitter line path step smooth boxplot violin bar col histogram # density area ecdf qq errorbar pointrange tile text (nlmx custom --list-plots) # #| [[plot]] #| name = "dv_vs_pred" #| geom = ["point", "smooth"] #| x = "PRED" #| y = "DV" #| color = "factor(DOSE)" # a column, an expression, or a constant colour ("red") #| identity = true # the line y = x #| equal_axes = true #| title = "Observed against population predicted" #| x_title = "PRED (mg/L)" #| y_title = "DV (mg/L)" #| facet_cols = ["SEX"] # facet_grid(. ~ SEX); facet_rows = ["DOSE"] is DOSE ~ . #| x_scale = "log" # linear | log #| y_scale = "log" #| #| [[plot]] #| name = "cwres_by_time" #| geom = "point" #| x = "TIME" #| y = "CWRES" #| hline = [0, -2, 2] #| facet = ["STUDY"] # facet_wrap; facet_ncol / facet_nrow set the grid #| facet_scales = "free_x" # fixed | free | free_x | free_y #| alpha = 0.4 #| #| [[plot]] #| name = "wt_by_sex" #| geom = ["violin", "boxplot"] #| x = "SEX" #| y = "WT" #| fill = "SEX" #| distinct = ["ID"] # data steps for this plot only #| #| [[plot]] #| name = "mean_profile" #| geom = ["line", "point", "errorbar"] #| x = "NTIM" #| y = "DV" #| color = "factor(DOSE)" #| summary_fun = "mean" # mean | median | sum | min | max | n | sd | geomean | q1 | q3 #| summary_error = "sd" # sd | se | ci95 | iqr | range | none #| #| [[plot]] #| name = "age_histogram" #| geom = "histogram" #| x = "AGE" #| nbins = 20 # or binwidth = 5 #| fill = "SEX" #| position = "stack" # stack | dodge | fill | identity #| y_stat = "count" # count | density | percent # Other plot settings (the same names work as --option on the command line, with # dashes: border_color -> --border-color): # text subtitle, caption, legend_title, legend_position, x_title, y_title, # color_title / fill_title / shape_title / size_title / linetype_title # (a legend title for one aesthetic; they win over legend_title) # aesthetics shape, size, linetype, group, label, alpha, line_width, na_color # outlines border_color ("none" = no outline), border_width (1 = normal, # 0 = none) for bars, boxes, violins, histograms, areas, density, # tiles and legend keys; stroke_color, stroke_width for the ring # around points # axes xlim, ylim (e.g. "0,100" or ",50"), x_breaks, y_breaks (tick # positions), x_angle, flip, equal_axes # reference hline, vline, abline = [intercept, slope, ...], identity, # lines ref_color, ref_linetype, ref_width # geoms jitter, smooth_method (loess | lm), smooth_se, span, smooth_level, # band_alpha, bar_width, outliers (false: hide box outliers), # text_size (labels), summary_fun, summary_error # look theme, palette, plot_background, panel_background, grid_color # ("none" = no grid), title_size, axis_title_size, axis_text_size, # legend_text_size, strip_text_size, title_align (left | center | right) # size width / height / units / base_size for this plot only # facets facet_labels ("value" | "both"), facet_scales, facet_ncol, facet_nrow # Table settings: rename = ["old=new"], hide = ["column"], na_text, decimals (fixed # number of decimals, instead of digits significant), percent_digits, transpose. # ----------------------------------------------------------------- tables # One [[table]] table per table. kind is one of # listing summary demographics frequency pivot correlation (--list-plots) # #| [[table]] #| name = "demographics" #| kind = "demographics" #| title = "Baseline characteristics" #| distinct = ["ID"] # one row per subject #| vars = ["AGE", "WT", "SEX", "RACE"] #| by = ["DOSE"] # one column per dose, plus an overall column #| stats = ["n", "mean_sd", "median_range"] #| categorical = ["SEX"] # force a number to be a category #| #| [[table]] #| name = "pk_summary" #| kind = "summary" #| vars = ["CMAX", "AUC"] #| by = ["DOSE"] #| stats = ["n", "geomean", "geocv", "median", "min", "max"] #| #| [[table]] #| name = "n_by_arm" #| kind = "frequency" #| distinct = ["ID"] #| rows = ["DOSE"] #| columns = ["SEX"] #| percent = "row" # none | row | column | total #| #| [[table]] #| name = "mean_dv" #| kind = "pivot" #| rows = ["NTIM"] #| columns = ["DOSE"] #| value = "DV" #| fun = "geomean" #| #| [[table]] #| name = "cov_cor" #| kind = "correlation" #| vars = ["AGE", "WT", "CRCL"] #| method = "spearman"