MonolixSuite in R
Breadcrumbs

Report QTc_quarto_allModels.qmd

Purpose

This quarto template allows to generate a conc-QTc analysis report in Word format containing the key figures and tables for:

  • exploratory data analysis

  • assessment of model assumptions

  • modeling results and diagnostics

  • model-derived ΔΔQTc prediction at concentrations of interest.

This template can be further customized by the user if needed.

Details

The function requires to have at least one Monolix run named dQTc_Linear.mlxtran (for ΔQTc) or ddQTc_Linear.mlxtran (for ΔΔQTc).

Using this run as a basis, the quarto template will extract the dataset information and generate a data summary, exploratory data analysis plots (for QT, QTc and the drug concentration), as well as plots to assess the model assumptions (no drug effect on the heart rate, QTc independent of HR, linear conc-ΔQTc relationship, no time delay between the drug and ΔQTc), following the guidelines of the Garnett et al. white paper.

To investigate the presence of a delay, the goodness of fit (BICc) of the standard linear model will be compared to that of a model with an effect compartment to capture a potential delay. If the model with delay is more appropriate, it is strongly recommended to develop a joint PK-QTc model (see the Vanoxerine case study).

In the absence of a delay, all Monolix runs present in the folder are compared and the model with lowest BICc and no infinite RSEs is selected as the best model. For the best model, parameters estimates are presented in a table overview and typical diagnostic plots are generated (Obs vs Pred, VPC vs time and concentration, distribution of residuals, scatterplot of residuals).

In the last section, the best model is used to generate the model-predicted ΔΔQTc and its 90% confidence interval. In case of ΔQTc, model-derived ΔΔQTc is obtained as ΔΔQTc = ΔQTc(treatment, conc) - ΔQTc(placebo, conc=0), as suggested in Garnett et al. In case of ΔΔQTc, it is obtained directly from the model by setting the adjusted baseline covariate effect to zero. The 90% confidence interval is derived using 500 samples from the estimated population parameter uncertainty distribution (i.e the Fisher information matrix), to be applicable to both linear and non-linear models.

The appendix compares the parameter estimates and model-derived (Δ)ΔQTc for all models, and lists the Monolix project file content and summary output file.

Arguments

The Word report is generated using the quarto_render() function, which has the following input arguments:

  • input (character): path to the QTc_quarto_allModels.qmd template file (if relative path, from the R working directory) Mandatory

  • output_file (character): name of the generated Word document with .docs extension. Mandatory

  • execute_params (list): list of input arguments for the quarto template

    • folderName (character): relative path from the quarto template to the folder containing the Monolix projects. There must be at least one Monolix project named dQTc_Linear.mlxtran or ddQTc_Linear.mlxtran in that folder. Mandatory

    • compoundName (character): name of the drug compound to be used in the report. Mandatory

    • CONCcolumn (character): name of the dataset column containing the drug concentration. Mandatory

    • TRTcolumn (character): name of the dataset column containing the treatment group. This column must have been indicated in the “TRTname” argument when using the generateAllQTcProject() or generateQTcProject() functions. Optional

    • STRATcolumn (character): name of the dataset column containing the variable to be used to stratify plots. This column must have been indicated in the “addStratCatCov” argument when using the generateAllQTcProject() or generateQTcProject() functions. Optional

    • STRATname (character): name of the stratification variable to be used in tables (default: “treatment”). Optional

    • bHasPlacebo (logical): use “true” (default) if the dataset contains placebo data, and “false” otherwise. Optional (default: true)

    • placeboName (character): name of the category of the TRTcolumn that corresponds to placebo. Mandatory if bHasPlacebo=T, ignored otherwise.

    • concentrationLabel (character): label for concentration on plots. Default: “Concentration” Optional.

    • concentrationUnit (character): units of the concentration column, to be used on plots. Default: “ng/mL”. Optional

    • studyType (character): either “dQTc” or “ddQTc”. Default: “dQTc”. Optional

    • nBins (integer): number of bins used to bin the concentration or RR values in plots. Default: 10. Optional

    • orderTRT (vector of characters): vector listing the categories present in the “TRTcolumn” column in the specific order to be used in plots and tables. If not provided, the alphabetical order will be used. Optional

    • orderSTRAT (vector of characters): vector listing the categories present in the “STRATcolumn” column in the specific order to be used in plots and tables. If not provided, the alphabetical order will be used. Optional

    • thresBICc (numeric): threshold of BICc improvement to select another than the linear model. Default: 0. Optional

