-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_remote.R
More file actions
54 lines (51 loc) · 1.55 KB
/
init_remote.R
File metadata and controls
54 lines (51 loc) · 1.55 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
# Add this code example code to 'shiny' user .Rprofile on Shiny server
# to activate source of this file and use remote 'pcrfit_single'.
# Also set ssh access to remote server by key without passphrase.
# library(future)
# initRemote <- function() {
# login <- tweak(remote, workers = "user@server")
# plan(list(
# login,
# multiprocess
# ))
# }
# Overload of calcRunRes() function to use inside shiny_encu()
library(future)
library(listenv)
runType$set("public", "Preprocess",
function(bgRange, modelType, cqMethod, thrCq) {
self$react <-
value(
future(
{
y <- listenv()
for (reactN in self$react) {
y %<-% c(y, {
for (dat in reactN$data)
dat$Preprocess(bgRange, modelType, cqMethod, thrCq)
reactN
})
}
as.list(y)
})
)
# foreach(reactN = self$react) %dopar% {
# for (dat in reactN$data)
# dat$Preprocess(bgRange, modelType, cqMethod, thrCq)
# reactN
},
overwrite = TRUE)
calcRunRes <- function(ncol_data_RFU, data_RFU) {
value(
future(
{
y <- listenv()
for (ith_run in 1L:ncol_data_RFU) {
y[[ith_run]] %<-% {
pcrfit_single(data_RFU[, ith_run])
}
}
Reduce(rbind, y)
})
)
}