-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaggregation.r
60 lines (52 loc) · 1.4 KB
/
aggregation.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
library(FCI.Utils)
library(pcalg)
library(igraph)
library(RBGL)
library(rje)
library(graph)
library(doFuture)
library(gtools)
library(rIOD)
n_cores <- 8
plan("multicore", workers = n_cores, gc=TRUE)
labelList <- list()
aggregate_ci_results <- function(labelList_, ci_data, alpha) {
labelList <<- labelList_
suffStat <- list()
suffStat$citestResultsList <- ci_data
suffStat$labelList <- labelList
# call IOD.
#alpha <- 0.05
iod_out <- IOD(labelList, suffStat, alpha)
index <- 1
iod_out$G_PAG_Label_List <- list()
for (gpag in iod_out$G_PAG_List) {
iod_out$G_PAG_Label_List[[index]] <- colnames(gpag)
index <- index + 1
}
index <- 1
iod_out$Gi_PAG_Label_List <- list()
for (gipag in iod_out$Gi_PAG_List) {
iod_out$Gi_PAG_Label_List[[index]] <- colnames(gipag)
index <- index + 1
}
iod_out
}
iod_on_ci_data <- function(labelList_, suffStat, alpha) {
labelList <<- labelList_
suffStat$labelList <- labelList
iod_out <- IOD(labelList, suffStat, alpha)
index <- 1
iod_out$G_PAG_Label_List <- list()
for (gpag in iod_out$G_PAG_List) {
iod_out$G_PAG_Label_List[[index]] <- colnames(gpag)
index <- index + 1
}
index <- 1
iod_out$Gi_PAG_Label_List <- list()
for (gipag in iod_out$Gi_PAG_List) {
iod_out$Gi_PAG_Label_List[[index]] <- colnames(gipag)
index <- index + 1
}
iod_out
}