-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathui_analysis.R
executable file
·195 lines (169 loc) · 9.36 KB
/
ui_analysis.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
188
189
190
191
192
193
#########################################################################################################
tabPanel(
"Analysis",
h1(HTML('<font color="tomato" face="Comic Sans MS"><center><b>Run analysis</b></center></font>')),
conditionalPanel(
condition = 'input["analysis.step2.paired"] == null',
rnaseq2g.write.prompt("Set up an analysis in 3 steps.")
),
#########################################################################
#***** STEP 1 ******#
wellPanel(
rnaseq2g.write.header("Step 1. Upload a read count matrix"),
checkboxInput('analysis.step1.instruction', HTML('<u>Show instruction</u>'), value = TRUE),
conditionalPanel(
condition = 'input["analysis.step1.instruction"] == true',
style = 'padding: 5px',
div(
style="display: inline-block; width: 78%",
p(HTML(" - Count matrix can be obtained using tools such as <b>HTSeq-count</b> and <b>featureCounts</b>.")),
p(HTML(" - Unique gene IDs as row names and sample IDs as column names. (<b>Important! Unidentify sample IDs</b>)")),
div(style="display: inline-block;", HTML(" - Accepted file formats: ")),
div(style="display: inline-block;", downloadLink('analysis.step1.txt', '.txt, ')),
div(style="display: inline-block;", downloadLink('analysis.step1.tsv', '.tsv, ')),
div(style="display: inline-block;", downloadLink('analysis.step1.csv', '.csv, ')),
div(style="display: inline-block;", downloadLink('analysis.step1.rds', '.rds, ')),
div(style="display: inline-block;", downloadLink('analysis.step1.rdata', '.rdata, ')),
div(style="display: inline-block;", downloadLink('analysis.step1.rda', '.rda, ')),
div(style="display: inline-block;", downloadLink('analysis.step1.xlsx', '.xlsx, ')),
div(style="display: inline-block;", downloadLink('analysis.step1.xls', '.xls, ')),
div(style="display: inline-block;", HTML('and ')),
div(style="display: inline-block;", downloadLink('analysis.step1.html', '.html.')),
div(style="display: inline-block;", HTML(' (Click to download example)'))
),
div(style="display: inline-block; width: 1%", h6(HTML(''))),
div(
style="display: inline-block; width: 15%; vertical-align: top",
actionButton('analysis.load.example', 'Load an example', icon = icon('upload'), style=button.style2)
), br(), br()
),
fluidRow(column(6, fileInput(inputId = 'analysis.step1.upload', label = NULL))),
conditionalPanel(
condition = 'input["analysis.step2.paired"] == "Unpaired" || input["analysis.step2.paired"] == "Paired"',
h5(HTML('Loaded data:')),
DT::dataTableOutput('analysis.step1.table', width='100%'),
htmlOutput('analysis.step1.size')
)
),
#########################################################################
#***** STEP 2 ******#
# groups, paired, missing value, normalization
conditionalPanel(
condition = 'input["analysis.step2.paired"] == "Unpaired" || input["analysis.step2.paired"] == "Paired"',
wellPanel(
rnaseq2g.write.header("Step 2. Specify analysis parameters"),
checkboxInput('analysis.step2.instruction', HTML('<u>Show instruction</u>')),
conditionalPanel(
condition = 'input["analysis.step2.instruction"] == true',
style = 'padding: 5px',
p(HTML(" - Sample names must match column names in matrx.")),
p(HTML(" - Paired test requires the same number of samples in both group.")),
p(HTML(" - Paired test requires the paired samples to be in the same order.")),
p(HTML(" - Genes with total read counts less than the minimum will be excluded from the results.")),
p(HTML(" - Normalization will only applied to methods without their own internal normalization."))
),
wellPanel(
style = "border-color: darkgrey; border-style: dashed",
fluidRow(
h4(HTML('   Upload a file or type in the group and sample names:')),
column(
4,
div(style="display: inline-block;", HTML(" - Accept ")),
div(style="display: inline-block;", downloadLink('analysis.step2.txt', '.txt, ')),
div(style="display: inline-block;", downloadLink('analysis.step2.csv', 'csv, ')),
div(style="display: inline-block;", downloadLink('analysis.step2.rds', '.rds, ')),
div(style="display: inline-block;", downloadLink('analysis.step2.rdata', '.rdata, ')),
div(style="display: inline-block;", downloadLink('analysis.step2.xls', '.xls, ')),
div(style="display: inline-block;", HTML('or ')),
div(style="display: inline-block;", downloadLink('analysis.step2.xlsx', '.xlsx ')),
div(style="display: inline-block;", HTML('file.')),
p(),
fileInput(inputId = 'analysis.step2.group', label = NULL),
htmlOutput('analysis.step2.error')
),
column(
3,
textInput(inputId = 'analysis.step2.groupA', label = 'Control group name', value='Control'),
textInput(inputId = 'analysis.step2.groupB', label = 'Case group name', value='Case')
),
column(
5,
selectizeInput('analysis.step2.sampleA', 'Control samples', NULL, multiple=TRUE),
selectizeInput('analysis.step2.sampleB', 'Case samples', NULL, multiple=TRUE)
)
)
), br(),
fluidRow(
div(style="display: inline-block; width:30px", HTML("")),
div(style="display: inline-block; width: 200px",
radioButtons('analysis.step2.paired', label = 'Paired test', choices = c('Unpaired', 'Paired'), selected=character(0), inline = TRUE)),
div(style="display: inline-block; width:10px", HTML("")),
div(style="display: inline-block; width: 240px",
radioButtons('analysis.step2.missing', label = 'Missing value', choices = c('Remove gene', 'Replace with 0'), inline = TRUE)),
div(style="display: inline-block; width:20px", HTML("")),
div(style="display: inline-block; width: 160px",
selectizeInput('analysis.step2.norm1', label = 'Normalize count', choices = norm.count)),
div(style="display: inline-block; width:10px", HTML("")),
div(style="display: inline-block; width: 160px",
selectizeInput('analysis.step2.norm2', label = 'Normalize logged', choices = norm.logged))
),
fluidRow(
div(style="display: inline-block; width:30px", HTML("")),
div(style="display: inline-block; align: center; width: 90%", sliderInput('analysis.step2.filter', label = 'Minimal read count', 0, 300, 6, 1))
)
)
), # End of step2 panel
#########################################################################
#***** STEP 3 ******#
# groups, paired, missing value, normalization
conditionalPanel(
condition = 'input["analysis.step2.sampleB"] != null',
wellPanel(
rnaseq2g.write.header("Step 3. Choose one or multiple DE methods"),
checkboxInput('analysis.step3.instruction', HTML('<u>Show instruction</u>')),
conditionalPanel(
condition = 'input["analysis.step3.instruction"] == true',
style = 'padding: 5px',
p(HTML(" - Choose one or more DE methods using the check boxes.")),
p(HTML(" - The default methods take about 1 minute in total.")),
p(HTML(" - Save analysis ID to retrieve results later when using any slow methods.")),
h3(HTML("<b>Method description</b>")),
DT::dataTableOutput('analysis.step3.methods', width='100%')
),
#uiOutput('analysis.step3.sel'),
wellPanel(
style = "border-color: darkgrey; border-style: dashed",
rnaseq2g.method.checkbox(DeRNAseqMs[, 1])
# source('ui_analysis_methods.R', local=TRUE)$value
# checkboxGroupInput('analysis.step3.selection', label = "Select DE methods", choices = DeRNAseqMs[[1]], selected = NULL, inline = TRUE),
),
radioButtons('analysis.step3.group', 'Or pick a method group:', method.group, inline = TRUE, width = '90%')
# uiOutput('analysis.step3.panel1'),
# uiOutput('analysis.step3.panel2')
)
),
#########################################################################
p(),
conditionalPanel(
condition = rnaseq2g.method.condition(DeRNAseqMs[[1]]),
wellPanel(
style = "border-color: lightgrey; border-width: 3px; border-radius: 10px;",
fluidRow(
column(12, htmlOutput("analysis.submitting.message")),
column(12, htmlOutput("analysis.run.message")),
div(style="display: inline-block;", HTML("   ")),
div(style="display: inline-block;", actionButton("analysis.run", 'Submit DE analysis', width='240px', icon("paper-plane"), style=button.style)),
div(style="display: inline-block;", HTML("   ")),
div(style="display: inline-block;", htmlOutput("analysis.id.message")),
hr(),
column(
12,
div(style="display: inline-block;", textInput('analysis.send.email', label=NULL, width='240px')),
div(style="display: inline-block;", HTML("   ")),
div(style="display: inline-block;",
HTML("<font size='3'>Send a notice to this email address after the analysis is done (optional).</font>"))
)
)
)
)
)