app_ui.R 3.27 KB
Newer Older
mahendra-mariadassou's avatar
mahendra-mariadassou committed
1
#' @import shiny
2
3
#' @import shinycssloaders
#' @import shinydashboard
Sandra Derozier's avatar
Sandra Derozier committed
4
#' @import shinyjs
mahendra-mariadassou's avatar
mahendra-mariadassou committed
5
6
7
8
app_ui <- function() {
  tagList(
    # Leave this function for adding external resources
    golem_add_external_resources(),
9
10
11
12
13
14
15
16
    
    dashboardPage(skin = "purple",
      # DashBooard Header
      dashboardHeader(
        title = "Affiliation explorer"
      ),
      # DashBooard Sidebar
      dashboardSidebar(
17
18
19
        fluidPage(
          fileInput("biom",
                    "Upload Biom File",
20
                    accept = c(".biom", ".biom1")
21
                   ),
22
23
          fileInput("fasta",
                    "Optional: upload Fasta File",
24
                    accept = c("text/plain", ".fasta", ".fst")
25
          ),
26
27
          fileInput("tsv",
                    "Upload MultiHits TSV File",
28
                    accept = c("text/tab-separated-values", ".tsv")
29
30
31
32
33
                   ),
          HTML("<br/>"),
          downloadButton("download", "Download", class="butt"),
          tags$head(tags$style(".butt{color: black !important; margin-left: 16px; }"))
        )
34
35
36
      ),
      # DashBooard Body
      dashboardBody(
37
38
39
40
41
42
43
44
45
46
        tags$style(HTML("
          .tabbable > .nav > li > a               { background-color: #3c8dbc; color:white; font-size: 17px; }
          .tabbable > .nav > li[class=active] > a { background-color: white; color:#3c8dbc; font-size: 17px; }
          ")),
        tabsetPanel(
          tabPanel("Affiliation selection",
            useShinyjs(),
            fluidRow(
              box(
                width = 12,
47
                solidHeader = T,
Sandra Derozier's avatar
Sandra Derozier committed
48
                htmlOutput("tmptxt"),
49
                div(style="display: inline-block; width: 100px;",
50
                    selectInput("asv", label = "Select OTU", choices = c(), multiple = FALSE)),
51
                div(style="display: inline-block; margin-left: 75%;",
52
                    actionButton("clean", "Update OTU", class="butt2")),
53
                div(style="display: inline-block;",
54
                    actionButton("skip", "Skip OTU", class="butt3")),
55
56
                tags$head(tags$style(".butt2{margin-bottom: 28px; align: right;}")),
                tags$head(tags$style(".butt3{margin-bottom: 28px; align: right;}")),
57
                htmlOutput("txt"),
Sandra Derozier's avatar
Sandra Derozier committed
58
                htmlOutput("help"),
59
                HTML("<br/>"),
60
                # htmlOutput("aln_info"),
Sandra Derozier's avatar
Sandra Derozier committed
61
                DT::DTOutput("table"),
Sandra Derozier's avatar
Sandra Derozier committed
62
                htmlOutput("sequence"),
63
64
65
66
67
68
69
70
71
72
73
74
                htmlOutput("selection")
              )
            )
          ),
          tabPanel("Affiliation edition", 
            fluidRow(
              box(
                width = 12,
                solidHeader = T,
                htmlOutput("tmptxt2"),
                DT::DTOutput("tableFull")
              )
75
            )
76
          )
77
78
        )
      )
mahendra-mariadassou's avatar
mahendra-mariadassou committed
79
80
81
82
83
84
85
    )
  )
}

#' @import shiny
golem_add_external_resources <- function(){
  
86
87
  tags$link(rel="stylesheet", type="text/css", href="www/custom.css")
  
mahendra-mariadassou's avatar
mahendra-mariadassou committed
88
89
90
91
92
93
94
95
96
97
98
99
100
  addResourcePath(
    'www', system.file('app/www', package = 'affiliationExplorer')
  )
 
  tags$head(
    golem::activate_js(),
    golem::favicon()
    # Add here all the external resources
    # If you have a custom.css in the inst/app/www
    # Or for example, you can add shinyalert::useShinyalert() here
    #tags$link(rel="stylesheet", type="text/css", href="www/custom.css")
  )
}