Title: | Data Visualization Utilities for 'pyDarwin' Machine Learning Pharmacometric Model Development |
---|---|
Description: | Utilize the 'shiny' interface for visualizing results from a 'pyDarwin' (<https://certara.github.io/pyDarwin/>) machine learning pharmacometric model search. It generates Goodness-of-Fit plots and summary tables for selected models, allowing users to customize diagnostic outputs within the interface. The underlying R code for generating plots and tables can be extracted for use outside the interactive session. Model diagnostics can also be incorporated into an R Markdown document and rendered in various output formats. |
Authors: | James Craig [aut, cre], Michael Tomashevskiy [aut], Mike Talley [aut], Certara USA, Inc [cph, fnd] |
Maintainer: | James Craig <[email protected]> |
License: | LGPL-3 |
Version: | 2.0.1 |
Built: | 2025-03-08 05:39:31 UTC |
Source: | https://github.com/cran/Certara.DarwinReporter |
Initialize darwin data structure.
darwin_data( project_dir, working_dir = NULL, output_dir = NULL, key_models_dir = NULL, ... )
darwin_data( project_dir, working_dir = NULL, output_dir = NULL, key_models_dir = NULL, ... )
project_dir |
Directory containing input files for pyDarwin (e.g., options.json). |
working_dir |
Directory containing misc results folders generated from a pyDarwin search. This is the default location of the key_models, output, and temp folders. |
output_dir |
Directory containing output files such as "results.csv" and final control files.
Default location is inside |
key_models_dir |
Directory of the key_models folder. Default location is inside |
... |
Additional args. |
If working_dir
and output_dir
are sub directories of project_dir
, these arguments can be ignored.
The key_models_dir
is not required to initialize the darwin_data
object. If specified, however, key models data will
be imported which may take time given the number of key models and size of output tables. See import_key_models
.
Object of class darwin_data
.
Shiny application to generate, customize, and report diagnostic plots and tables from NLME or NONMEM output files. Create an Rmarkdown file of tagged model diagnostics and render into submission ready report.
darwinReportUI(darwin_data, tagged = NULL, settings = NULL, ...)
darwinReportUI(darwin_data, tagged = NULL, settings = NULL, ...)
darwin_data |
Object of class |
tagged |
List of tagged objects returned from previous |
settings |
List of settings (e.g., settings.Rds) returned from previous Shiny session. |
... |
Additional arguments for Pirana integration. |
If interactive()
, returns a list of tagged diagnostics from the Shiny application, otherwise returns TRUE
.
if (interactive()) { ddb <- darwin_data("./darwin_search_09") |> import_key_models("./darwin_search_09/key_models") darwinReportUI(ddb) }
if (interactive()) { ddb <- darwin_data("./darwin_search_09") |> import_key_models("./darwin_search_09/key_models") darwinReportUI(ddb) }
Plot minimum fitness by iteration with penalty composition.
fitness_penalties_vs_iteration( darwin_data, group_penalties = TRUE, scale_ofv = TRUE, ... )
fitness_penalties_vs_iteration( darwin_data, group_penalties = TRUE, scale_ofv = TRUE, ... )
darwin_data |
Object of class |
group_penalties |
Logical; defaults to |
scale_ofv |
Set to |
... |
Additional arguments. |
Object of class ggplot
.
Plot best fitness by iteration.
fitness_vs_iteration(darwin_data, ...)
fitness_vs_iteration(darwin_data, ...)
darwin_data |
Object of class |
... |
Additional arguments. |
Object of class ggplot
.
xpose_data
objectThis function returns eps shrinkage values from xpose_data
object as a data.frame
.
get_eps_shk(xpdb)
get_eps_shk(xpdb)
xpdb |
Object of class |
Returns an object of class data.frame
.
xpose_data
objectThis function returns eta shrinkage values from xpose_data
object as a data.frame
.
get_eta_shk(xpdb)
get_eta_shk(xpdb)
xpdb |
Object of class |
Returns an object of class data.frame
.
Use to create xpose data object from files in NLME or NONMEM key model output folders.
import_key_models(darwin_data, dir, ...)
import_key_models(darwin_data, dir, ...)
darwin_data |
Object of class |
dir |
File path to key models directory. |
... |
Additional args. |
Object of class darwin_data
.
if (interactive()) { ddb <- darwin_data(project_dir = "./darwin_search_09") |> import_key_models(dir = "./darwin_search_09/key_models") }
if (interactive()) { ddb <- darwin_data(project_dir = "./darwin_search_09") |> import_key_models(dir = "./darwin_search_09/key_models") }
Summarise minimum, cumulative minimum, and mean fitness values by pyDarwin search iteration/generation.
summarise_fitness_by_iteration(darwin_data)
summarise_fitness_by_iteration(darwin_data)
darwin_data |
Object of class |
data.frame
with columns iteration
,
min_fitness
, mean_fitness
, and min_cum_fitness
Summarise minimum fitness, ofv, and penalty values used in calculation of overall fitness values by pyDarwin search iteration/generation.
summarise_fitness_penalties_by_iteration(darwin_data, group_penalties = FALSE)
summarise_fitness_penalties_by_iteration(darwin_data, group_penalties = FALSE)
darwin_data |
Object of class |
group_penalties |
Logical. Set to |
data.frame
of columns "iteration", "fitness", "ofv"
and corresponding penalty columns.
Generate a summary data.frame
by key models, which includes columns
such as condition number, number of parameters, -2LL, AIC, BIC, fitness, and
penalty values.
summarise_overall_by_key_models(darwin_data)
summarise_overall_by_key_models(darwin_data)
darwin_data |
Object of class |
data.frame
A ggplot2 theme for Certara.
theme_certara( base_size = 11, base_family = "", base_line_size = base_size/22, base_rect_size = base_size/22, grid = c("none", "horizontal", "both"), ... )
theme_certara( base_size = 11, base_family = "", base_line_size = base_size/22, base_rect_size = base_size/22, grid = c("none", "horizontal", "both"), ... )
base_size |
base font size, given in pts. |
base_family |
base font family |
base_line_size |
base size for line elements |
base_rect_size |
base size for rect elements |
grid |
Which grid lines should appear? Horizontal only, both horizontal and vertical, or none (default).
|
... |
Additional args |
There are 3 variants of the theme: no grid
theme_certara()
, full grid theme_certara(grid = "both")
, and
horizontal grid lines only theme_certara(grid = "horizontal")
.
An object of class theme()
.