Tumor growth inhibition model

Exploring the model








  [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  


  1. Define the dosage regimen in the tab input:
  • time of first dose,
  • number of doses,
  • interdose interval,
  • amount per dose.


  1. select the parameter values in the tab parameters:


  1. define the outputs in the tab outputs :
  • select the output to display,

  • select the time range where the prediction is computed,

  • select the number of time points of the grid where the prediction is computed.

shinyUI(fluidPage(
  titlePanel(
    list(HTML('<p style="color:#4C0B5F; font-size:24px">Tumor growth inhibition model</p>
              <p style="color:#4C0B5F; font-size:18px">Exploring the model</p>' )),
    windowTitle="tumor growth I"),
  tabsetPanel(
    tabPanel("Plot",
             fluidRow(
               column(3,
                      tabsetPanel(
                        tabPanel("input",
                                 sliderInput("tfd", "time of first dose:", value=0, min=-50, max = 50, step=5),
                                 sliderInput("nd", "number of doses:", value=0, min=0, max = 20, step=1, animate=TRUE),
                                 sliderInput("ii", "interdose interval:", value = 15, min = 1, max = 20, step=1),
                                 sliderInput("amt", "amount:", value = 1, min = 0, max = 5, step=0.2),
                                 br()
                        ),
                        tabPanel("parameters",
                                 br(),
                                 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),
                                 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),
                                 sliderInput("KQPP", "KQPP:", value = 0.004, min = 0, max = 0.01, step=0.0005),
                                 br()
                        ),
                        tabPanel("output",
                                 br(),
                                 selectInput("output","",c("PSTAR" = "PSTAR","PT" = "PT","Q" = "Q","QP" = "QP")),
                                 br(),
                                 sliderInput("range", "time range", min = -100, max = 500, value = c(-50,200), step=10),
                                 br(),
                                 sliderInput("ngp", "grid size", min = 10, max = 1000, value = 200, step=10),
                                 br()
                        )
                      )),
               column(9,
                      plotOutput("plot",  height="500px"))
             )),
    tabPanel("Table", tableOutput("table")),
    tabPanel("Mlxtran", pre(includeText("tgi_model.txt"))),
    tabPanel("ReadMe", withMathJax(), includeMarkdown("ReadMe.Rmd")),
    tabPanel("ui.R", pre(includeText("ui.R"))),
    tabPanel("server.R", pre(includeText("server.R")))
  )
))
source("../../initMlxR.R")

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=c('PSTAR','PT','Q','QP'),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
  })
  
  output$plot <- renderPlot({
    r=r()
    r <- r[[input$output]]
    j<-which(names(r)==input$output)
    names(r)[j] <- "f"
    pl=ggplotmlx(data=r, aes(x=time, y=f)) + geom_line(size=0.75)
    print(pl)
  })
  
  output$table <- renderTable({ 
    r <- r()
    d <- merge(r$PSTAR,r$PT)
    d <- merge(d,r$Q)
    d <- merge(d,r$QP)
    return(d)
  })
})