-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.R
107 lines (84 loc) · 3.89 KB
/
Main.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
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
###############################################################################
## setwd("~/eclipse/workspaces/Networks")
## setwd("c:/eclipse/workspaces/Networks")
## source("Ganetto/Main.R")
##
## http://manuals.bioinformatics.ucr.edu/home/programming-in-r#Progr_class
## http://www.stat.auckland.ac.nz/S-Workshop/Gentleman/S4Objects.pdf
## https://www.rmetrics.org/files/Meielisalp2009/Presentations/Chalabi1.pdf
## http://www.inside-r.org/r-doc/methods/ReferenceClasses
##
## @author Vincent Labatut
## @version 3
###############################################################################
options(error=dump.frames)
os <- .Platform$OS.type
if(os=="windows") dataRoot <- "c:/temp" else dataRoot <- "/var/data/algotest"
library(igraph)
source("Ganetto/common/collections.R")
source("Ganetto/common/constants.R")
source("Ganetto/common/files.R")
source("Ganetto/common/networks.R")
source("Ganetto/common/probabilities.R")
# misc tests
#source("Ganetto/common/testNetworks.R")
# parameter tree
source("Ganetto/parameter/Parameter.R")
#source("Ganetto/parameter/TestParameter.R")
# network formats
source("Ganetto/networkformat/NetworkFormat.R")
#source("Ganetto/networkformat/TestNetworkFormat.R")
# community structure
source("Ganetto/comstruct/Comstruct.R")
#source("Ganetto/comstruct/TestComstruct.R")
# community formats
source("Ganetto/comstructformat/ComstructFormat.R")
#source("Ganetto/comstructformat/TestComstructFormat1.R")
#source("Ganetto/comstructformat/TestComstructFormat2.R")
# generative models
source("Ganetto/generation/GenerativeModel.R")
source("Ganetto/generation/TestGenerativeModel.R")
# community detection
source("Ganetto/detection/CommunityDetector.R")
#source("Ganetto/detection/TestCommunityDetector0.R")
#source("Ganetto/detection/TestCommunityDetector1.R")
#source("Ganetto/detection/TestCommunityDetector2.R")
source("Ganetto/detection/TestCommunityDetector3.R")
# TODO com.det algos need an option allowing not output
# all hierarchical levels (when there are several ones)
# -> need to define a class to represent performance processing
# and allow a com.det object to be set with it, and use
# it to select the best level on the fly.
# TODO
# set of community structures (multilevel):
# > result-oriented representation
# > list containing CommunityStructure objects
# > possible to process the community of a node at each level
# > store the best comstruct
# > possible to store the measures used to select the best comstruct (eg. modularity)
# TODO
# all network transformations must also transform the community structure refernce file in case
# one wants to apply a community detection algo on the resulting network (eg giant component)
# TODO
# each network "processing module" must have a "getFolderStructure" function which
# returns the updated parameter tree with all additional stuff. eg, com.det will
# add the algo name folder and level folders.
# processing modules: generators, filters, community detectors (each com is a new network)
# TODO
# LFR rewiring can be considered as a transformation.
# a transformation outputs a network and possibly an updated reference community structure
# (if there was one before before the transformation)
# line graphs is also a transformation (but without community structure (?)).
# TODO
# things to add eventually:
# - check how a comdet algo behaves when there're several components,
# and possibly force it to consider components as different levels
# - implement some repetitive process and merge the result to get stability
# with very instable algos such as label propagation.
# TODO
# What to do with nodes without any community?
# should they be forced to NA in our internal representation,
# or counted as size-one communities?
# -> the first solution will cause problems when comparing comstructs
# using partition-based methods.
warnings()