This function finds communities in a (un)weighted (un)directed network based on the OSLOM algorithm (http://oslom.org/, version 2.4).
netclu_oslom(
net,
weight = TRUE,
cut_weight = 0,
index = names(net)[3],
seed = NULL,
reassign = "no",
r = 10,
hr = 50,
t = 0.1,
cp = 0.5,
directed = FALSE,
bipartite = FALSE,
site_col = 1,
species_col = 2,
return_node_type = "both",
binpath = "tempdir",
path_temp = "oslom_temp",
delete_temp = TRUE
)A list of class bioregion.clusters with five slots:
name: character containing the name of the algorithm
args: list of input arguments as provided by the user
inputs: list of characteristics of the clustering process
algorithm: list of all objects associated with the
clustering procedure, such as original cluster objects
clusters: data.frame containing the clustering results
In the algorithm slot, users can find the following elements:
cmd: the command line use to run OSLOM
version: the OSLOM version
web: the OSLOM's web site
the output object from similarity() or
dissimilarity_to_similarity().
If a data.frame is used, the first two columns represent pairs of
sites (or any pair of nodes), and the next column(s) are the similarity
indices.
a boolean indicating if the weights should be considered
if there are more than two columns.
a minimal weight value. If weight is TRUE, the links
between sites with a weight strictly lower than this value will not be
considered (O by default).
name or number of the column to use as weight. By default,
the third column name of net is used.
for the random number generator (NULL for random by default).
a character indicating if the nodes belonging to several
community should be reassign and what method should be used (see Note).
the number of runs for the first hierarchical level (10 by default).
the number of runs for the higher hierarchical level (50 by default, 0 if you are not interested in hierarchies).
the p-value, the default value is 0.10, increase this value you to get more modules.
kind of resolution parameter used to decide between taking some modules or their union (default value is 0.5, bigger value leads to bigger clusters).
a boolean indicating if the network is directed (from
column 1 to column 2).
a boolean indicating if the network is bipartite
(see Details).
name or number for the column of site nodes (i.e. primary nodes).
name or number for the column of species nodes (i.e. feature nodes).
a character indicating what types of nodes
(site, species or both) should be returned in the output
(return_node_type = "both" by default).
a character indicating the path to the bin folder
(see install_binaries and Details).
a character indicating the path to the temporary folder
(see Details).
a boolean indicating if the temporary folder should
be removed (see Details).
Maxime Lenormand (maxime.lenormand@inrae.fr), Pierre Denelle (pierre.denelle@gmail.com) and Boris Leroy (leroy.boris@gmail.com)
OSLOM is a network community detection algorithm proposed in Lancichinetti2011bioregion that finds statistically significant (overlapping) communities in (un)weighted and (un)directed networks.
This function is based on the 2.4 C++ version of OSLOM (http://www.oslom.org/software.htm). This function needs files to run. They can be installed with install_binaries.
If you changed the default path to the bin folder
while running install_binaries PLEASE MAKE SURE to set binpath
accordingly.
The C++ version of OSLOM generates temporary folders and/or files that are
stored in the path_temp folder (folder "oslom_temp" with an unique timestamp
located in the bin folder in binpath by default). This temporary folder is
removed by default (delete_temp = TRUE).
Lancichinetti2011bioregion
install_binaries(), netclu_infomap(), netclu_louvain()
comat <- matrix(sample(1000, 50), 5, 10)
rownames(comat) <- paste0("Site", 1:5)
colnames(comat) <- paste0("Species", 1:10)
net <- similarity(comat, metric = "Simpson")
com <- netclu_oslom(net)
Run the code above in your browser using DataLab