backup_options <- options() options(width = 3000) knitr::opts_chunk$set(collapse = TRUE, comment = "#>",echo = FALSE, warning = FALSE, message = FALSE, cache = FALSE, tidy = FALSE, size = "small") devtools::load_all()
Data for this example result from a PKPD population study on a non-steroidal molecule [@FloresMurrieta1998]. Single doses of 1, 3.2, 10, 31.6, 56.2, or 100mg/kg per os were given respectively to 6 groups, each of which contained at least 6 rats (weighing 200g on average), following a parallel design. Blood sampling and drug response (DI score) evaluation were conducted at 0, 15, 30, and 45 min and at 1, 1.25, 1.5, 2, 3 and 4 hours after administration.
Based on the evaluation results, we choose to optimize a design for 30 rats receiving a single dose of either 100mg/kg or 320 mg/kg, selecting only 3 from previously defined time points for blood sampling and response evaluation by using Fedorov-Wynn method.
Reports of the design evaluation and optimization are available at https://github.com/iame-researchCenter/PFIM
MyProject_evaluation
: project for the design evaluation named eval_PKPD_FloresMurrieta1998
MyProject_optimization
: project for the design optimization named opti_PKPD_FloresMurrieta1998
MyProject_evaluation = PFIMProject(name = "eval_PKPD_FloresMurrieta1998") MyProject_optimization = PFIMProject(name = "opti_PKPD_FloresMurrieta1998")
MyStatisticalModel = StatisticalModel() MyStatisticalModel = setParametersOdeSolver( MyStatisticalModel, list( atol=1e-8, rtol=1e-8, .relStep=1e-8 ) )
MyModelEquations = ModelODEquations( list(RespPK = expression( Cc ), RespPD = expression( E )) , list("Deriv_Cc" = expression( dose_RespPK/V*ka*exp(-ka*t) - Cl/V*Cc ), "Deriv_E" = expression(Rin*(1-Imax*(Cc**gamma)/(Cc**gamma + IC50**gamma))-kout*E) ) )
MyStatisticalModel = defineModelEquations( MyStatisticalModel, MyModelEquations )
vCc = ModelVariable( "Cc" ) vE = ModelVariable( "E" )
MyStatisticalModel = defineVariable( MyStatisticalModel, vCc ) MyStatisticalModel = defineVariable( MyStatisticalModel, vE )
pV = ModelParameter( "V", mu = 0.74, omega = 0.316, distribution = LogNormalDistribution() ) pCl = ModelParameter( "Cl", mu = 0.28, omega = 0.456, distribution = LogNormalDistribution() ) pka = ModelParameter( "ka", mu = 10, fixedMu = TRUE, omega = sqrt( 0 ), distribution = LogNormalDistribution() ) pkout = ModelParameter( "kout", mu = 6.14, omega = 0.947, distribution = LogNormalDistribution() ) pRin = ModelParameter( "Rin", mu = 614, fixedMu = TRUE, omega = sqrt( 0 ), distribution = LogNormalDistribution() ) pImax = ModelParameter( "Imax", mu = 0.76, omega = 0.439, distribution = LogNormalDistribution() ) pIC50 = ModelParameter( "IC50", mu = 9.22, omega = 0.452, distribution = LogNormalDistribution() ) pgamma = ModelParameter( "gamma", mu = 2.77, omega = 1.761, distribution = LogNormalDistribution() )
MyStatisticalModel = defineParameter( MyStatisticalModel, pka ) MyStatisticalModel = defineParameter( MyStatisticalModel, pV ) MyStatisticalModel = defineParameter( MyStatisticalModel, pCl ) MyStatisticalModel = defineParameter( MyStatisticalModel, pkout ) MyStatisticalModel = defineParameter( MyStatisticalModel, pRin ) MyStatisticalModel = defineParameter( MyStatisticalModel, pImax ) MyStatisticalModel = defineParameter( MyStatisticalModel, pIC50 ) MyStatisticalModel = defineParameter( MyStatisticalModel, pgamma )
MyStatisticalModel = addResponse( MyStatisticalModel, Response( "RespPK", Proportional( sigma_slope = 0.21 ) ) ) MyStatisticalModel = addResponse( MyStatisticalModel, Response( "RespPD", Constant( sigma_inter = 9.6 ) ) )
MyProject_evaluation = defineStatisticalModel( MyProject_evaluation, MyStatisticalModel ) MyProject_optimization = defineStatisticalModel( MyProject_optimization, MyStatisticalModel )
MyDesign
MyDesign = Design( name = "MyDesign")
- create and add the administration parameters for the response PK - create and add the sampling times for the responses PK and PD
brasTest1 = Arm( name="0.2mg Arm", arm_size = 6, cond_init = list("Cc"=0,"E"=100) ) brasTest1 = addAdministration( brasTest1, Administration( outcome = "RespPK", time_dose = c(0), amount_dose = c(0.2) ) ) brasTest1 = addSampling( brasTest1, SamplingTimes( outcome = "RespPK", sample_time = c( 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4 ) ) ) brasTest1 = addSampling( brasTest1, SamplingTimes( outcome = "RespPD", sample_time = c( 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4 ) ) ) brasTest2 = Arm( name="0.64mg Arm", arm_size = 6, cond_init = list("Cc"=0,"E"=100) ) brasTest2 = addAdministration( brasTest2, Administration( outcome = "RespPK", time_dose = c(0), amount_dose = c(0.64) ) ) brasTest2 = addSampling( brasTest2, SamplingTimes( outcome = "RespPK", sample_time = c( 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4 ) ) ) brasTest2 = addSampling( brasTest2, SamplingTimes( outcome = "RespPD", sample_time = c( 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4 ) ) ) brasTest3 = Arm( name="2mg Arm", arm_size = 6, cond_init = list("Cc"=0,"E"=100) ) brasTest3 = addAdministration( brasTest3, Administration( outcome = "RespPK", time_dose = c(0), amount_dose = c(2) ) ) brasTest3 = addSampling( brasTest3, SamplingTimes( outcome = "RespPK", sample_time = c( 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4 ) ) ) brasTest3 = addSampling( brasTest3, SamplingTimes( outcome = "RespPD", sample_time = c( 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4 ) ) ) brasTest4 = Arm( name="6.24mg Arm", arm_size = 6, cond_init = list("Cc"=0,"E"=100) ) brasTest4 = addAdministration( brasTest4, Administration( outcome = "RespPK", time_dose = c(0), amount_dose = c(6.24) ) ) brasTest4 = addSampling( brasTest4, SamplingTimes( outcome = "RespPK", sample_time = c( 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4 ) ) ) brasTest4 = addSampling( brasTest4, SamplingTimes( outcome = "RespPD", sample_time = c( 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4 ) ) ) brasTest5 = Arm( name="11.24mg Arm", arm_size = 6, cond_init = list("Cc"=0,"E"=100) ) brasTest5 = addAdministration( brasTest5, Administration( outcome = "RespPK", time_dose = c(0), amount_dose = c(11.24) ) ) brasTest5 = addSampling( brasTest5, SamplingTimes( outcome = "RespPK", sample_time = c( 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4 ) ) ) brasTest5 = addSampling( brasTest5, SamplingTimes( outcome = "RespPD", sample_time = c( 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4 ) ) ) brasTest6 = Arm( name="20mg Arm", arm_size = 6, cond_init = list("Cc"=0,"E"=100) ) brasTest6 = addAdministration( brasTest6, Administration( outcome = "RespPK", time_dose = c(0), amount_dose = c(20) ) ) brasTest6 = addSampling( brasTest6, SamplingTimes( outcome = "RespPK", sample_time = c( 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4 ) ) ) brasTest6 = addSampling( brasTest6, SamplingTimes( outcome = "RespPD", sample_time = c( 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4 ) ) )
MyDesign
MyDesign = addArm( MyDesign, brasTest1 ) MyDesign = addArm( MyDesign, brasTest2 ) MyDesign = addArm( MyDesign, brasTest3 ) MyDesign = addArm( MyDesign, brasTest4 ) MyDesign = addArm( MyDesign, brasTest5 ) MyDesign = addArm( MyDesign, brasTest6 )
MyDesign
to the PFIM project MyProject_evaluation
MyProject_evaluation = addDesign( MyProject_evaluation, MyDesign )
evaluationPop = EvaluatePopulationFIM( MyProject_evaluation )
show( evaluationPop )
# set the path and name of the report to save the report outputPath = "C:/Users/ADMIN Romain LEROUX/Documents/GIT PFIM/PFIM/PAGE2022" plotOptions = list( unitTime=c("hour"), unitResponses= c("mcg/mL","DI%") ) evaluationPop = setNamePFIMProject( evaluationPop, "PKPD_FloresMurrieta1998_populationFIM" ) reportPFIMProject( evaluationPop, outputPath = outputPath, plotOptions = plotOptions )
evaluationInd = EvaluateIndividualFIM( MyProject_evaluation ) evaluationBay = EvaluateBayesianFIM( MyProject_evaluation )
show( evaluationInd ) show( evaluationBay )
evaluationInd = setNamePFIMProject( evaluationInd, "PKPD_FloresMurrieta1998_IndividualFIM" ) reportPFIMProject( evaluationInd, outputPath = outputPath, plotOptions = plotOptions ) evaluationBay = setNamePFIMProject( evaluationBay, "PKPD_FloresMurrieta1998_BayesianFIM" ) reportPFIMProject( evaluationBay, outputPath = outputPath, plotOptions = plotOptions )
- create and add the administration parameters for the response PK - create and add the sampling times for the responses PK and PD
brasTest = Arm( name="20mg Arm", arm_size = 30, cond_init = list( "Cc" = 0,"E"= expression( Rin/kout ) ) ) brasTest = addAdministration( brasTest, Administration( outcome = "RespPK", time_dose = c(0), amount_dose = c(20) ) ) brasTest = addSampling( brasTest, SamplingTimes( outcome = "RespPK", sample_time = c( 0.25, 1, 4 ) ) ) brasTest = addSampling( brasTest, SamplingTimes( outcome = "RespPD", sample_time = c( 1.5, 2, 6 ) ) )
MyDesign2
to the project MyProject_optimization
MyDesign2= Design( name = "MyDesign2") MyDesign2 = addArm( MyDesign2, brasTest ) MyProject_optimization = addDesign( MyProject_optimization, MyDesign2 )
samplingRespPK = SamplingConstraint( response = "RespPK" ) samplingRespPD = SamplingConstraint( response = "RespPD" )
samplingRespPK = allowedDiscretSamplingTimes( samplingRespPK, list( c( 0.25, 0.75, 1, 1.5, 2, 4, 6 ) ) ) samplingRespPD = allowedDiscretSamplingTimes( samplingRespPD, list( c( 0.25, 0.75, 1.5, 2, 3, 6, 8, 12 ) ) )
initialElementaryProtocols = list( c( 0.25, 1, 4 ), c( 1.5, 2, 6 ) )
samplingRespPK = numberOfSamplingTimesIsOptimisable( samplingRespPK, c(3) ) samplingRespPD = numberOfSamplingTimesIsOptimisable( samplingRespPD, c(3) )
samplingRespPK = FixTimeValues( samplingRespPK, c( 0.25, 4 ) ) samplingRespPD = FixTimeValues( samplingRespPD, c( 2, 6 ) )
Constr = DesignConstraint() Constr = addSamplingConstraint( Constr, samplingRespPK ) Constr = addSamplingConstraint( Constr, samplingRespPD )
administrationResp = AdministrationConstraint( response = "RespPK" )
administrationResp = AllowedDoses( administrationResp, c(20,64) ) Constr = addAdministrationConstraint( Constr, administrationResp )
Constr = setTotalNumberOfIndividuals( Constr, 30 )
MyProject_optimization = setConstraint( MyProject_optimization, Constr )
numberOfSubjects = c(30) proportionsOfSubjects = c(30)/30
optimizer = FedorovWynnAlgorithm( initialElementaryProtocols,numberOfSubjects, proportionsOfSubjects, showProcess = T ) optimization_populationFIM = OptimizeDesign( MyProject_optimization , optimizer, PopulationFim() )
show( optimization_populationFIM )
# set the path and name of the report to save the report outputPath = "C:/Users/ADMIN Romain LEROUX/Documents/GIT PFIM/PFIM/PAGE2022" plotOptions = list( unitTime=c("hour"), unitResponses= c("mcg/mL","DI%") ) reportPFIMProject( optimization_populationFIM, outputPath = outputPath, plotOptions = plotOptions )
options(backup_options)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.