A competitive agonist-antagonist interaction model after administration of risperidone and paliperidone treatment administered to healthy and schizophrenic subjects.
Authors:
Original exercise
Online training material
Set working directory
setwd(file.path(.MDLIDE_WORKSPACE_PATH,"OnlineTraining_CNS"))
Tasks
Simulx is an R function of the mlxR package developed by Marc Lavielle to simulate longitudinal data. The functions takes as input models encoded in MLXTRAN or in PharmML
Generate the PharmML code from MDL using the as.PharmML() function from the DDMoRe package
myPharmML <- as.PharmML("Friberg_Prolactin_baseline.mdl")
The mlxR package also allows you to convert PharmML to MLXTRAN code
pharmml2mlxtran(myPharmML, "Friberg_Prolactin.txt")
## [1] "Friberg_Prolactin.txt"
Take a look at the generated code (not a mandatory task). Store the model parameters in a vector assuming no IIV. Note that this parameters correspond to a healthy population
p<-c(pop_KOUT=0.66,pop_KI=1.96,pop_AMP1=0.532, pop_PHS2=13.7, pop_PRL0=7.67,
omega_KOUT= 0, omega_KI=0, omega_AMP1=0, omega_PHS2= 0, omega_PRL0=0,
PHS1=20.1, AMP2=-0.314, KDA=0.156, UPDA=1.44, DOP0=10000, RUV_PROP=0.428,
VC=107.88, VP=15.611, CLR=4.0528, KS=0.893, QB=6.3668, ALAG=0.525)
Tasks
Plot the time course of prolactin and dopaminie in healthy subjects
#Output definition
out<-list(name=c('Apr', 'Adp'), time=seq(0,250,by=1))
#Dose administration - Placebo:
adm1 <- list(time=seq(48,144,24), amount=0)
# Simulation
res <- simulx(model = myPharmML,
parameter=list(p),
output=list(out),
treatment=adm1)
# Plot prolactin and Dopamine profiles
plot1<-ggplot(data=res$Apr,aes(x=time,y=Apr))+geom_line()
plot2<-ggplot(data=res$Adp,aes(x=time,y=Adp))+geom_line()
library(gridExtra)
grid.arrange(plot1,plot2)
Show the contribution of each cosine function
# Remove amplitud parameters from the parameter vector
p1<- p
p1 <- p1[-which(names(p1) %in% c("pop_AMP1","AMP2"))]
# Create 3 different ids by switching off the population parameter
# for 1st cosine (pop_AMP1), the 2nd cosine (pop_AMP2), or both simulataneously
p2 <- list( name = 'Cosine',
colNames = c('id', 'pop_AMP1','AMP2'),
value = cbind(1:3, c(0.532,0,0.532), c(-0.314,-0.314,0)))
#Output definition
out2<-list(name=c('Apr', 'Adp'), time=seq(0,48,by=0.2))
#Dose administration - Placebo:
adm1 <- list( time=0, amount=0)
# Simulation
res2 <- simulx(model = myPharmML,
parameter=list(p1,p2),
output=list(out2),
treatment=adm1)
# Plot prolactin profiles
levels(res2$Apr$id) <- c("COS1 + COS2","COS1","COS2")
ggplot(data=res2$Apr,aes(x=time,y=Apr, color=id))+
geom_line()
ggplot(data=res2$Apr,aes(x=time,y=Apr))+
geom_line()+
facet_wrap(~id, ncol=1) +
scale_colour_discrete(name="",
breaks=c("1", "2", "3"),
labels=c("COS1 + COS2", "COS1","COS2"))
Tasks
Compare the profiles between healthy volunteers and patients after treatment The model assumes different baseline prolactin values based on the health status and the sex *Healthy volunteers: 7.67 *Male patients: 16.1 *Female patients: 35.3
# Remove baseline prolactin parameter from the parameter list
p3 <- p
p3 <- p3[-which(names(p3) %in% c("pop_PRL0"))]
# Create 3 different ids with different baseline prolactin values
# for healtly volunteers, male patients and female patients
p_PRL0<- list(name = 'PRL0',
colNames = c('id', 'pop_PRL0'),
value = cbind(1:3, c(7.67,16.1,35.2)));
#Output definition
out3<-list(name=c('Apr','Adp','Ad'), time=seq(0,248,by=1))
#Dose administration
adm3 <- list( time=seq(48,144,24), amount=12*0.27)
#Simulation
res3 <- simulx(model = myPharmML,
parameter=list(p3,p_PRL0),
output=list(out3),
treatment=adm3)
#Plot profiles
plot_Apr<-ggplot(data=res3$Apr,aes(x=time,y=Apr,colour=id))+
geom_line()+
scale_colour_discrete(name="Subjects",
breaks=c("1","2","3"),
labels=c("Healthy","Male patient","Female patient"))
plot_Adp<-ggplot(data=res3$Adp,aes(x=time,y=Adp,colour=id))+
geom_line()+
scale_colour_discrete(name="Subjects",
breaks=c("1","2","3"),
labels=c("Healthy","Male patient","Female patient"))
grid.arrange(plot_Apr,plot_Adp)
Tasks
#Parameter definition including IIV:
p4 <- c(pop_PRL0= 7.67,omega_PRL0=0.425,pop_KOUT=0.664,omega_KOUT=0.589,PHS1=20.1,
pop_AMP1=0.532, omega_AMP1=0.0558, AMP2=-0.314,pop_PHS2=13.7, omega_PHS2=1.8,
pop_KI=1.96,omega_KI=1.82, KDA=0.156, UPDA=1.44, DOP0=10000, RUV_PROP=0.428,
VC=107.88,VP=15.611,CLR=4.0528,KS=0.893,QB=6.3668,ALAG=0.5246)
#Output definition -
out4<-list(name=c('Apr','Adp'), time=seq(0,248,by=2))
#Dose administration
adm4 <- list( time=48, amount=12*0.27,target="Ad")
# Define the population
g <- list(size=1000, level='individual')
res4 <- simulx(model = myPharmML,
parameter=p4,
output=out4,
treatment=adm4,
group=g,
settings = list(seed=12345))
#Plot results
plot3 <- prctilemlx(res4$Apr,band=list(number=10, level=100))
plot4 <-prctilemlx(res4$Adp,band=list(number=10, level=100))
grid.arrange(plot3,plot4)
Tasks
#Parameter definition including IIV. Exclude pop_KI which will differently defined for each group
p5 <- c(pop_PRL0= 7.67,omega_PRL0=0.425,pop_KOUT=0.664,omega_KOUT=0.589,PHS1=20.1,
pop_AMP1=0.532, omega_AMP1=0.0558, AMP2=-0.314,pop_PHS2=13.7, omega_PHS2=1.8,
omega_KI=1.82, KDA=0.156, UPDA=1.44, DOP0=10000, RUV_PROP=0.428,
VC=107.88,VP=15.611,CLR=4.0528,KS=0.893,QB=6.3668,ALAG=0.5246)
#Output definition:
out5<-list(name=c('Apr','Adp'), time=seq(0,248,by=2))
#Dose administration - Assume a single dose of 12 mg at day 2
adm5 <- list( time=48, amount=12*0.27,target="Ad")
# Define 3 groups of 6 individuals each with varying KI parameters
N=18 #Number of subjects to simulate
g1 <- list(size=N/3, level='individual',parameter = c(p5,pop_KI=0.196))
g2 <- list(size=N/3, level='individual',parameter = c(p5,pop_KI=1.96))
g3 <- list(size=N/3, level='individual',parameter = c(p5,pop_KI=19.6))
# Simulate
res5 <- simulx(model = myPharmML,
output=list(out5),
treatment=adm5,
group=list(g1,g2,g3),
settings = list(seed=12345))
#Plot results
plot5<-ggplot(data=res5$Apr,aes(x=time,y=Apr,by=id,colour=group))+geom_line()+
scale_colour_discrete(breaks=c("1","2","3"),labels=c("0.196","1.96","19.6"))
plot6<-ggplot(data=res5$Adp,aes(x=time,y=Adp,by=id,colour=group))+geom_line()+
scale_colour_discrete(breaks=c("1","2","3"),labels=c("0.196","1.96","19.6"))
grid.arrange(plot5,plot6)