Skip to content

PKPD models using OPENBUGS for Diabetes and Parkinson TRY individual dosage

Notifications You must be signed in to change notification settings

ccjaread/PKPD_OPENBUGS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.libPaths()

'/Library/Frameworks/R.framework/Versions/4.0/Resources/library'

1. 环境设置

library(R2OpenBUGS)
library(coda)
library(deSolve)
library(ggplot2)
library(lattice)
library(reshape2)
library(gganimate)
# library(chron)
fig <- function(width, heigth){
     options(repr.plot.width = width, repr.plot.height = heigth)
}

2. 读取患者实际数据

pat_data <- read.csv(file="diabetes_case1.csv", header=T)
head(pat_data)
A data.frame: 6 × 8
datetime_relativetime_accutime_in_dayMetforminDPP_4Glumeal
<int><dbl><dbl><dbl><int><int><dbl><int>
170.0 8.0 8.0500100 0.0130
270.5 8.5 8.5 0 0 0.0 0
373.511.511.5500 0 0.0130
474.012.012.0 0 012.6 0
579.017.017.0 0 0 0.0130
679.517.517.5 0 0 0.0 0
t_obv<-pat_data$time_relative
metformin_dosing<-pat_data$Metformin
dpp4_dosing<-pat_data$DPP_4
meal_dosing<-pat_data$meal

3. 理论参数模型

3.1. 单次给药模拟

## 理论参数

#sitagliptin
Ka_sita <- 1.64 #(/h)
Kqf_sita<-11.1 #(L/h)
Vcf_sita<-266 #(L)
Vpf_sita<-101
CLf_sita<-39.1 #(L/h)
Emax_sita<-100 #(100% inh)
EC50_sita<-12.9 #(ng/mL)
gamma_sita<-0.823

#metformin
Ka_met<-0.41 #(/h)
V_met<-113 #(L)
CLf_met<-52.9 #(L/h)
Emax_met<-19.8 #(ug/mL? mg/dL)
EC50_met<-3.68 #(ug/mL)
tau_met<-0.5 #(h)
gamma_met<-0.55

#meal
Ktr_glu<-6.9 #(/h)
Ka_glu<-0.892 #(/h)
Vdf_glu<-19.1 #(L)
CLf_glu<-83.7 #(L/h)
base_glu<-82.9 #(mg/dL)
## ODE
## 间接效应PK-PD模型
PKPD <- function(t, y, parms) {
    #sitagliptin
    dx1_si_dt <- -Ka_sita*y[1] #y1 x1_si
    dx2_si_dt <- Ka_sita*y[1]-CLf_sita*y[2]/Vcf_sita- Kqf_sita*y[2]/Vcf_sita+Kqf_sita*y[3]/Vpf_sita #y2 x2_si
    dx3_si_dt <- Kqf_sita*y[2]/Vcf_sita-Kqf_sita*y[3]/Vpf_sita #y3 x3_si
    Cp_si <- y[2]*1000/Vcf_sita
    E_si <- Emax_sita*Cp_si^gamma_sita/(EC50_sita^gamma_sita+Cp_si^gamma_sita)
    
    #metformin
    dx1_met_dt <- -Ka_met*y[4] #y4 x1_met
    dx2_met_dt <- Ka_met*y[4]-CLf_met*y[5]/V_met #y[5] x2_met
    Cp_met <- y[5]/V_met
    DR_met <- Emax_met*Cp_met^gamma_met/(EC50_met^gamma_met+Cp_met^gamma_met)
    dm1_dt <- (DR_met-y[6])/tau_met #y[6] m1
    dm2_dt <- (y[6]-y[7])/tau_met #y[7] m2
    dm3_dt <- (y[7]-y[8])/tau_met #y[8] m3
    
    #glu
    dx1_glu_dt <- -Ktr_glu*y[9] #y[9] x1_glu
    dx2_glu_dt <- Ktr_glu*y[9]-Ktr_glu*y[10] #y[10] x2_glu
    dx3_glu_dt <- Ktr_glu*y[10]-Ka_glu*y[11] #y[11] x3_glu
    dx4_glu_dt <- Ka_glu*y[11]-CLf_glu*(1+E_si/100)*y[12]/Vdf_glu #y[8]*Vdf_glu*10/1000 #y[12] x4_glu (g/L)
    
    list(c(dx1_si_dt,dx2_si_dt,dx3_si_dt,dx1_met_dt,dx2_met_dt,dm1_dt,dm2_dt,dm3_dt,dx1_glu_dt,dx2_glu_dt,dx3_glu_dt,dx4_glu_dt))
  }
