-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathui.R
189 lines (180 loc) · 12.1 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
library(shinyjs)
library(plotly)
library(colourpicker)
library(shinythemes)
library(V8)
# Define UI for application that draws a histogram
shinyUI(
fluidPage(theme = shinytheme('lumen'),
useShinyjs(),
img(src='Vasco_2.png', align = "left", height=100),
hr(),
tags$head(
tags$style(HTML("
p, li {
/**font-family: 'Lora', 'Times New Roman', serif;**/
font-size: 20px;
color: #404040;
line-height: 1.2;
}
#title {
font-size: 60px;
}
p#titledescript {
font-size: 16px;
font-style: italic;
}
li {
font-size: 16px;
}
body {
padding: 0 2.5em 0 2.5em;
}
li p {
margin: 0;
padding: 0.1em;
}
p + ul {
margin-top: -10px;
}
"))
),
extendShinyjs(text = "shinyjs.refresh = function() { redir_Str = window.location.href.split('?')[0] + '?compare'; window.location.href = redir_Str ; }"),
# Application title
titlePanel('VASCO'),
#titlePanel(h1("VASCO", id="title")),
p("Visualization App for Single Cells explOration", id="titledescript"),
tabsetPanel( id = "main_panel",
# main panel for tSNE plot and group selection
tabPanel('Summary',
id = "tSNE",
# selected button!!
fluidRow(
br(),
# welcome text
column(8, offset = 1,
tags$div(
tags$p("This application facilitates real-time data visualization and exploration of single cell RNA-seq data.
It takes the gene-barcode matrix and the clustering result as input."),
tags$p("Users can:")
),
tags$ul(
tags$li("visualize the cells using t-distributed stochastic neighbour embedding (t-SNE) plots"),
tags$li("explore the expression pattern of specific genes"),
tags$li("investigate the identity of cell clusters by examining genes that are specific to a cluster")
)),
# main window plots
column(8,
plotlyOutput('tSNEPlot',height = '600px'),
# we may not want the barchart displayed; see issue#30
# plotlyOutput('countPerCluster'),
br(),
offset=2)
)),
# panel for displaying individual gene expression data
tabPanel('Visualize genes',
id = "geneEpxr",
column(4, wellPanel(selectizeInput('input_genes', h1('Select genes'),
choices = list_of_genesymbols,
options = list(maxItems = geneExpr_maxItems),
selected = c('LGALS1_ENSG00000100097'),
multiple = TRUE),
actionButton("exprGeneButton", "Visualize"),
div(id = 'tsneHeatmapOptions',
sliderInput("MinMax", label= h5("Adjust heatmap color scale:"), min = 0, max = 1, value = c(0,0.4), step= 0.02),
sliderInput("Midpoint", label= h5("Adjust midpoint of color scale:"), min = 0, max = 1, value = 0.1, step= 0.02),
colourInput("colmax", "Select color of scale maximum", value = geneExpr_colorMax),
colourInput("colmid", "Select color of scale midpoint", value = geneExpr_colorMid),
colourInput("colmin", "Select color of scale minimum", value = geneExpr_colorMin)
)
)
),
column(8,
tabsetPanel(id ='exprVis',
tabPanel('tSNE heatmap', value = 'tSNE',
uiOutput("geneExprPlot")),
tabPanel('Box plots', value = 'box',
plotlyOutput("geneExprGeneCluster"))))
),
# exploration of selection
tabPanel( 'Explore clusters',
id= 'Compare',
tabsetPanel(tabPanel('Compare',
column(3,wellPanel(
h4(id = "select_text", "Please select first group"),
actionButton(inputId = "pop_one_selected", label = "Save group 1"),
actionButton(inputId = "pop_two_selected", label = "Save group 2"),
br(),
div( id = 'definedInputSelection',
checkboxInput(inputId = 'selectDefinedGroup',
value = F,
label = 'Select predefined cluster(s) for group 1'),
checkboxGroupInput(inputId = 'whichGroups',
label = 'Predefined clusters:',
choices = unique(tsne$id) %>% sort)
),
downloadButton(outputId = 'downloadDifGenes', label = 'Download'),
br(),
br(),
actionButton(inputId = "reload", label = "Select new groups"))),
column(9,
div(id= "div_select_one", plotlyOutput('tSNE_select_one',height = '600px')),
div(id = "div_select_two", plotlyOutput('tSNE_select_two',height = '600px')),
dataTableOutput('difGeneTable'),
div(id= 'comparisonOutput',
tabsetPanel(tabPanel('Visualize genes',
id = "histPlot",
plotlyOutput('histPlot', height = '500px')),
tabPanel('Visualize selected groups',
id = 'tSNE plot',
plotlyOutput('tSNE_summary'),
plotlyOutput('cell_type_summary')
)
)
)
)),
tabPanel('Create',
column(3,
textInput(inputId = 'newClusterName',label ='New name'),
h4(id = 'selectTextForRename', 'Please select group to rename'),
actionButton(inputId = 'renamePoulationButton',label = 'Rename Selection'),
checkboxInput(inputId = 'selectDefinedGroupForRename',
value = F,
label = 'Select predefined cluster(s)'),
checkboxGroupInput(inputId = 'whichGroupsForRename',
label = 'Predefined clusters:',
choices = unique(tsne$id) %>% sort)),
column(9,
plotlyOutput('tSNE_selectForRename',height = '600px')))
)
),
tabPanel( 'Upload data',
id= 'upload',
sidebarPanel(fileInput('barcodes_file', 'Barcodes .tsv File',
accept=c('text/tsv',
'text/comma-separated-values,text/plain',
'.tsv')),
fileInput('genes_file', 'Genes .tsv File',
accept=c('text/tsv',
'text/comma-separated-values,text/plain',
'.tsv')),
fileInput('tsne_file', 'tsne tdf File',
accept = NULL),
fileInput('mtx_file', 'Expression matrix .mtx File',
accept=c(
'.mtx')),
actionButton(inputId = "upload_button", label = "Submit Data")
)
)
)
)
)