-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_all.jl
38 lines (33 loc) · 1.03 KB
/
run_all.jl
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
include("required.jl")
include("functions.jl")
### Load data, Clean and convert data to right types ###
df = CSV.read("WoodEtal_Append1_v2.csv")
edgelist_T = load_data(df, 1)
edgelist_Q = load_data(df, 2)
edgelist_A = load_data(df, 3)
edgelist_L = load_data(df, 4)
edgelist_S = load_data(df, 5)
# Rename IDS to start at 1
keys_T = renameIDs(edgelist_T)
keys_Q = renameIDs(edgelist_Q)
keys_A = renameIDs(edgelist_A)
keys_L = renameIDs(edgelist_L)
keys_S = renameIDs(edgelist_S)
# Compute adjacency matrix
M_T = adjacencyMatrix(keys_T)
M_Q = adjacencyMatrix(keys_Q)
M_A = adjacencyMatrix(keys_A)
M_L = adjacencyMatrix(keys_L)
M_S = adjacencyMatrix(keys_S)
# Compute LP/BRIM
Q_T, Qr_T, B_T = computeModularity(M_T)
Q_Q, Qr_Q, B_Q = computeModularity(M_Q)
Q_A, Qr_A, B_A = computeModularity(M_A)
Q_L, Qr_L, B_L = computeModularity(M_L)
Q_S, Qr_S, B_S = computeModularity(M_S)
# Compute spectral radius
ρ_T = computeNestedness(B_T)
ρ_Q = computeNestedness(B_Q)
ρ_A = computeNestedness(B_A)
ρ_L = computeNestedness(B_L)
ρ_S = computeNestedness(B_S)