yini <- c(x1s=100,x2s=0,x3s=0,x1m=500,x2m=0,m1m=0,m2m=0,m3m=0,x1g=130,x2g=0,x3g=0,x4g=0) #ng/mL  base_glu*Vdf_glu*10/1000
times <- seq(from = 10, to = 24, by = 1)
out_st <- ode(times = times, y = yini, func = PKPD, parms = NULL)
head(out_st,n=3)
A matrix: 3 × 13 of type dbl
timex1sx2sx3sx1mx2mm1mm2mm3mx1gx2gx3gx4g
10100.000000 0.000000.000000500.0000 0.00000.0000000.0000000.0000001.300000e+020.000000000 0.0000000.000000
11 19.39800471.725091.900139331.8251132.16885.1758413.0961461.4945761.310118e-010.90398323818.0766458.952104
12 3.76282673.622754.655317220.2158170.47337.1085716.1574824.7770241.320436e-040.001822093 0.9803940.539942
tail(out_st,n=3)
A matrix: 3 × 13 of type dbl
timex1sx2sx3sx1mx2mm1mm2mm3mx1gx2gx3gx4g
[13,]222.849233e-0716.765399.8658473.64955312.9263492.7935733.0363233.291475 4.070881e-13-1.444188e-11 2.467113e-11-2.768051e-09
[14,]235.526903e-0814.849569.4619812.422025 9.0587382.3608912.5771792.806625-9.181496e-12 4.544221e-10-7.784162e-10 1.769147e-07
[15,]241.074113e-0813.221219.0304121.607375 6.3124931.9812932.1711462.374161-6.590232e-11 2.986291e-09-5.097997e-09-8.884230e-07
out_st_df <- as.data.frame(out_st)
E_t_st <- ggplot(aes(x = time),data=out_st_df) +
  geom_line(aes(y = x3g,colour = "blue"),show.legend = TRUE) +
  geom_line(aes(y = x4g, colour = "green")) +
#   geom_point(aes(x = grid, y = r_score, colour = "red"), data=out_real, show.legend = TRUE) + 
#   ylab(label = "Effects_Score") +
#   xlab(label = "Time(min)") +
#   scale_colour_manual(name = "Effects",
#                       labels = c("Pop", "Ind"),
#                       values = c("red", "blue")) + 
#   transition_reveal(time)+
#   coord_cartesian(xlim = c(-10, 250)) + 
  theme_bw()
E_t_st

png

3.2. 多次给药模拟

