-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.R
More file actions
116 lines (110 loc) · 4.27 KB
/
ui.R
File metadata and controls
116 lines (110 loc) · 4.27 KB
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
library(shiny)
library(DT)
library(plotly)
shinyUI(
# Include Google Analytics in the header
tagList(
#tags$head(
# includeHTML('www/google_analytics.html')
#),
# App UI
fluidPage(
theme = 'bootstrap.yeti.css',
title = 'Metabolomics Analysis',
# Center the logo
tags$head(tags$style(
type='text/css',
'#logo img {max-width: 30%; height: auto; display: block; margin: auto}')
),
imageOutput('logo', height = 'auto'),
br(),
# Sidebar
sidebarLayout(
sidebarPanel(
conditionalPanel(
'input.tabs === "Upload data"',
'Upload metabolomics data',
hr(),
fileInput('input_file', label = 'Select .csv file for upload'),
span(textOutput('num_NAs'), style = 'color: #CFB87B;'),
uiOutput('replace_NAs'),
hr(),
helpText('Check below if data needs to be transposed so that each row corresponds to a sample'),
checkboxInput('checkbox_transform', label = 'Transpose', value = F),
checkboxInput('checkbox_headers', label = 'File has headers', value = T),
selectInput('select_sample_column', label = 'Select sample ID column (gold)',
choices = NULL),
selectizeInput('select_covar_columns', label = 'Select covariate(s) (grey)',
choices = NULL, multiple = T),
checkboxInput('checkbox_log2', label = 'log2 transform numeric data', value = F),
span(textOutput('log_message'), style = 'color: #CFB87B;'),
br(),
actionButton('button_save_params', 'Save analysis parameters',
style = 'margin-bottom: 10px;'),
br(),
span(textOutput('save_message'), style = 'color: #CFB87B;'),
textOutput('save_sample'),
textOutput('save_covars')
),
conditionalPanel(
'input.tabs === "Principal components analysis"',
'Create PCA plot',
hr(),
selectInput('select_color_column', label = 'Color points by',
choices = NULL),
selectInput('select_shape_column', label = 'Shape points by',
choices = NULL),
downloadButton('download_PCA', label = 'Download plot (PDF)')
),
conditionalPanel(
'input.tabs === "Differential abundance"',
helpText('Download results')
),
conditionalPanel(
'input.tabs === "Correlations"',
'Create correlation plot',
hr(),
selectInput('compound1', 'Compound 1', choices = NULL),
selectInput('compound2', 'Compound 2', choices = NULL),
radioButtons('corr', 'Correlation method',
choices = c('spearman', 'pearson'),
selected = 'spearman'),
selectInput('select_color_column2', label = 'Color points by',
choices = NULL),
selectInput('select_shape_column2', label = 'Shape points by',
choices = NULL),
downloadButton('download_corr', label = 'Download plot (PDF)',
style = 'margin-bottom: 10px;'),
downloadButton('download_corr_tab', label = 'Download table (CSV)')
)
),
# Main panel
mainPanel(
tabsetPanel(
id = 'tabs',
tabPanel('Upload data',
br(),
strong(span(textOutput('upload_message'),
style = 'color: #CFB87B;')),
br(),
DT::dataTableOutput('dt_preview')),
tabPanel('Principal components analysis',
br(),
strong(span(textOutput('pca_message'),
style = 'color: #CFB87B;')),
plotlyOutput('PCA_plot')),
#tabPanel('Differential abundance',
# br(),
# 'TODO'),
tabPanel('Correlations',
br(),
strong(span('Correlation plot',
style = 'color: #CFB87B;')),
plotlyOutput('corr_plot'),
br(),
DT::dataTableOutput('corr_table'))
)
) # end mainPanel
) # end sidebarLayout
)) # end fluidPage
)