library(shiny)
library(shinydashboard)
library(maftools)
ui <- dashboardPage(
dashboardHeader( title = "Data Annotation"),
dashboardSidebar(
dashboardBody(
fluidRow(
tabItem(tabName = "File Input",
fileInput("file1", "Choose File", multiple = FALSE, accept = c(".maf",".maf.gz"))),
tabItem(tabName = "oncoplots",
(plotOutput("oncoplots"))),
)
)
)
)
server <- function(input, output) {
usrvar <- reactive({
validate(need(input$file1$datapath != "", "Please upload an MAF file."))
if (is.null(input$file2$datapath)){
read.maf(input$file1$datapath)}
else {
read.maf(maf = input$file1$datapath , clinicalData = input$file2$datapath)
}})
aff <- reactive({
lamlgh.maf = system.file('extdata', 'tcga_laml.maf.gz', package = 'maftools')
laml = read.maf(maf = laml.maf)
faf <- list(getFields(laml))
return(faf)
})
output$oncoplots <- renderPlot({
oncoplot(maf = usrvar() , top = input$oncoslider)
})
}
shinyApp(ui = ui, server = server)
我正在尝试创建一个闪亮的应用程序来可视化图中的数据,但我收到此错误“ tagAssert(body, type = "div", class = "content-wrapper") 中的错误: 缺少参数“body”,没有默认值。不知道我是否遗漏了代码中的某些内容