andrewhooker / PopED

Population Experimental Design (PopED) in R

Home Page:https://andrewhooker.github.io/PopED/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Integrating an IV loading dose followed by SC maintenance dose using popEd

Anks2030 opened this issue · comments

Hi Andrew (@andrewhooker),
I am trying to do optimization for PK time-points using a complex dosing regime such as an IV loading dose and then sc maintenance doses once in 28 days x 10 doses. I tried looking in available resources for popED for such complex dosing regimens but didn't got any luck.

Also, how can I assign different combinations of doses (IV+SC) (e.g., in two such combinations) while optimizing time points using different combinations? There are examples of designs for different doses but I wish to learn how to assign different combinations of doses (IV+SC) under #design.

Will it be possible for you to share any codes for assigning the complex dosing regimens in popED. Highly appreciate it!
Thanks and regards,
-Ankur

Hi Andrew (@andrewhooker)
I am trying to include 50 iv loading dose and then after 7 days 100 mg sc maintenance dose given Q28Dx10
and then try to add second group of 300 iv+ 600 sc MD

I am sharing my code for sc maintenance dose only. Can you please suggest where I add an IV loading dose. DO I have to play with Time ( something like if(Time<168){DOSE<-50} else(DOSE<-100)
Kindly suggest, if you have encountered any such problems

#' Define the ODE system
PK.2.comp.sc.ode <- function(Time, State, Pars){
with(as.list(c(State, Pars)), {

CL=CL*(WT/70)^(WT_CL)
V2=V2*(WT/70)^(WT_V2)

dA1 <- -KA*A1 
dA2 <- KA*A1 + A3* Q/V2 -A2*(CL/V1+Q/V1)
dA3 <- A2* Q/V1-A3* Q/V2
return(list(c(dA1, dA2, dA3)))

})
}

#' define the initial conditions and the dosing
ff.PK.2.comp.sc.md.ode <- function(model_switch, xt, parameters, poped.db){
with(as.list(parameters),{
A_ini <- c(A1=0, A2=0, A3=0)
times_xt <- drop(xt)
dose_times = seq(from=0,to=max(times_xt),by=TAU)
eventdat <- data.frame(var = c("A1"),
time = dose_times,
value = c(DOSE), method = c("add"))
times <- sort(c(times_xt,dose_times))
out <- ode(A_ini, times, PK.2.comp.sc.ode, parameters, events = list(data = eventdat))#atol=1e-13,rtol=1e-13)
y = out[, "A2"]/(V1/Favail)
y=y[match(times_xt,out[,"time"])]
y=cbind(y)
return(list(y=y,poped.db=poped.db))
})
}

#' parameter definition function
#' names match parameters in function ff
fg <- function(x,a,bpop,b,bocc){
parameters=c( CL=bpop[1]*exp(b[1]),
V1=bpop[2]*exp(b[2]),
KA=bpop[3],
Q= bpop[4],
V2=bpop[5],
Favail=bpop[6],
WT_CL=bpop[7],
WT_V2=bpop[8],
DOSE=a[1],
TAU=a[2],
WT= a[3])
return( parameters )
}

#create poped databaseoriginal design
poped.db <- create.poped.database(ff_fun="ff.PK.2.comp.sc.md.ode",
fError_fun="feps.add.prop",
fg_fun="fg",
groupsize=100,
m=2, #number of groups

                              bpop=c(CL=0.007475,V1=2.36,KA=0.01,Q= 0.01045, V2= 1.42, Favail=0.381308,WT_CL=0.824, WT_V2=0.927),# TV 0.007475 L/h, L
                              notfixed_bpop=c(1,1,1,1,1,0,0,0),# decides which tested and which are not
                              
                              d=c(CL=0.0822,V1=0.1568), # decides the variances of BSV
                              notfixed_d = c(1,1),
                              
                              
                              sigma=c(add=0.369, prop=0), # decides the variances of RV
                              notfixed_sigma=c(0,0),
                              #0,7,14,35,42,63,66,70,77,84,91 days
                              xt=c(0,168,336,840,1008,1512,1584,1680,1848,2016,2184), 
                              minxt=c(0,144,312,792,984,1488,1560,1656,1800,1968,2160),
                              maxxt=c(0,192,360,888,1032,1536,1608,1704,1896,2064,2208),
                              # discrete_xt = list(0:2208),list(c(DOSE=600,TAU=672, WT=75),c(DOSE=100,TAU=672, WT=75))
                              a=list(c(DOSE=600,TAU=672, WT=75),c(DOSE=100,TAU=672, WT=75))

plot_model_prediction(poped.db,DV=T,
sample.times=T,
model_num_points = 1000)+
labs(x = "Time from first dose (h)", y=" Conc. (ug/mL)")+
theme_bw()+
ggtitle("Original Design")+
scale_y_continuous(breaks=sort(c(seq(0,70,12.5))))+
scale_x_continuous(breaks=c(0,168,336,840,1008,1512,1584,1680,1848, seq(0,2184,672)))

Please feel free to share you thoughts
BR,
-Ankur