inst/TBploter/ui.R

library(shiny)
library(shinydashboard)
library(shinyBS)

dashboardPage(
  dashboardHeader(title = "Plot server for TBtools"),
  dashboardSidebar(
    tags$link(rel="stylesheet",type="text/css",href="main.css"),
    sidebarMenu(
      menuItem("Introducction", tabName = "introduction"),
      menuItem("GOPlot", tabName = "GOenrichment",icon = icon("table")),
      menuItem("KeggPlot", tabName = "KeggPlot",icon = icon("table"))
    )
  ),
  dashboardBody(
    tabItems(
      tabItem("introduction", 
              box(
                width = 4, status = "info", solidHeader = TRUE,collapsible = TRUE,
                title = "Read Me",
              tags$a(href="http://cj-chen.github.io/tbtools/Introduction/",strong("TBtools")),
              p("is a Toolset written by CJ-Chen for wet-lab biologists.It aims at facilitating some common and elaborate but simple molecular analysis tasks such as sequences extract, gene set functional enrichment It is easy to use and can run in all Operating system including Mac, Linux, Windows, which has ",tags$a(href="http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html","Java run time environment higher than 1.6"),"
                . However, TBtools may mainly focus on data analysis procedure which make it diffcult to plot fancy figures as well as publishable. 
                To cover the shortage, we implemented an inteactive plot websever using shiny programing env, and named ",strong("TBploter")),
              br(),
              p("To allow running this app locally, we also released a R pakcages to gitHub. Users can install it by following command in R env"),
              code("if (!require(\"devtools\"))"),
              br(),
              code("install.packages(\"devtools\")"),
              br(),
              code("    devtools::install_github(\"likelet/PlotAppForTBtools\")"),
              br(),
              strong("This application was created by "),
              tags$a(href="mailto:zhaoqi3@mail2.sysu.edu.cn",strong("Qi Zhao")),
              strong(' from '),
              tags$a(href="http://english.sysucc.org.cn/",strong("SYSUCC")),
              strong(" and "),
              tags$a(href="mailto:120509419@qq.com",strong("Chenjie Chen")),
              strong(' from '),
              tags$a(href="http://www.scau.edu.cn/",strong("SCAU")),
              strong('. Please let us know if you find bugs or have new feature request.This application uses the'),
              tags$a(href="http://www.rstudio.com/shiny/",strong("shiny package from RStudio."))
              ), 
              box(
                width = 8, status = "info", solidHeader = TRUE,collapsible = TRUE,
                title = "Workflow",
                tags$img(src="image/workflow.png")
              )
      ),
      
      ###function 1
      tabItem("GOenrichment",
              fluidRow(
                box(
                  width = 4, status = "info", solidHeader = TRUE,collapsible = TRUE,
                  title = "Data Input",
                  p("Using GO enrichment analysis output data generated by TBtools, you can simply upload the ",code("TBtools.level2.counts.table.xls")," file into this app. Just clicked the ",code("Upload")," button and enjoy the plotting trip"),
                  radioButtons("dataset", strong("Dataset"), c(Example = "example", Upload = "upload"),selected = 'example'),
                  
                  conditionalPanel(
                    condition = "input.dataset == 'upload'",
                    fileInput('file1', 'Choose CSV/text File',
                              accept=c('text/csv', 'text/comma-separated-values,text/plain', '.csv')),
                    checkboxInput('header', 'Header', FALSE),
                    radioButtons('sep', 'Separator',
                                 c(Comma=',',
                                   Semicolon=';',
                                   Tab='\t'),
                                 '\t'),
                    radioButtons('quote', 'Quote',
                                 c(None='',
                                   'Double Quote'='"',
                                   'Single Quote'="'"),
                                 '')
                  ),
                  # numericInput('geneMappedGo', 'Total Annotated Genes',13000,max=30000,min=0),
                  checkboxInput("Issorted","Sorted Counts",TRUE),
                  tags$button(id="goPlot",type="button",class="btn btn-primary action-button","GO PLOT!"),
                  br(),
                  br(),
                  strong("This application was created by "),
                  tags$a(href="mailto:zhaoqi3@mail2.sysu.edu.cn",strong("Qi Zhao")),
                  strong(' from '),
                  tags$a(href="http://gps.biocuckoo.org/",strong("Ren Lab")),
                  strong(" in "),
                  tags$a(href="http://english.sysucc.org.cn/",strong("SYSUCC")),
                  strong('. Please let us know if you find bugs or have new feature request.This application uses the'),
                  tags$a(href="http://www.rstudio.com/shiny/",strong("shiny package from RStudio."))
                  
                  
                ),
                box(
                  width = 8, status = "success",solidHeader = TRUE,collapsible = TRUE,
                  title="Dataset",
                  bsAlert("alertLength"),
                  DT::dataTableOutput("summaryGO")
                    
                  
                ),
                bsModal("GOPlotModal", h3("Fancy Plot"), "goPlot", size = "large",
                        div(
                        downloadLink('downloadDataPNG', 'Download PNG-file'),
                        downloadLink('downloadDataPDF', 'Download PDF-file',class="downloadLinkred"),
                        downloadLink('downloadDataEPS', 'Download EPS-file',class="downloadLinkblue"),
                        downloadLink('downloadDatatiff', 'Download TIFF-file',class="downloadLinkgreen")
                        ),
                        selectInput("theme", "Plot Theme:",
                                    c("Tufte","Economist","Solarized","Stata","Excel 2003","Inverse Gray","Fivethirtyeight","Tableau","Stephen","Wall Street","GDocs","Calc","Pander","High
                                      charts")),
                plotOutput("GOplotRender",height="100%",width=800)
                
                )
                
              )
      ),
      tabItem("KeggPlot",
                fluidRow(
                  box(
                    width = 3, status = "info", solidHeader = TRUE,collapsible = TRUE,
                    title = "Data Input",
                    p("This tab function was developed for plotting ",code("TBtools.KEGG.enrichment.result.xls")," file, which output as KEGG pathway enrichment analysis result by TBtools.  Just clicked the ",code("Upload")," button and enjoy the plotting trip"),
                    
                    radioButtons("dataset2", strong("Dataset"), c(Example = "example", Upload = "upload"),selected = 'example'),
                    
                    conditionalPanel(
                      condition = "input.dataset2 == 'upload'",
                      fileInput('file2', 'Choose CSV/text File',
                                accept=c('text/csv', 'text/comma-separated-values,text/plain', '.csv')),
                      checkboxInput('header2', 'Header', FALSE),
                      radioButtons('sep2', 'Separator',
                                   c(Comma=',',
                                     Semicolon=';',
                                     Tab='\t'),
                                   '\t'),
                      radioButtons('quote2', 'Quote',
                                   c(None='',
                                     'Double Quote'='"',
                                     'Single Quote'="'"),
                                   '')
                    ),
                    # numericInput('geneMappedGo', 'Total Annotated Genes',13000,max=30000,min=0),
                    tags$button(id="keggPlot",type="button",class="btn btn-primary action-button","GO PLOT!"),
                    br(),
                    br(),
                    strong("This application was created by "),
                    tags$a(href="mailto:zhaoqi3@mail2.sysu.edu.cn",strong("Qi Zhao")),
                    strong(' from '),
                    tags$a(href="http://gps.biocuckoo.org/",strong("Ren Lab")),
                    strong(" in "),
                    tags$a(href="http://english.sysucc.org.cn/",strong("SYSUCC")),
                    strong('. Please let us know if you find bugs or have new feature request.This application uses the'),
                    tags$a(href="http://www.rstudio.com/shiny/",strong("shiny package from RStudio."))
                  ),
                  box(
                    width = 9, status = "success",solidHeader = TRUE,collapsible = TRUE,
                    title="Dataset",
                    DT::dataTableOutput("summaryKegg")
                  ),
                  bsModal("KEGGPlotModal", h3("Fancy Plot"), "keggPlot", size = "large",
                          div(
                            downloadLink('downloadDataKEGGPNG', 'Download PNG-file'),
                            downloadLink('downloadDataKEGGPDF', 'Download PDF-file',class="downloadLinkred"),
                            downloadLink('downloadDataKEGGEPS', 'Download EPS-file',class="downloadLinkblue"),
                            downloadLink('downloadDataKEGGtiff', 'Download TIFF-file',class="downloadLinkgreen")
                          ),
                          # selectInput("themekegg", "Plot Theme:",
                          #             c("Tufte","Economist","Solarized","Stata","Excel 2003","Inverse Gray","Fivethirtyeight","Tableau","Stephen","Wall Street","GDocs","Calc","Pander","High
                          #               charts")),
                          plotOutput("KEGGplotRender",height="100%",width=800)
                          
                                      )
                  
                )
      )
    )
  )
)
likelet/PlotAppForTBtools documentation built on May 21, 2019, 6:15 a.m.