Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
41 changes: 41 additions & 0 deletions R/calc_treosulfan_success.R
Original file line number Diff line number Diff line change
@@ -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))
}
6 changes: 5 additions & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 43 additions & 0 deletions man/calc_treosulfan_success.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions tests/testthat/test-calc_treosulfan_success.R
Original file line number Diff line number Diff line change
@@ -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)
})