Unverified Commit d447e76b authored by Severine Martini's avatar Severine Martini Committed by GitHub
Browse files

updtaes

parent 90d3a872
# Shiny app allowing: plot and parameters for microbial growth dataset
# Shiny app allowing: plot and parameters for microbial growth dataset # Marc Garel, Severine Martini, Christian Tamburini
# Severine Martini, Marc Garel, Christian Tamburini ### October 2017
### October 2017
library(shiny)
library(shiny)
shinyServer(function(input, output) {
shinyServer(function(input, output) { output$contents <- renderTable({
output$contents <- renderTable({
inFile <- input$file1
inFile <- input$file1
if (is.null(inFile))
if (is.null(inFile)) return(NULL)
return(NULL)
dd<-read.csv(inFile$datapath, header=input$header, sep=input$sep,
dd<-read.csv(inFile$datapath, header=input$header, sep=input$sep, quote=input$quote)
quote=input$quote) do<-reactiveValues(data=dd)
do<-reactiveValues(data=dd)
output$plot <- renderPlot({
output$plot <- renderPlot({
# plot(dd$H,dd$A, pch=19, xlab="Time(h)", ylab="DO600nm")
# lines(dd$H,SSlogis(summary(fit)$parameters[1,1],summary(fit)$parameters[2,1],summary(fit)$parameters[3,1])) ##############
# crssce=data.frame(dd$H,dd$A) x=rep(dd[,1],ncol(dd)-1)
# SSlogis(dd$H,asym,xmid,scal) y=unlist(dd[,2:ncol(dd)])
# coef=getInitial(dd$A~SSlogis(dd$H,asym,xmid,scal),data=crssce) crssce=data.frame(y,x)
# lines(dd$H,SSlogis(dd$H,coef[1],coef[2],coef[3]),lwd=1.5,col="blue") # limit axes extended
# grid(col="grey") maxx=max(x,na.rm=T)+(max(x,na.rm=T)/4)
maxy=max(y,na.rm=T)+(max(y,na.rm=T)/4)
w0=seq(0,maxx)
############## # modlog2=nls(x ~ SSlogis(y,Asym,xmid,scal),crssce)
x=rep(dd[,1],ncol(dd)-1) # modlog=nls(y ~ SSlogis(x,Asym,xmid,scal),crssce)
y=unlist(dd[,2:ncol(dd)]) coef=getInitial(y~SSlogis(x,asym,xmid,scal),data=cbind.data.frame(x,y))
crssce=data.frame(y,x) mu=1/coef[3]
w0=seq(0,90) # output plot
#modlog2=nls(x ~ SSlogis(y,Asym,xmid,scal),crssce) plot(x,y)
modlog=nls(y ~ SSlogis(x,Asym,xmid,scal),crssce) points(x,y,xlim=c(0,maxx),ylim=c(0,maxy),xlab="temps(h)",ylab="DO600nm",las=1,pch=22,bg=1)
coef=getInitial(y~SSlogis(x,asym,xmid,scal),data=cbind.data.frame(x,y)) lines(w0,SSlogis(w0,coef[1],coef[2],coef[3]),lwd=1.5)
mu=1/coef[3]
plot(x,y) observeEvent(input$clicks, {print(as.numeric(do$data))})
points(x,y,xlim=c(0,90),ylim=c(0,1.1),xlab="temps(h)",ylab="DO600nm",las=1,pch=22,bg=1)
lines(w0,SSlogis(w0,coef[1],coef[2],coef[3]),lwd=1.5) })
# ou, ce qui revient au même #
})
#x=dd[,1]
#y=dd[] })
#coef=getInitial(y~SSlogis(x,asym,xmid,scal),data=cbind.data.frame(x,y))
#mu=1/coef[3] # shinyServer(function(input, output, session) {
#plot(x,y) #output$main_plot <- renderPlot({
#points(x,y,xlim=c(0,90),ylim=c(0,1.1),xlab="temps(h)",ylab="DO600nm",las=1,pch=22,bg=1) # plot(dd$H,dd$A, type=input$plotType)
#lines(w0,SSlogis(w0,coef[1],coef[2],coef[3]),lwd=1.5)
#
############### #
# output$table <- DT::renderDataTable({
observeEvent(input$clicks, {print(as.numeric(do$data))}) # DT::datatable(cars)
# })
}) # })
# \ No newline at end of file
})
})
# shinyServer(function(input, output, session) {
#output$main_plot <- renderPlot({
# plot(dd$H,dd$A, type=input$plotType)
#
#
# output$table <- DT::renderDataTable({
# DT::datatable(cars)
# })
# })
# # Shiny app allowing: plot and parameters for microbial growth dataset
# # Marc Garel, Severine Martini, Christian Tamburini
### October 2017
library(shiny) library(shiny)
shinyUI(fluidPage( shinyUI(fluidPage(
headerPanel("Welcome on a growth curve app"), headerPanel("Application of a logistic model on microbial datasets"),
# load dataset # load dataset
titlePanel("Upload file"), titlePanel("Upload file"),
sidebarLayout( sidebarLayout(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment