forked from tercen/heatmap_dashboard_operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
110 lines (101 loc) · 3.77 KB
/
ui.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
library(shiny)
library(shinydashboard)
library(shinyjs)
library(colourpicker)
cp1 <- conditionalPanel(
condition = "input.side == 'axo'",
fluidRow(
box(width = 4,
selectInput("clusterx",label = "column order", choices = c("cluster", "native", "sort", "correlate")),
checkboxInput("doclab", label = "columns labels", value = TRUE),
conditionalPanel(condition = "input.doclab == 1",
selectInput("columnlab", label = "", choices = ""),
sliderInput("clsize", label = "", min = 0, max = 16, step = 1, value = 9)
)
)
,
box(width = 4,
selectInput("clustery", label = "row order", choices = c("cluster", "native", "sort", "correlate")),
checkboxInput("dorlab", label = "row labels", value = TRUE),
conditionalPanel(condition = "input.dorlab == 1",
selectInput("rowlab", label = "", choices = ""),
sliderInput("rlsize", label = "", min = 0, max = 16, step = 1, value = 9)
)
)
))
cp2 <- conditionalPanel(
condition = "input.side == 'axann'",
fluidRow(
box(width = 4,
selectInput("xannotation", label = "Column Annotation",choices = "", multiple = TRUE)
),
box(width = 4,
selectInput("yannotation", label = "Row Annotation", choices = "", multiple = TRUE)
)
)
)
cpcp = conditionalPanel(
condition = "input.paltype == 'Divergent'",
fluidRow(
box(width = 2, numericInput("dvmax", label = "Max", value = 1),
numericInput("dvmid", label = "Mid", value = 0),
numericInput("dvmin", label = "Min", value = -1)),
box(width = 1, colourInput("dcmax", label = "", value = "#7a040e", showColour = "background"),
colourInput("dcmid", label = "", value = "#dce37d", showColour = "background"),
colourInput("dcmin", label = "", value = "#04035e", showColour = "background")
)
)
)
cpcs = conditionalPanel(
condition = "input.paltype == 'Continuous'",
fluidRow(
box(width = 2,
selectInput("cmap", label = "Scale name", choices = c("viridis", "jet")),
numericInput("csmax", label = "Max", value = 1),
numericInput("csmin", label = "Min", value = 0))
)
)
cp3 <- conditionalPanel(
condition = "input.side == 'palette'",
fluidRow(
box(width = 3,
selectInput("paltype", label = "Palette type",choices = c("Divergent", "Continuous"), selected = "Continuous")
),
cpcp,
cpcs
)
)
ui = shinyUI
(
fluidPage
(
ui <- dashboardPage
(
dashboardHeader(title = "Heatmap Dash"),
dashboardSidebar(
sidebarMenu(id = "side",
menuItem("Home", tabName = "home", icon = icon("home")),
menuItem("Rows & Columns", tabName = "axo", icon = icon("sort")),
menuItem("Axis annotation", tabName = "axann", icon = icon("th")),
menuItem("Palette", tabName = "palette", icon = icon("palette"))
),
tags$hr(),
sliderInput("plotWidth", "Plot width (px)", 200, 2000, 1200),
sliderInput("plotHeight", "Plot height (px)", 200, 2000, 800),
tags$hr(),
HTML(paste("<center><h5>Click to send the ordering data to Tercen</h5>", actionButton("runBtn", "Transform data", disabled = TRUE)),"</center>")
)
,
dashboardBody(
fluidRow(cp1, cp2, cp3),
downloadButton("downloadPlotPDF", "Download pdf"),
downloadButton("downloadPlotPNG", "Download png"),
div(style="height: 4px;"),
uiOutput("plot")
)
),
shinyjs::useShinyjs(),
tags$script(HTML('setInterval(function(){ $("#hiddenButton").click(); }, 1000*30);')),
tags$footer(shinyjs::hidden(actionButton(inputId = "hiddenButton", label = "hidden"))),
)
)