[LONGITUDINAL] input={K, KDE, KPQ, KQPP, LAMBDAP, GAMMA, DELTAQP} PK: depot(target=C) EQUATION: PT_0=5 Q_0 = 40 PSTAR = PT+Q+QP ddt_C = -KDE*C ddt_PT = LAMBDAP*PT*(1-PSTAR/K) + KQPP*QP - KPQ*PT - GAMMA*KDE*PT*C ddt_Q = KPQ*PT - GAMMA*KDE*Q*C ddt_QP = GAMMA*KDE*Q*C - KQPP*QP - DELTAQP*QP
#----- Dosing regimen ------------------------------ adm <- list(time=seq(0, 45, by= 9), amount=1) #----- Parameter values ---------------------------- psi <- list( name = c('K','KDE','KPQ','KQPP','LAMBDAP','GAMMA','DELTAQP'), value = c(100, 0.3, 0.025, 0.004, 0.12, 1, 0.01)) #----- Predicted tumor size ------------------------ of <- list(name='PSTAR', time=seq(-50,100,by=1)) res <- simulx(model="tgi_model.txt",parameter=psi,output=of,treatment=adm) #----- Plot the predicted tumor size -- plot1=ggplot() + geom_line(data=res$PSTAR, aes(x=time, y=PSTAR)) print(plot1)
shinyUI(fluidPage( titlePanel("tumor growth inhibition model",windowTitle="tumor growth"), fluidRow( column(3, offset=1, h5("dosage regimen"), sliderInput("nd", "Number of doses:", value=6, min=0, max = 20, step=1, animate=TRUE), sliderInput("ii", "Interdose interval:", value = 9, min = 1, max = 20, step=1), sliderInput("amt", "Amount:", value = 1, min = 0, max = 5, step=0.25) ), column(2, offset=1, h5("parameters"), sliderInput("GAMMA", "GAMMA:", value = 1, min = 0, max = 4, step=0.1), sliderInput("K", "K:", value = 100, min = 0, max = 200, step=5), sliderInput("KDE", "KDE:", value = 0.3, min = 0, max = 1, step=0.05) ), column(2, br(),br(), sliderInput("LAMBDAP", "LAMBDAP:", value = 0.12, min = 0, max = 0.5, step=0.025) , sliderInput("DELTAQP", "DELTAQP:", value = 0.01, min = 0, max = 0.05, step=0.0025), sliderInput("KPQ", "KPQ:", value = 0.025, min = 0, max = 0.1, step=0.005) ), column(2, br(),br(), sliderInput("KQPP", "KQPP:", value = 0.004, min = 0, max = 0.01, step=0.0005) ) ), tabsetPanel( tabPanel("Plot", fluidRow( column(10, plotOutput("plot")), column(2, sliderInput("range", "time range", min = -100, max = 500, value = c(-50,200), step=10), sliderInput("ngp", "grid size", min = 10, max = 1000, value = 200, step=10), sliderInput("lsize", "line size", min = 0, max = 3, value = 0.75, step=0.25) ) )), tabPanel("Table", tableOutput("table")), tabPanel("Mlxtran", pre(includeText("tgi_model.txt"))), tabPanel("Simulx", pre(includeText("tgi_compute.R"))), tabPanel("ui.R", pre(includeText("ui.R"))), tabPanel("server.R", pre(includeText("server.R"))) ) ))
my.dir=getwd() source("../initMlxR.R") setwd(my.dir) shinyServer(function(input, output) { r <- reactive({ param.value=c(input$K,input$KDE,input$KPQ,input$KQPP,input$LAMBDAP,input$GAMMA,input$DELTAQP) t.value=seq(input$range[1],input$range[2],length.out=input$ngp) t1=0 t2=input$ii*(input$nd-1)+t1 if (t2>=t1){ t.dose=seq(t1,t2,by=input$ii) adm <- list(time=t.dose, amount=input$amt) }else{ adm <- list(time=t1, amount=0) } f <- list(name='PSTAR',time=t.value) p <- list(name=c('K','KDE','KPQ','KQPP','LAMBDAP','GAMMA','DELTAQP'), value=param.value) res <- simulx( model = 'tgi_model.txt', treatment = adm, parameter = p, output = f) res$PSTAR }) output$plot <- renderPlot({ pl=ggplot(data=r(), aes(x=time, y=PSTAR)) + geom_line(size=input$lsize) print(pl) }) output$table <- renderTable({ r() }) })