-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
163 lines (120 loc) · 5.09 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
set.seed(1)
```
# posologyr [<img src="man/figures/logo_120.png" align="right" />](https://github.com/levenc/posologyr/)
<!-- badges: start -->
[](https://github.com/levenc/posologyr/actions/workflows/R-CMD-check.yaml)
[](https://CRAN.R-project.org/package=posologyr)
<!-- badges: end -->
## Overview
Personalize drug regimens using individual pharmacokinetic (PK) and pharmacokinetic-pharmacodynamic (PK-PD) profiles. By combining therapeutic drug monitoring (TDM) data with a population model, `posologyr` offers accurate posterior estimates and helps compute optimal individualized dosing regimens.
Key dosage optimization functions in `posologyr` include:
+ `poso_dose_conc()` estimates the optimal dose to achieve a target concentration at any given time
+ `poso_dose_auc()` estimates the dose needed to reach a target area under the concentration-time curve (AUC)
+ `poso_time_cmin()` estimates the time required to reach a target trough concentration (Cmin)
+ `poso_inter_cmin()` estimates the optimal dosing interval to consistently achieve a target Cmin
Individual PK profiles can be estimated with or without TDM data:
+ `poso_estim_map()` computes Maximum A Posteriori Bayesian Estimates (MAP-BE) of individual PK parameters using TDM results
+ `poso_simu_pop()` samples from the the prior distributions of PK parameters
`posologyr` leverages the simulation capabilities of the
[rxode2](https://github.com/nlmixr2/rxode2) package.
## Installation
You can install the released version of `posologyr` from
[CRAN](https://CRAN.R-project.org) with:
``` {r eval = FALSE}
install.packages("posologyr")
```
You can install the development version of `posologyr` from
[GitHub](https://github.com/) with:
```{r eval = FALSE}
# install.packages("remotes")
remotes::install_github("levenc/posologyr")
```
## Bayesian dosing example
To determine the optimal dose of gentamicin for a patient with `posologyr`, you will need:
1. A prior PK model, written in `rxode2` mini-language
In this example, a gentamicin PK from the literature <doi:10.1016/j.ijantimicag.2003.07.010>
```{r}
mod_gentamicin_Xuan2003 <- function() {
ini({
THETA_Cl = 0.047
THETA_V = 0.28
THETA_k12 = 0.092
THETA_k21 = 0.071
ETA_Cl ~ 0.084
ETA_V ~ 0.003
ETA_k12 ~ 0.398
ETA_k21 ~ 0.342
add_sd <- 0.230
prop_sd <- 0.237
})
model({
TVl = THETA_Cl*ClCr
TVV = THETA_V*WT
TVk12 = THETA_k12
TVk21 = THETA_k21
Cl = TVl*exp(ETA_Cl)
V = TVV*exp(ETA_V)
k12 = TVk12*exp(ETA_k12)
k21 = TVk21 *exp(ETA_k21)
ke = Cl/V
Cp = centr/V
d/dt(centr) = - ke*centr - k12*centr + k21*periph
d/dt(periph) = + k12*centr - k21*periph
Cp ~ add(add_sd) + prop(prop_sd) + combined1()
})
}
```
2. A table of the patient's TDM data, in a format similar to the data for NONMEM
```{r}
patient_data <- data.frame(ID=1,
TIME=c(0.0,1.0,11.0),
DV=c(NA,9,2),
AMT=c(180,0,0),
DUR=c(0.5,NA,NA),
EVID=c(1,0,0),
ClCr=38,
WT=63)
patient_data
```
### Individual PK profile
With these two elements, you can estimate and plot and the individual concentrations over time.
```{r}
library("posologyr")
```
```{r map_plot}
#| fig.alt: >
#| Plot of the individual profile
patient_map <- poso_estim_map(patient_data,mod_gentamicin_Xuan2003)
plot(patient_map$model,Cc)
```
### Dose optimization
We will optimize the gentamicin dosage for this patient to meet two criteria:
+ A peak concentration of 12 mg/L, 30 minutes after a 30-minute infusion.
+ A trough concentration of less than 0.5 mg/L.
The time required to reach a residual concentration of 0.5 mg/L can be estimated as follows:
```{r}
poso_time_cmin(patient_data,mod_gentamicin_Xuan2003,tdm=TRUE,
target_cmin = 0.5)
```
The dose required to achieve our target concentration can then be determined for an infusion at H48.
```{r}
poso_dose_conc(patient_data,mod_gentamicin_Xuan2003,tdm=TRUE,
target_conc = 12,duration=0.5,time_dose = 48,time_c = 49)
```
In conclusion a dose of 240 mg 48 h after the first injection would be appropriate to meet our 2 criteria.
More examples can be found at: https://levenc.github.io/posologyr/
## Performance of the MAP-BE algorithm in posologyr
`posologyr` showed comparable performance to NONMEM MAP estimation with option `MAXEVAL=0`:
* Pharmaceutics **2022**, 14(2), 442; [doi:10.3390/pharmaceutics14020442](https://doi.org/10.3390/pharmaceutics14020442)
* Supporting data: [https://github.com/levenc/posologyr-pharmaceutics](https://github.com/levenc/posologyr-pharmaceutics)