knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

pksensi pksensi logo

lifecycle R-CMD-check Codecov test coverage CRAN downloads

pksensi implements the global sensitivity analysis workflow to investigate the parameter uncertainty and sensitivity in physiologically based kinetic (PK) models, especially the physiologically based pharmacokinetic/toxicokinetic model with multivariate outputs. The package also provides some functions to check the convergence and sensitivity of model parameters.

Through pksensi, you can:

Installation

You can install the released version of pksensi from CRAN with:

install.packages("pksensi")

And the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("nanhung/pksensi")

Workflow

Workflow of sensitivity analysis

Note: The parameter correlation (e.g., V~max~ and K~M~ in metabolism) might be an issue in the global sensitivity analysis. If you have experiment data, suggest using small datasets as a sample in Markov Chain Monte Carlo Simulation. Then, check correlation before conducting the sensitivity analysis. The issue will try to address in the future version.

Example

This is a basic example of applying pksensi in one-compartment pbtk model:

library(pksensi)

Step 1. Construct 1-cpt pbtk model

pbtk1cpt <- function(t, state, parameters) {
  with(as.list(c(state, parameters)), {
    dAgutlument = - kgutabs * Agutlument
    dAcompartment = kgutabs * Agutlument - ke * Acompartment
    dAmetabolized = ke * Acompartment
    Ccompartment = Acompartment / vdist * BW;
    list(c(dAgutlument, dAcompartment, dAmetabolized), 
         "Ccompartment" = Ccompartment) 
  })
}

Step 2. Define initial conditions, output time steps and variable

initState <- c(Agutlument = 10, Acompartment = 0, Ametabolized = 0)
t <- seq(from = 0.01, to = 24.01, by = 1)
outputs <- c("Ccompartment")

Step 3. Generate parameter matrix

3.1. (Optional) Extract parameter value from httk package

library(httk)
pars1comp <- (parameterize_1comp(chem.name = "acetaminophen"))

3.2. Set parameter distributions

q <- c("qunif", "qunif", "qunif", "qnorm")
q.arg <- list(list(min = pars1comp$Vdist / 2, max = pars1comp$Vdist * 2),
              list(min = pars1comp$kelim / 2, max = pars1comp$kelim * 2),
              list(min = pars1comp$kgutabs / 2, max = pars1comp$kgutabs * 2),
              list(mean = pars1comp$BW, sd = 5))

3.3. Create parameter matrix

set.seed(1234)
params <- c("vdist", "ke", "kgutabs", "BW")
x <- rfast99(params, n = 200, q = q, q.arg = q.arg, replicate = 1)

Step 4. Conduct simulation (will take few minutes with more replications)

out <- solve_fun(x, time = t, func = pbtk1cpt, initState = initState, outnames = outputs)

Step 5. Uncertainty analysis

pksim(out)  # Use to compare with "real" data (if any)

Step 6. Check and visualize the result of sensitivity analysis

plot(out)   # Visualize result
check(out)  # Print result to console

Citation

citation(package = "pksensi")

Reference

Hsieh NH, Reisfeld B, Bois FY, Chiu WA. Applying a global sensitivity analysis workflow to improve the computational efficiencies in physiologically-based pharmacokinetic modeling. Frontiers in Pharmacology 2018 Jun; 9:588.

Hsieh NH, Reisfeld B, Chiu WA. pksensi: An R package to apply global sensitivity analysis in physiologically based kinetic modeling. SoftwareX 2020 Jul; 12:100609.

Hsieh NH, Bois FY, Tsakalozou E, Ni Z, Yoon M, Sun W, Klein M, Reisfeld B, Chiu WA. A Bayesian population physiologically based pharmacokinetic absorption modeling approach to support generic drug development: application to bupropion hydrochloride oral dosage forms. Journal of Pharmacokinetics and Pharmacodynamics 2021 Sep; 22:1-6.



nanhung/pksensi documentation built on Dec. 2, 2024, 3:52 a.m.