diff --git a/NAMESPACE b/NAMESPACE index 5f99634..caf22c6 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -27,6 +27,7 @@ export(calc_kgfr) export(calc_lbw) export(calc_neutropenia_grade) export(calc_t12) +export(calc_treosulfan_success) export(check_covs_available) export(cm2inch) export(conc2mol) diff --git a/NEWS.md b/NEWS.md index fd53268..b98a9b1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,11 @@ -# clinPK 0.14.0 +# clinPK 0.14.0 (development version) ## Major changes - Refactored `pct_*_for_*()` functions. As input, they now accept vectors of values. They now return either a vector of percentiles for the given physical measurement, or a data frame with the observed percentile for the given physical measurement, along with a select distribution of physical measurements at particular percentiles. These functions also use updated CDC growth charts instead of WHO growth charts. - Added `median_*_for_*()` functions for calculating median growth values for infants and children. These functions replace the now-deprecated `return_median` argument in the `pct_*_for_*()` functions. - Added CDC growth chart data sets as package data (see `?"growth-charts"`). - Removed `read_who_table()` function, as part of the refactor for the `pct_*_for_*()` functions. +- Added `calc_treosulfan_success()` function. ## Minor updates - Activated roxygen's markdown parser for improved function documentation diff --git a/R/calc_treosulfan_success.R b/R/calc_treosulfan_success.R new file mode 100644 index 0000000..ba4b54b --- /dev/null +++ b/R/calc_treosulfan_success.R @@ -0,0 +1,41 @@ +#' Calculate probability of therapeutic success for treosulfan +#' +#' Calculate probability of therapeutic success for treosulfan as a function of +#' cumulative AUC. This model was based on a data set of children receiving +#' treosulfan once daily for 3 days and may not correspond to other dosing +#' intervals or patient populations. +#' +#' @note +#' The parameter estimates used in this function match Figure 3a in the cited +#' paper, but differ slightly from the values provided in Table 2, which were +#' rounded. The decimal values used here were solved for using results cited in +#' the paper, and are close but not an exact match. +#' +#' @param cumulative_auc Cumulative AUC mg hour/L. +#' +#' @references \href{https://doi.org/10.1002/cpt.1715}{ +#' Chiesa et al., Clinical Pharmacology and Therapeutics (2020)} +#' +#' @returns Probability of therapeutic success for treosulfan. +#' @export +#' +#' @examples +#' calc_treosulfan_success(c(3863, 4800, 4829, 6037)) +#' +#' curve( +#' calc_treosulfan_success, +#' from = 2000, +#' to = 15000, +#' log = "x", +#' ylim = c(0, 1), +#' xlab = "Cumulative AUC", +#' ylab = "P(Success)" +#' ) +calc_treosulfan_success <- function(cumulative_auc) { + b0 <- -138 + b1 <- 32.66303 + b2 <- -1.925343 + log_auc <- log(cumulative_auc) + x <- b0 + b1*log_auc + b2*log_auc^2 + 1 - exp(-exp(x)) +} diff --git a/_pkgdown.yml b/_pkgdown.yml index 06767f9..4081e0e 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -93,13 +93,17 @@ reference: - pk_1cmt_inf_dose_for_range - dose2auc - auc2dose + - title: Probability calculations + desc: Functions to calculate outcome probabilities. + contents: + - calc_cefepime_neurotoxicity + - calc_treosulfan_success - title: Miscellaneous functions contents: - nca - egfr_cov_reqs - check_covs_available - calc_carboplatin_calvert - - calc_cefepime_neurotoxicity - calc_kel_single_tdm - calc_kel_double_tdm - calc_t12 diff --git a/man/calc_treosulfan_success.Rd b/man/calc_treosulfan_success.Rd new file mode 100644 index 0000000..bceb6e4 --- /dev/null +++ b/man/calc_treosulfan_success.Rd @@ -0,0 +1,43 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/calc_treosulfan_success.R +\name{calc_treosulfan_success} +\alias{calc_treosulfan_success} +\title{Calculate probability of therapeutic success for treosulfan} +\usage{ +calc_treosulfan_success(cumulative_auc) +} +\arguments{ +\item{cumulative_auc}{Cumulative AUC mg hour/L.} +} +\value{ +Probability of therapeutic success for treosulfan. +} +\description{ +Calculate probability of therapeutic success for treosulfan as a function of +cumulative AUC. This model was based on a data set of children receiving +treosulfan once daily for 3 days and may not correspond to other dosing +intervals or patient populations. +} +\note{ +The parameter estimates used in this function match Figure 3a in the cited +paper, but differ slightly from the values provided in Table 2, which were +rounded. The decimal values used here were solved for using results cited in +the paper, and are close but not an exact match. +} +\examples{ +calc_treosulfan_success(c(3863, 4800, 4829, 6037)) + +curve( + calc_treosulfan_success, + from = 2000, + to = 15000, + log = "x", + ylim = c(0, 1), + xlab = "Cumulative AUC", + ylab = "P(Success)" +) +} +\references{ +\href{https://doi.org/10.1002/cpt.1715}{ +Chiesa et al., Clinical Pharmacology and Therapeutics (2020)} +} diff --git a/tests/testthat/test-calc_treosulfan_success.R b/tests/testthat/test-calc_treosulfan_success.R new file mode 100644 index 0000000..a6cd622 --- /dev/null +++ b/tests/testthat/test-calc_treosulfan_success.R @@ -0,0 +1,6 @@ +test_that("treatment success calculation is correct", { + expect_equal(signif(calc_treosulfan_success(3863), 2), .79) # reported as .78 in paper + expect_equal(signif(calc_treosulfan_success(4800), 2), .82) + expect_equal(signif(calc_treosulfan_success(4829), 2), .82) + expect_equal(signif(calc_treosulfan_success(6037), 2), .79) +})