forked from Ulas-lab/Shiny-Seq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Boxplot.R
76 lines (66 loc) · 1.97 KB
/
Boxplot.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
source("functions.R")
Boxplot_module_UI<-function(id)
{
ns<-NS(id)
tagList(
downloadButton(ns('download_boxplot'), 'Download plot'),
plotOutput(ns("boxplot")),
fluidRow(column (7,uiOutput(ns("annotation"))))
)
}
Boxplot_module<-function(input,output,session,data)
{
output$annotation <-
renderUI({
print("create Checkbox boxplot")
checklist = list()
for (i in seq_along(colnames(data[[2]]))) {
checklist[[colnames(data[[2]])[[i]]]] = i
}
radioButtons(session$ns("annotation"), "Choose the annotation", checklist)
})
output$boxplot<-renderPlot({
print(head(data[[1]]))
req(input$annotation)
boxplot_output(data[[1]],data[[2]],input$annotation)
})
output$download_boxplot <- downloadHandler(
filename = function(){
paste('Boxplot of Raw data.png')
},
content = function(file) {
png(file)
boxplot_output(data[[1]],data[[2]],input$annotation)
dev.off()
})
return(reactive({req(input$annotation)
boxplot_output(data[[1]],data[[2]],input$annotation)}))
}
Boxplot_module2<-function(input,output,session,data)
{
output$annotation <-
renderUI({
print("create Checkbox boxplot")
checklist = list()
for (i in seq_along(colnames(data[[2]]))) {
checklist[[colnames(data[[2]])[[i]]]] = i
}
radioButtons(session$ns("annotation"), "Choose the annotation", checklist)
})
output$boxplot<-renderPlot({
print(head(data[[1]]))
req(input$annotation)
boxplot_output(data[[1]],data[[2]],input$annotation)
})
output$download_boxplot <- downloadHandler(
filename = function(){
paste('Boxplot of normalized data.png')
},
content = function(file) {
png(file)
boxplot_output(data[[1]],data[[2]],input$annotation)
dev.off()
})
return(reactive({req(input$annotation)
boxplot_output(data[[1]],data[[2]],input$annotation)}))
}