-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.r
213 lines (177 loc) · 9.58 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# User interface ----
ui <- dashboardPage(
skin = "green",
title = "Wet AMD Risk Evaluation",
dashboardHeader(title = strong("WARE")),
dashboardSidebar(disable = F,
sidebarMenu(
menuItem(
"Genetic risk",
tabName = "gen"
),
menuItem(
"Non-genetic risk",
tabName = "env"
)
)),
dashboardBody(
tabItems(
tabItem(tabName = "gen",
fluidRow(
box(
title = strong("PERSONAL GENOTYPE"),
h4(style="text-align: justify;",
"Genes and SNPs are reported below. Add your genotype at each SNP and click on the “Execute” button."),
br()
),
box(
title = strong("INDIVIDUALIZED GENETIC AMD RISK"),
h4(style="text-align: justify;",
"Genetic risk for wet AMD is calculated according to", a("Cascella et al., 2018", href = "https://doi.org/10.18632/oncotarget.23241"), "and it ranges between 0.0002 and 3418.366. A graphical representation of your position in the scale of genetic risks is reported below.")
)
),
fluidRow(
box(
width = 2,
radioButtons(inputId = df$gene[1],
label = paste0(df$gene[1], " - ", unique(ref$snps[ref$gene == df$gene[1]])),
choices = ref$genotipi[ref$gene == df$gene[1]],
selected = character(0)),
radioButtons(inputId = df$gene[2],
label = paste0(df$gene[2], " - ", unique(ref$snps[ref$gene == df$gene[2]])),
choices = ref$genotipi[ref$gene == df$gene[2]],
selected = character(0)),
radioButtons(inputId = df$gene[3],
label = paste0(df$gene[3], " - ", unique(ref$snps[ref$gene == df$gene[3]])),
choices = ref$genotipi[ref$gene == df$gene[3]],
selected = character(0)),
height = radiobox_height
),
box(
width = 2,
radioButtons(inputId = df$gene[4],
label = paste0(df$gene[4], " - ", unique(ref$snps[ref$gene == df$gene[4]])),
choices = ref$genotipi[ref$gene == df$gene[4]],
selected = character(0)),
radioButtons(inputId = df$gene[5],
label = paste0(df$gene[5], " - ", unique(ref$snps[ref$gene == df$gene[5]])),
choices = ref$genotipi[ref$gene == df$gene[5]],
selected = character(0)),
radioButtons(inputId = df$gene[6],
label = paste0(df$gene[6], " - ", unique(ref$snps[ref$gene == df$gene[6]])),
choices = ref$genotipi[ref$gene == df$gene[6]],
selected = character(0)),
height = radiobox_height
),
box(width = 2,
radioButtons(inputId = df$gene[7],
label = paste0(df$gene[7], " - ", unique(ref$snps[ref$gene == df$gene[7]])),
choices = ref$genotipi[ref$gene == df$gene[7]],
selected = character(0)),
radioButtons(inputId = df$gene[8],
label = paste0(df$gene[8], " - ", unique(ref$snps[ref$gene == df$gene[8]])),
choices = ref$genotipi[ref$gene == df$gene[8]],
selected = character(0)),
br(),
br(),
br(),
actionButton(inputId = "execute",
label = "Execute"),
actionButton(inputId = "ResetButton",
label = "Reset"),
height = radiobox_height
),
box(
textInput(inputId = "inText",
label = "Genetic risk")
),
box(
title = strong("Genetic risk plot"),
plotOutput(outputId = "plot1",
height = plot1_height),
textInput(inputId = "riskText",
label = NULL,
value = "")
)
),
fluidRow(
box(
title = strong("CHART OF RISKS"),
h4(style="text-align: justify;",
"The pie charts report relative risks in AMD population and in general population. The red portion of the chart represents people with a risk higher than yours, the green portion represents people with a risk lower than yours, and the grey portion represents people with risk similar to yours.")
),
box(
title = strong("RISK DISTRIBUTION"),
h4(style="text-align: justify;",
"The graphics below represent the distribution of genotypes in AMD patients and general population. The dashed lines delimitate low and high risk zones, and the solid red line shows your individualized genetic risk according to genotypes reported in the “personal genotype” box."),
br()
)
),
fluidRow(
box(
plotOutput(outputId = "piecases",
height = pie_plot_height),
plotOutput(outputId = "piectrl",
height = pie_plot_height),
plotOutput(outputId = "pielegend",
height = pie_legend_height),
height = plotbox_height
),
box(
plotOutput(outputId = "densitycases",
height = density_plot_height),
plotOutput(outputId = "densityctrl",
height = density_plot_height),
height = plotbox_height
)
)
),
tabItem(tabName = "env",
fluidRow(
box(
title = strong("NON-GENETIC RISK EXPOSURE"),
h4(style="text-align: justify;",
"Non-genetic risk factors are reported below. Make your selection based on patient's profile and click on the “Execute” button."),
br(),
br()
),
box(
title = strong("INDIVIDUALIZED GENETIC AMD RISK"),
h4(style="text-align: justify;",
"Non-genetic risk factors are combined with genetic risk for wet AMD, calculated according to ", a("Cascella et al., 2018", href = "https://doi.org/10.18632/oncotarget.23241", .noWS = "after"), ". When genetic risk is combined with non-genetic risk it ranges between 0.0002 and 23313.26. A graphical representation of your position in the scale of combined non-genetic and genetic risks is reported below.")
)
),
fluidRow(
box(
radioButtons(inputId = df_env$factor[1],
label = df_env$factor[1],
choices = ref_env$Level[ref_env$Factor == df_env$factor[1]],
selected = character(0)),
radioButtons(inputId = df_env$factor[2],
label = df_env$factor[2],
choices = ref_env$Level[ref_env$Factor == df_env$factor[2]],
selected = character(0)),
actionButton(inputId = "execute_env",
label = "Execute"),
actionButton(inputId = "ResetButton_env",
label = "Reset"),
height = radiobox_height
),
box(
textInput(inputId = "envRisk",
label = "Non-genetic risk",
value = "")
),
box(
title = "Non-genetic risk plot",
plotOutput(outputId = "plot1_env",
height = plot1_height),
textInput(inputId = "riskText_env",
label = NULL,
value = "What's your non-genetic risk for AMD?")
)
)
)
)
)
)