I am attempting to transfer my shiny App into a module format to be able to expand it easier. This code analysis flow cytometry data (.fcs files). I am unsure how to link that files that I am analyzing to this post.
I think that my UI and Server modules are not communicating, but cannot find the issue. The error code I am getting is: cannot coerce type 'closure' to vector of type 'character'.
I have gone through a few different module tutorials, but it hasn't clicked yet.
library(shiny)
library(flowCore)
library(flowMeans)
library(flowViz)
library(grid)
library(plotrix)
library(rgl)
######## Module 1: FCS Gating
######## Input: FCS file
######## Output: FSC, SSC plot
fcsGatingServer<-function(id){
moduleServer(id, function(input, output, session) {
output$plotSSC <- renderPlot({
filePath<-reactive(input$file$datapath)
myfcs <- read.FCS(paste(filePath), alter.names=TRUE)
name<-"CD54+ Cells"
plot(myfcs[,c("FSC.A", "SSC.A")],pch=".", xlab="FSC.A", ylab="SSC.A")
})
})
}
fcsgatingUI<-function(id) {
ns<-NS(id)
sidebarLayout(
sidebarPanel(
fileInput(ns("file"), label ="BDS77 CD54 FCS File", multiple = F, accept = ".FCS", buttonLabel ="Browse CD54")
),
mainPanel(
plotOutput(ns("plotSSC"))
)
)
}
server <- function(input, output, session) {
fcsGatingServer("1")
}
ui <- fluidPage(
fcsgatingUI("1")
)
shinyApp(ui, server)