mult_drug_dosing<-function(time_seq,metformin_seq,DPP4_seq,meal_seq){
    n=length(time_seq)-1
    
    for (i in 1:n){
        
        times <- seq(from = time_seq[i], to = time_seq[i+1], by = (time_seq[i+1]-time_seq[i])/10)
        
        if (i==1){
            
            
            yini <- c(x1s=DPP4_seq[i],x2s=0,x3s=0,x1m=metformin_seq[i],x2m=0,m1m=0,m2m=0,m3m=0,x1g=meal_seq[i],x2g=0,x3g=0,x4g=0) #ng/mL  base_glu*Vdf_glu*10/1000

            out_st <- ode(times = times, y = yini, func = PKPD, parms = NULL)
            df <- as.data.frame(out_st)
#             print(df)
        } else {
            
            yini <- out_st[dim(out_st)[1],c(2:dim(out_st)[2])]
            yini['x1s']<-yini['x1s']+DPP4_seq[i]
            yini['x1m']<-yini['x1m']+metformin_seq[i]
            yini['x1g']<-yini['x1g']+meal_seq[i]
            
            
#             print(yini)
            
            out_st <- ode(times = times, y = yini, func = PKPD, parms = NULL)
            
            temp_df <- as.data.frame(out_st)
            
            
            df<-rbind(df[0:(dim(df)[1]-1),],temp_df)
        }
    }
    return(df)
}
EC50_sita<-12.2
dftest<-mult_drug_dosing(time_seq=t_obv,metformin_seq=metformin_dosing,DPP4_seq=dpp4_dosing,meal_seq=meal_dosing)
dftest$x4g<-dftest$x4g-dftest$m3m*Vdf_glu*10/1000
dftest[dftest$time==432.0,]
A data.frame: 1 × 13
timex1sx2sx3sx1mx2mm1mm2mm3mx1gx2gx3gx4g
<dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl>
10814321006.1558776.066891500.13850.69071720.63402980.70574020.7848357520-1.052885e-140.001068613-0.02157555
pat_data[pat_data$time_relative==432.0,]
A data.frame: 1 × 9
datetime_relativetime_accutime_in_dayMetforminDPP_4GlumealGlu_g
<int><dbl><dbl><dbl><int><int><dbl><int><dbl>
10925432440850010071304.966
##生成实际血糖升高值的观察数据,以备后续拟合
pat_data$Glu_g=pat_data$Glu*180*Vdf_glu/1000-100*Vdf_glu*10/1000 #(g,mmol/L->mg/L->g/L->g;)
pat_data$Glu_g[pat_data$Glu_g<0]<-0
fig(24,3)

CpCe_trend <- ggplot(dftest,aes(x = time)) +
  geom_line(aes(y = x3s), colour = "darkgreen") +
  geom_line(aes(y = m3m), colour = "orange") +
  ylab(label = "Concentation(ng/mL)") +
  xlab(label = "Time(min)") +
#   scale_colour_manual(name = "Effects",
#                       labels = c("Pop", "Ind"),
#                       values = c("red", "blue")) + 
  theme_bw()
CpCe_trend

E_trend <- ggplot(dftest,aes(x = time)) +
  geom_line(aes(y = x4g), colour = "red") +
#   geom_line(aes(y = Ce, colour = "green")) +
  geom_point(aes(x = time_relative, y = Glu_g), pat_obs_data, colour = "blue", show.legend = FALSE) + 
  ylab(label = "Effects_Score") +
  xlab(label = "Time(min)") +
#   scale_colour_manual(name = "Effects",
#                       labels = c("Pop", "Ind"),
#                       values = c("red", "blue")) + 
  theme_bw()
E_trend

png

png

4. 个性化参数推导

4.1. MCMC建模

model <-    
paste(" 
model {
    
    # loop over time grid 
    for (j in 1:n.grid) {      
        equ_x[j]<-a.language[j, 12]-a.language[j, 8]*Vdf_glu*10/1000
        obs_x[j] ~ dnorm(equ_x[j] , tau.x)                           	    
    }           

    # parameters 

    #sitagliptin
    Ka_sita <- 1.64
    Kqf_sita<-11.1
    Vcf_sita<-266
    Vpf_sita<-101
    CLf_sita<-39.1
    Emax_sita<-100
    EC50_sita ~ dunif(0,24) 
    #EC50_sita<-12.9
    gamma_sita<-0.823

    #metformin
    Ka_met<-0.41
    V_met<-113
    CLf_met<-52.9
    Emax_met ~ dunif(0,40)
    #Emax_met<-19.8
    EC50_met<-3.68
    tau_met<-0.5
    gamma_met<-0.55

    #meal
    Ktr_glu<-6.9
    #Ka_glu<-0.892
    Ka_glu ~ dunif(0,10)
    Vdf_glu<-19.1
    CLf_glu<-83.7
    base_glu<-82.9

    # ODE solutions
    a.language[1:n.grid, 1:dim] <- 
        ode.block(inits[1:n.block, 1:dim], 
            grid[1:n.grid],                      
            D(C[1:dim], t),                      
            origins[1:n.block], tol)
    #sitagliptin
    D(C[1], t) <- -Ka_sita*C[1]
    D(C[2], t) <- Ka_sita*C[1]-CLf_sita*C[2]/Vcf_sita- Kqf_sita*C[2]/Vcf_sita+Kqf_sita*C[3]/Vpf_sita 
    D(C[3], t) <- Kqf_sita*C[2]/Vcf_sita-Kqf_sita*C[3]/Vpf_sita
    Cp_si <- C[2]*1000/Vcf_sita
    E_si <- Emax_sita*pow(Cp_si,gamma_sita)/(pow(EC50_sita,gamma_sita)+pow(Cp_si,gamma_sita))

    #metformin
    D(C[4], t) <- -Ka_met*C[4]
    D(C[5], t) <- Ka_met*C[4]-CLf_met*C[5]/V_met
    Cp_met <- C[5]/V_met
    DR_met <- Emax_met*pow(Cp_met,gamma_met)/(pow(EC50_met,gamma_met)+pow(Cp_met,gamma_met))
    D(C[6], t) <- (DR_met-C[6])/tau_met
    D(C[7], t) <- (C[6]-C[7])/tau_met
    D(C[8], t) <- (C[7]-C[8])/tau_met

    #glu
    D(C[9], t) <- -Ktr_glu*C[9]
    D(C[10], t) <- Ktr_glu*C[9]-Ktr_glu*C[10]
    D(C[11], t) <- Ktr_glu*C[10]-Ka_glu*C[11]
    D(C[12], t) <- Ka_glu*C[11]-CLf_glu*(1+E_si/100)*C[12]/Vdf_glu #-C[8]*Vdf_glu*10/1000


    tau.x <- 1/var.x
    var.x <- 1/(sd.x*sd.x)
    sd.x ~ dunif(0, 5)
}
")
writeLines(model,"metformin_sitagliptin_model.txt")   

4.2. 模型拟合个体参数

### prepare dosing data
pat_data$dose_sum<-pat_data$Metformin+pat_data$DPP_4+pat_data$meal

pat_dose_data<-pat_data[pat_data$dose_sum>0,c('time_relative','Metformin','DPP_4','meal')]

pat_dose_data[,c('2','3','5','6','7','8','10','11','12')]<-0

pat_dose_data<-pat_dose_data[,c('time_relative','Metformin','2','3','DPP_4','5','6','7','8','meal','10','11','12')]
### prepare obs data
pat_obs_data<-pat_data[pat_data$Glu_g>0,c('time_relative','Glu_g')]
bugs_data <- list(
    dim = 12,
    tol = 1.0E-3,

    n.grid=26,
    n.block=57,

    inits = data.matrix(pat_dose_data[,c('Metformin','2','3','DPP_4','5','6','7','8','meal','10','11','12')]),

    origins = pat_dose_data$time_relative,
    
    grid = pat_obs_data$time_relative,
    obs_x= pat_obs_data$Glu_g
)
init1 <- list(
  EC50_sita = runif(1, 0, 20), 
  Emax_met = runif(1, 0, 40), 
  Ka_glu = runif(1,0, 10),
#   E = runif(1, 36, 56), 
#   Emax = runif(1,700, 900),
#   gamma = runif(1,1, 15),
  sd.x = 1)
init2 <- list(
  EC50_sita = runif(1, 0, 20), 
  Emax_met = runif(1, 0, 40), 
  Ka_glu = runif(1,0, 10),
#   E = runif(1, 36, 56), 
#   Emax = runif(1,700, 900),
#   gamma = runif(1,1, 15),
  sd.x = 4)
inits <- list(init1,init2)
parameters <- c('EC50_sita','Emax_met','Ka_glu')
diabetes.sim <- bugs(
  data = bugs_data, 
  inits = inits, 
  codaPkg = TRUE,
  model.file = 'metformin_sitagliptin_model.txt', 
  parameters=parameters, 
  n.chains = 2, 
  n.iter = 2000, 
  n.burnin = 300,
  useWINE = TRUE, 
  OpenBUGS.pgm = "/Users/esther/.wine/drive_c/Program Files/OpenBUGS/OpenBUGS323/OpenBUGS.exe",
  WINE = "/Applications/Wine.app/Contents/Resources/wine/bin/wine", 
  WINEPATH = "/Applications/Wine.app/Contents/Resources/wine/bin/winepath",
  working.directory = getwd(),
  debug=TRUE)
arguments 'show.output.on.console', 'minimized' and 'invisible' are for Windows only

4.3. 拟合结果

fig(8,8)
out.coda <- read.bugs(diabetes.sim)
xyplot(out.coda)
Abstracting EC50_sita ... 1700 valid values
Abstracting Emax_met ... 1700 valid values
Abstracting Ka_glu ... 1700 valid values
Abstracting deviance ... 1700 valid values
Abstracting EC50_sita ... 1700 valid values
Abstracting Emax_met ... 1700 valid values
Abstracting Ka_glu ... 1700 valid values
Abstracting deviance ... 1700 valid values

png

densityplot(out.coda) 

png

gelman.diag(out.coda) 
Potential scale reduction factors:

          Point est. Upper C.I.
EC50_sita          1       1.00
Emax_met           1       1.00
Ka_glu             1       1.01
deviance           1       1.00

Multivariate psrf

1
out.summary <- summary(out.coda, q = c(0.025, 0.975))
out.summary
Iterations = 301:2000
Thinning interval = 1 
Number of chains = 2 
Sample size per chain = 1700 

1. Empirical mean and standard deviation for each variable,
   plus standard error of the mean:

             Mean     SD Naive SE Time-series SE
EC50_sita  11.790  6.898  0.11831        0.12466
Emax_met   19.776 11.573  0.19848        0.19849
Ka_glu      3.118  1.161  0.01990        0.03285
deviance  182.160  2.389  0.04097        0.07243

2. Quantiles for each variable:

              2.5%   97.5%
EC50_sita   0.5141  23.230
Emax_met    0.8441  38.930
Ka_glu      1.7820   6.621
deviance  179.8000 188.600

4.4. 结果验证

4.4.1 更新参数

EC50_sita <- out.summary$statistics[,'Mean']['EC50_sita']
# K <- 0.81/60
Emax_met <- out.summary$statistics[,'Mean']['Emax_met']
# Ke0 <- 0.95/60
Ka_glu <-out.summary$statistics[,'Mean']['Ka_glu']
# Ec50 <- 600
# gamma <- 7

# yini <- c(Cp = 3000, Ce = 0)
# times <- seq(from = 0, to = 240, by = 1)
df_post<-mult_drug_dosing(time_seq=t_obv,metformin_seq=metformin_dosing,DPP4_seq=dpp4_dosing,meal_seq=meal_dosing)
df_post$x4g<-df_post$x4g-df_post$m3m*Vdf_glu*10/1000
fig(24,3)

CpCe_trend <- ggplot(df_post,aes(x = time)) +
  geom_line(aes(y = x3s), colour = "darkgreen") +
  geom_line(aes(y = m3m), colour = "orange") +
  ylab(label = "Drug Effect(ng/mL)") +
  xlab(label = "Time(h)") +
#   scale_colour_manual(name = "Effects",
#                       labels = c("Pop", "Ind"),
#                       values = c("red", "blue")) + 
  theme_bw()
CpCe_trend

E_trend <- ggplot(df_post,aes(x = time)) +
  geom_line(aes(y = x4g), colour = "red") +
#   geom_line(aes(y = Ce, colour = "green")) +
  geom_point(aes(x = time_relative, y = Glu_g), pat_obs_data, colour = "blue", show.legend = FALSE) + 
  ylab(label = "Glu") +
  xlab(label = "Time(h)") +
#   scale_colour_manual(name = "Effects",
#                       labels = c("Pop", "Ind"),
#                       values = c("red", "blue")) + 
  theme_bw()
E_trend

png

png

4.5. 生成预测值

pat_data_pred <- read.csv(file="diabetes_case1_pred.csv", header=T)
head(pat_data_pred,n=3)
A data.frame: 3 × 9
datetime_relativetime_accutime_in_dayMetforminDPP_4Glumealtag
<int><dbl><dbl><dbl><int><int><dbl><int><chr>
170.0 8.0 8.05001000130real_data
270.5 8.5 8.5 0 00 0real_data
373.511.511.5500 00130real_data
t_obv_p<-pat_data_pred$time_relative
metformin_dosing_p<-pat_data_pred$Metformin
dpp4_dosing_p<-pat_data_pred$DPP_4
meal_dosing_p<-pat_data_pred$meal
df_pred<-mult_drug_dosing(time_seq=t_obv_p,
                          metformin_seq=metformin_dosing_p,
                          DPP4_seq=dpp4_dosing_p,
                          meal_seq=meal_dosing_p)
df_pred$x4g<-df_pred$x4g-df_pred$m3m*Vdf_glu*10/1000
tail(df_pred)
A data.frame: 6 × 13
timex1sx2sx3sx1mx2mm1mm2mm3mx1gx2gx3gx4g
<dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl>
1366537.252.580819e-0527.1429213.8731558.60101127.91727.1219007.4355507.72217523.16249639.9553148.46532 9.271616
1367537.302.377636e-0526.9638313.8534157.41191126.13307.0886477.4040947.69337816.40415133.9566053.2574112.253863
1368537.352.190450e-0526.7863113.8334156.24695124.36637.0552807.3724627.66432111.61775328.0568855.4406714.674575
1369537.402.018000e-0526.6103413.8131655.10563122.61717.0218077.3406607.635009 8.22792922.7090955.5068816.420436
1370537.451.859127e-0526.4359213.7926553.98746120.88546.9882317.3086947.605453 5.82718718.0934253.9728217.481457
1371537.501.712761e-0526.2630213.7718952.89199119.17146.9545577.2765707.575660 4.12693114.2379251.3108417.914386
result<-merge(pat_data_pred,df_pred[,c('time','x4g')],by.x="time_relative",by.y="time",all.x=TRUE)
head(result)
A data.frame: 6 × 10
time_relativedatetime_accutime_in_dayMetforminDPP_4Glumealtagx4g
<dbl><int><dbl><dbl><int><int><dbl><int><chr><dbl>
10.07 8.0 8.0500100 0.0130real_data 0.000000
20.57 8.5 8.5 0 0 0.0 0real_data18.903601
33.5711.511.5500 0 0.0130real_data-1.343360
44.0712.012.0 0 012.6 0real_data17.461575
59.0717.017.0 0 0 0.0130real_data-1.501521
69.5717.517.5 0 0 0.0 0real_data18.026026
result$pred=(result$x4g+100*Vdf_glu*10/1000)*1000/180/Vdf_glu
write.csv(result,file = "predit.csv",row.names = F)
tail(result)
A data.frame: 6 × 11
time_relativedatetime_accutime_in_dayMetforminDPP_4Glumealtagx4gpred
<dbl><int><dbl><dbl><int><int><dbl><int><chr><dbl><dbl>
133528.029536.0 8.05001000130predit-0.1497182 5.512008
134528.529536.5 8.5 0 00 0predit18.702567710.995511
135531.529539.511.5500 00130predit-1.3481901 5.163412
136532.029540.012.0 0 00 0predit17.418020010.621879
137537.029545.017.0 0 00130predit-1.5016174 5.118785
138537.529545.517.5 0 00 0predit17.914385810.766255

4.6. 模拟DPP-4停药

df_DPP4<-mult_drug_dosing(time_seq=t_obv,metformin_seq=metformin_dosing,DPP4_seq=dpp4_dosing*0,meal_seq=meal_dosing)

df_DPP4$x4g<-df_DPP4$x4g-df_DPP4$m3m*Vdf_glu*10/1000
fig(24,3)

CpCe_trend <- ggplot(df_DPP4,aes(x = time)) +
  geom_line(aes(y = x3s), colour = "darkgreen") +
  geom_line(aes(y = m3m), colour = "orange") +
  ylab(label = "Drug Effect(ng/mL)") +
  xlab(label = "Time(h)") +
#   scale_colour_manual(name = "Effects",
#                       labels = c("Pop", "Ind"),
#                       values = c("red", "blue")) + 
  theme_bw()
CpCe_trend

E_trend <- ggplot(df_DPP4,aes(x = time)) +
  geom_line(aes(y = x4g), colour = "red") +
#   geom_line(aes(y = Ce, colour = "green")) +
  geom_point(aes(x = time_relative, y = Glu_g), pat_obs_data, colour = "blue", show.legend = FALSE) + 
  ylab(label = "Glu") +
  xlab(label = "Time(h)") +
#   scale_colour_manual(name = "Effects",
#                       labels = c("Pop", "Ind"),
#                       values = c("red", "blue")) + 
  theme_bw()
E_trend

png

png

df_DPP4<-mult_drug_dosing(time_seq=t_obv,metformin_seq=metformin_dosing*0,DPP4_seq=dpp4_dosing,meal_seq=meal_dosing)

df_DPP4$x4g<-df_DPP4$x4g-df_DPP4$m3m*Vdf_glu*10/1000
fig(24,3)

CpCe_trend <- ggplot(df_DPP4,aes(x = time)) +
  geom_line(aes(y = x3s), colour = "darkgreen") +
  geom_line(aes(y = m3m), colour = "orange") +
  ylab(label = "Drug Effect(ng/mL)") +
  xlab(label = "Time(h)") +
#   scale_colour_manual(name = "Effects",
#                       labels = c("Pop", "Ind"),
#                       values = c("red", "blue")) + 
  theme_bw()
CpCe_trend

E_trend <- ggplot(df_DPP4,aes(x = time)) +
  geom_line(aes(y = x4g), colour = "red") +
#   geom_line(aes(y = Ce, colour = "green")) +
  geom_point(aes(x = time_relative, y = Glu_g), pat_obs_data, colour = "blue", show.legend = FALSE) + 
  ylab(label = "Glu") +
  xlab(label = "Time(h)") +
#   scale_colour_manual(name = "Effects",
#                       labels = c("Pop", "Ind"),
#                       values = c("red", "blue")) + 
  theme_bw()
E_trend

png

png

df_DPP4<-mult_drug_dosing(time_seq=t_obv,metformin_seq=metformin_dosing,DPP4_seq=dpp4_dosing,meal_seq=meal_dosing)
df_DPP4$x4g<-df_DPP4$x4g-df_DPP4$m3m*Vdf_glu*10/1000
fig(24,3)

CpCe_trend <- ggplot(df_DPP4,aes(x = time)) +
  geom_line(aes(y = x3s), colour = "darkgreen") +
  geom_line(aes(y = m3m), colour = "orange") +
  ylab(label = "Drug Effect(ng/mL)") +
  xlab(label = "Time(h)") +
#   scale_colour_manual(name = "Effects",
#                       labels = c("Pop", "Ind"),
#                       values = c("red", "blue")) + 
  theme_bw()
CpCe_trend

E_trend <- ggplot(df_DPP4,aes(x = time)) +
  geom_line(aes(y = x4g), colour = "red") +
#   geom_line(aes(y = Ce, colour = "green")) +
  geom_point(aes(x = time_relative, y = Glu_g), pat_obs_data, colour = "blue", show.legend = FALSE) + 
  ylab(label = "Glu") +
  xlab(label = "Time(h)") +
#   scale_colour_manual(name = "Effects",
#                       labels = c("Pop", "Ind"),
#                       values = c("red", "blue")) + 
  theme_bw()
E_trend

png

png

About

PKPD models using OPENBUGS for Diabetes and Parkinson TRY individual dosage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published