robinRobust {robin} | R Documentation |
robinRobust
Description
This functions implements a procedure to examine the stability of the partition recovered by some algorithm against random perturbations of the original graph structure.
Usage
robinRobust(
graph,
graphRandom,
method = c("walktrap", "edgeBetweenness", "fastGreedy", "louvain", "spinglass",
"leadingEigen", "labelProp", "infomap", "optimal", "leiden", "other"),
...,
FUN = NULL,
measure = c("vi", "nmi", "split.join", "adjusted.rand"),
type = NULL,
verbose = TRUE,
dist = "Other",
BPPARAM = BiocParallel::bpparam()
)
Arguments
graph |
The output of prepGraph. |
graphRandom |
The output of random function. |
method |
The clustering method, one of "walktrap", "edgeBetweenness", "fastGreedy", "louvain", "spinglass", "leadingEigen", "labelProp", "infomap", "leiden","optimal". |
... |
other parameter. |
FUN |
in case the @method parameter is "other" there is the possibility to use a personal function passing its name through this parameter. The personal parameter has to take as input the @graph and the @weights (that can be NULL), and has to return a community object. |
measure |
The stability measure, one of "vi", "nmi", "split.join", "adjusted.rand" all normalized and used as distances. "nmi" refers to 1- nmi and "adjusted.ran" refers to 1-adjusted.rand. |
type |
Character indicating "independent" or "dependent" for the old robin type contruction. If NULL the new faster version is computed (default NULL). |
verbose |
flag for verbose output (default as TRUE). |
dist |
Option to rewire in a manner that retains overall graph weight
regardless of distribution of edge weights. This option is invoked by putting
any text into this field. Defaults to "Other". See
|
BPPARAM |
the BiocParallel object of class |
Value
A list object with two matrices: - the matrix "Mean" with the means of the procedure for the graph - the matrix "MeanRandom" with the means of the procedure for the random graph.
Examples
my_file <- system.file("example/football.gml", package="robin")
graph <- prepGraph(file=my_file, file.format="gml")
graphRandom <- random(graph=graph)
robinRobust(graph=graph, graphRandom=graphRandom, method="leiden",
objective_function = "modularity", measure="vi")