-
Notifications
You must be signed in to change notification settings - Fork 0
/
module_filters.R
105 lines (101 loc) · 4.91 KB
/
module_filters.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
# UI module
filtersBoxUI <- function(id, Dtype){
ns <- NS(id)
# Filter box
if (Dtype == "DE"){
value_box(value = "",
title = "Filters",
fluidRow(
column(width = 6, align = "center",
sliderInput(inputId = ns("log2fc_threshold"),
label = "Log2FC Threshold:",
min = 0, max = 3, value = 0, step = 0.5)),
column(width = 6, align = "center",
sliderTextInput(inputId = ns("padj_threshold"),
label = "padj Threshold:",
choices = c(0.01, 0.05, "NONE"),
selected = "NONE",
grid = TRUE))
),
br(),
fluidRow(
column(width = 2, align = "left",
p("\t")), # Empty space to adjust alignement of buttons
column(width = 4, align = "left",
radioButtons(inputId = ns("DEside"),
label = "DE type:",
choices = c("Down Regulated" = "down",
"Up Regulated " = "up",
"Both " = "both"),
selected = "both")),
column(width = 2, align = "left",
p("\t")), # Empty space to adjust alignement of buttons
column(width = 4, align = "left",
checkboxGroupInput(inputId = ns("cancer_types"),
label = "Cancer:",
choices = c("Melanoma",
"Lung",
"Prostate",
"Glioblastoma"),
selected = c("Melanoma",
"Lung",
"Prostate",
"Glioblastoma"))
)
)
)
} else if (Dtype == "DU"){
value_box(value = "",
title = "Filters",
fluidRow(
column(width = 6, align = "center",
sliderInput(inputId = ns("log2fc_threshold"),
label = "dIF Threshold:",
min = 0, max = 1, value = 0, step = 0.1)),
column(width = 6, align = "center",
sliderTextInput(inputId = ns("padj_threshold"),
label = "qvalue Threshold:",
choices = c(0.01, 0.05, "NONE"),
selected = "NONE",
grid = TRUE))
),
br(),
fluidRow(
column(width = 2, align = "left",
p("\t")), # Empty space to adjust alignement of buttons
column(width = 4, align = "left",
radioButtons(inputId = ns("DEside"),
label = "DE type:",
choices = c("Down Regulated" = "down",
"Up Regulated " = "up",
"Both " = "both"),
selected = "both")),
column(width = 2, align = "left",
p("\t")), # Empty space to adjust alignement of buttons
column(width = 4, align = "left",
checkboxGroupInput(inputId = ns("cancer_types"),
label = "Cancer:",
choices = c("Melanoma",
"Lung",
"Prostate",
"Glioblastoma"),
selected = c("Melanoma",
"Lung",
"Prostate",
"Glioblastoma")
))
)
)
}
}
filtersBoxServer <- function(id) {
moduleServer(id = id,
module = function(input, output, session) {
return(list(
DEside = reactive(input$DEside),
log2fc_threshold = reactive(input$log2fc_threshold),
padj_threshold = reactive(input$padj_threshold),
cancer_types = reactive(input$cancer_types)
))
})
}