-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.R
More file actions
executable file
·120 lines (95 loc) · 4.4 KB
/
Copy pathserver.R
File metadata and controls
executable file
·120 lines (95 loc) · 4.4 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
117
118
119
120
app_version <- readLines("VERSION")
#### Overall server for OmicsQ ###########
server <- function(input, output, session) {
SM <- make_state_manager(session)
# Declare dependency order so hydration is coherent
SM$set_ns_order(c("dataInput-", "expDesign-", "preProcessing-", "sendRetrieve-"))
onBookmark(SM$onBookmark)
onRestore(SM$onRestore)
onRestored(SM$onRestored)
## main data sets
log_operations <- reactiveVal(list(omicsQ_version = app_version))
# Register it as a reactiveVal (single) under a namespace, e.g. "global"
SM$register_vals("global", list(log_operations = log_operations))
##### READING DATA
dataInput <- dataInputServer(id="dataInput", parent=session, log_operations, SM)
##### EXPERIMENTAL DESIGN
expDesign <- expDesignServer(id="expDesign", parent=session, dataInput, log_operations, SM)
##### PRE-PROCESSING
preProcessing <- preProcessingServer("preProcessing", parent=session, expDesign, log_operations, SM)
##### SEND TO APPS
sendRetrieve <- sendRetrieveServer("sendRetrieve", preProcessing, log_operations, SM)
###### Logging all operations ######
observeEvent(input$h_log,{
showModal(modalDialog(
title = span(h3(strong("Summary of data transformations and used upload options"), style = 'font-size:16px;color:#6cbabf;')),
renderPrint(log_operations()),
downloadButton("download_log", "Download log as json file", class = "btn btn-primary")
# br(),
# p("To upload a log file and set all parameters to the values stored in the log, please use the button below."),
# fileInput("upload_log", label = "Upload log file (json format)",
# accept = c(".json"),
# buttonLabel = "Browse...",
# multiple = FALSE,
# width = "100%")
))
})
###### Download log file as json ######
output$download_log <- downloadHandler(
filename = function() {
paste("OmicsQ_log_", Sys.Date(), ".json", sep = "")
},
content = function(file) {
# Convert the log_operations to JSON format
json_data <- jsonlite::toJSON(log_operations(), pretty = TRUE, auto_unbox = TRUE)
writeLines(json_data, file)
}
)
###### When uploading log file, go back to reading file and set all parameters ######
###### Access to tutorial ######
observeEvent(input$h_tutorial,{
# Open tutorial in new tab
runjs("window.open('tutorial/Tutorial.html', '_blank')")
})
###### General info about app ######
observeEvent(input$h_about,{
showModal(modalDialog(
title = span(
h3(strong("OmicsQ: Quantitative analysis of Omics data")),br(),
p( strong("Features: "),
span("This web application facilitates the processing of quantitative data from Omics type experiments.
It is furthermore an entrypoint for using the following tools:"),
br(),
a("PolySTest", href = "https://computproteomics.bmb.sdu.dk/app_direct/PolySTest/", style = 'color:#6cbabf;'),
span(" for statistical testing"),
br(),
a("VSClust", href = "https://computproteomics.bmb.sdu.dk/app_direct/VSClust/", style = 'color:#6cbabf;'),
span(" for clustering, and"),
br(),
a("ComplexBrowser", href = "https://computproteomics.bmb.sdu.dk/app_direct/ComplexBrowser/", style = 'color:#6cbabf;'),
span(" for exploration of the behavior of protein complexes."),
br(),
strong("Version: "), app_version,br(),
style = 'font-size:16px; color:#6c2a3f;'
),
p(
strong("Source code:"),
a("https://github.com/computproteomics/OmicsQ", href = "https://github.com/computproteomics/OmicsQ", style = 'color:#6cbabf;'),
style = 'font-size:16px; color:#6c2a3f;'
),
p(
strong("What does the app do?"),
style = 'font-size:16px; color:#6c2a3f;'
),
tags$img(height = "1000px", src = "OmicsQWorkflow.svg"),
br(),
style = 'font-size:16px; color:#6c2a3f;'
),
size = "xl",
easyClose = TRUE
))
})
observeEvent(input$custom_bookmark, {
session$doBookmark()
})
}