Examples

Example 1

This example shows how to generate a report for the Dofetilide dataset which contains placebo and active treatment periods for all individuals. Note that the input argument is a relative path from the R working directory to the QTc_quarto_allModels.qmd file location, but that the folderName argument is the relative path from the .qmd file to the folder containing the Monolix runs. To specify that a ΔQTc analysis was run, we use studyType = "dQTc", and the presence of placebo data is indicated with bHasPlacebo = T and placeboName = "Placebo". The datasets columns containing the concentration data and the treatment information (placebo versus dofetilide) are given with CONCcolumn = "CONC" and TRTcolumn = "EXTRT". To control the order in which the categories of the TRT column appear in plot legends, we indicate orderTRT = c("Placebo", "Dofetilide"). The arguments compoundName = "Dofetilide", STRATname = "Treatment", concentrationLabel = "Concentration" and concentrationUnit = "pg/mL" control the labels used in the text, tables and plots of the report. Note that when a TRTcolumn is given, it is used as stratification variable such that STRATname applies to the TRT column in this example. Finally, nBins = 10 controls the number of bins when the concentration or RR data is binned and thresBICc = 0 controls the BICc improvement needed to consider that a model is better than the linear model.

quarto::quarto_render(input = "../_mlxQTcTools/QTc_quarto_allModels.qmd",
    output_file = "Dofetilide_dQTc_report.docx",
    execute_params = list(folderName = "../Example_Dofetilide/mlx_runs", 
                          compoundName = "Dofetilide",
                          CONCcolumn = "CONC",
                          TRTcolumn = "EXTRT",
                          STRATname = "Treatment",
                          bHasPlacebo = T,
                          placeboName = "Placebo",
                          studyType = "dQTc",
                          concentrationLabel = "Concentration",
                          concentrationUnit = "pg/mL",
                          nBins = 10,
                          orderTRT = c("Placebo", "Dofetilide"),
                          thresBICc = 0))

Example 2

If the best model is not the linear model, but you want to enforced using the linear model, set the thresBICc to a high value such that the BICc difference between the linear and the other models will never be bigger than the threshold. For instance, set thresBICc = 10000.

quarto::quarto_render(input = "../_mlxQTcTools/QTc_quarto_allModels.qmd",
    output_file = "Dofetilide_dQTc_report.docx",
    execute_params = list(folderName = "../Example_Dofetilide/mlx_runs", 
                          compoundName = "Dofetilide",
                          CONCcolumn = "CONC",
                          TRTcolumn = "EXTRT",
                          STRATname = "Treatment",
                          bHasPlacebo = T,
                          placeboName = "Placebo",
                          studyType = "dQTc",
                          concentrationLabel = "Concentration",
                          concentrationUnit = "pg/mL",
                          nBins = 10,
                          orderTRT = c("Placebo", "Dofetilide"),
                          thresBICc = 10000))

Example 3

If you don’t have a TRT column (typically because you don’t have placebo data) but you want to use another column to stratify the tables and plots in the report (e.g the day), set STRATcolumn = "DAY". Note that this column must have been indicated in the “addStratCatCov” argument when using the generateAllQTcProject() or generateQTcProject() functions. How this variable will be named is indicated via STRATname = "Study day". To control the order in which the categories present in the STRAT column appear, specify the order with orderSTRAT = c("Day 1", "Day 7", "Day 14").

quarto::quarto_render(input = "../_mlxQTcTools/QTc_quarto_allModels.qmd",
    output_file = "MultiDose_dQTc_report.docx",
    execute_params = list(folderName = "../Example_MultiDose/mlx_runs", 
                          compoundName = "LIX1234",
                          CONCcolumn = "CONC",
                          TRTcolumn = NULL,
                          STRATcolumn = "DAY",
                          STRATname = "Study day",
                          bHasPlacebo = F,
                          studyType = "dQTc",
                          concentrationLabel = "Concentration",
                          concentrationUnit = "pg/mL",
                          nBins = 10,
                          orderSTRAT = c("Day 1", "Day 7", "Day 14"),
                          thresBICc = 0))