-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.R
79 lines (68 loc) · 1.84 KB
/
server.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
function(input, output, session) {
# Attempt at bookmarking: failed !!!
# setBookmarkExclude("bookmark")
# observeEvent(input$bookmark, {
# session$doBookmark()
# })
# session$onSessionEnded(stopApp)
# Initialize ####
if (!dir.exists("outputDir")) {
dir.create("outputDir", showWarnings = FALSE)
}
projConfig <- NULL
S0_in <- NULL
RawData <- NULL
masksBaseline <- c()
masksDl <- c()
masksWl <- c()
Inputs <- reactiveValues()
initInputs = function() {
Inputs$gotData <<- FALSE
Inputs$process <<- FALSE
Inputs$finish <<- FALSE
Inputs$validData <<- TRUE
Inputs$fileOrig <<- NULL
Inputs$matOrig <<- NULL
Inputs$wavlOrig <<- NULL
Inputs$delayOrig <<- NULL
Inputs$dlScaleFacOrig <<- NULL
Inputs$baselineMask <<- NA
Inputs$delayMask <<- NA
Inputs$wavlMask <<- NA
Inputs$maskSpExp <<- NA
Inputs$mat <<- NULL
Inputs$wavl <<- NULL
Inputs$delay <<- NULL
Inputs$delaySave <<- NULL # True delays used in saved kinetics
Inputs$delayId <<- NA # Pointer to original matrices
Inputs$delayGlitch <<- NA # List of glitches to mask
}
initInputs()
checkInputsSanity <- function() {
listIn <- reactiveValuesToList(Inputs)
nulVec <- unlist(lapply(listIn, is.null))
# print(listIn)
noNull <- !any(nulVec)
return(noNull)
}
# Load Server files ####
files <- c(
"getData.R",
"sliders.R",
"project.R",
"selectAreaAndMasks.R",
"SVD.R",
"ALS.R",
"kinetHypercubeTransfo.R",
"kinetParsers.R",
"kinetSpectrokineticModel.R",
"kinetBayesian.R",
"kinetInterface.R",
"report.R"
)
for (f in files)
source(
file.path("server_files", f),
local = TRUE
)
}