Download
Download the conc-QTc R functions v1.3.1 (latest)
Download the conc-QTc R functions v1.3
Download the conc-QTc R functions v1.2
Requirements
-
Quarto version 1.4 or above. Note that lower Quarto versions will generate documents with improperly rendered inline R code and table captions and cross-references.
-
MonolixSuite 2024R1 or above
-
lixoftConnectors 2024.1 or above
-
R packages: ggplot2, flextable, ggpubr, quarto
Functions overview
The R scripts provide a set of functions to perform a standard conc-QTc analysis from data preparation to report generation. The main functions are:
-
process_QTcData(): format an input dataset for analysis by averaging triplicates, extracting baseline values, calculating QTc, etc
-
generateAllQTcProjects(): generate Monolix projects to run a conc-QTC analysis using the standard linear model as well as alternative non-linear models
-
quarto_render(input = "../_mlxQTcTools/QTc_quarto_allModels.qmd"): generate a report (e.g as Word document) using a Quatro template. The report contains exploratory data analysis plots, assessment of key modeling hypotheses, and modeling results.
See the detailed documentation of each function.
Using the R scripts
The code is open and can be adjusted to the users needs. In order to use the code, download the .zip file, and unzip it to a convenient location. Note that MonolixSuite and the lixoftConnectors R package must be installed as well. Before calling the functions, the mlxQTcTools.R file should be sourced. See the examples for more details.
source('path_to_unzipped_location/_mlxQTcTools/mlxQTcTools.R')
Included files
The .zip is organized in the following way:
-
_mlxQTcTools: contains the scripts to run the analysis
-
mlxQTcTools.R: contains the functions process_QTcData() and generateAllQTcProjects(), as well as auxiliary functions.
-
mlxReportingTools.R: contains auxiliary functions to generate the Quarto report
-
QTc_quarto_allModels.qmd: Quarto template for the report
-
models: contains the structural models to create Monolix projects in case of ΔQTc and ΔΔQTc with no effect, linear, Emax, Hill, or Logarithmic effect, with or wihtout effect compartment to create a delay.
-
-
Example_XXX: one folder per example dataset
Change log
Version 1.3.1 (lastest version)
-
Bug fix: in case of additional factors in the model, the observations in the plot “ΔQTc predictions vs drug concentration” (figure 23 of the report) are now corrected for both the time effect and the effect of the additional factor. In version 1.3, only the time effects were substracted.
-
Bug fix: in case of additional factors in the model, they are now included in the parameter estimates table
Version 1.3
-
support of datasets without placebo
-
support of datasets with time-matched baseline (in addition to predose baseline which was already supported)
-
support of additional categorical variables in the linear model, for instance to handle data over multiple days and add a "day" factor
-
support of additional variable used for stratification of plots in the report
-
population QT correction with estimated coefficient
-
for models with delay, added a security on the tau0 parameter and changed to stiff ODE solver
-
added correlations between random effects for dQTc models, to implement an unstructured covariance matrix
-
replaced the inline r code syntax from
`{r}`to`r`to support Quarto versions before 1.4 -
improved loadProject() check to handle different output types (NULL or logical) in different lixoftConnectors versions
-
fixed a typo in the formatted dataset name for the Dofetilide example
-
added examples for time-matched datasets and datasets over multiple days
Version 1.2
-
replaced .csl file referring to online website for bibliography style by self-contained .csl file which does not require internet access
-
improved the check leading to the error "There must be at least a Monolix run named ddQTc_Linear.mlxtran in the folder” on linux system due to different behavior of file.exists() in windows and linux
-
improved the error message "The Monolix run ddQTc_Linear.mlxtran could not be loaded." to explain possible reasons
-
improved the check leading to "The Monolix run ddQTc_Linear.mlxtran could not be loaded." to handle loadProject() returning either NULL or a logical depending on the MonolixSuite versions
-
added a check if connectors are not initialized with version 2024 in the .qmd file