calc_topological_roles: Calc topological roles among network communities/modules

View source: R/calcTopologicalIndices.r

calc_topological_rolesR Documentation

Calc topological roles among network communities/modules

Description

Topological roles characterize species as its roles between communities or modules, we calculate the modules using igraph::cluster_spinglass() function. Alternatively you can pass a community object obtained with other method using the parameter community. Topological roles are described by two parameters: the standardized within-module degree dz and the among-module connectivity participation coefficient PC. The within-module degree is a z-score that measures how well a species is connected to other species within its own module compared with a random graph. The participation coefficient PC estimates the distribution of the links of species among modules. As the community algorithm is stochastic we run it several times and return the repeated runs for both parameters.

Usage

calc_topological_roles(g, nsim = 1000, ncores = 0, community = NULL)

Arguments

g

an Igraph object with the network

nsim

number of simulations for igraph::cluster_spinglass() method

ncores

number of cores to use paralell computation, if 0 sequential processing is used.

community

a community object obtained with other method, if NULL the community is calculated with igraph::cluster_spinglass()

Value

a data frame with two numeric fields: within_module_degree, among_module_conn

References

  1. Guimerà, R. & Nunes Amaral, L.A. (2005). Functional cartography of complex metabolic networks. Nature, 433, 895–900

  2. Kortsch, S. et al. 2015. Climate change alters the structure of arctic marine food webs due to poleward shifts of boreal generalists. - Proceedings of the Royal Society B: Biological Sciences 282: 20151546. https://doi.org/10.1098/rspb.2015.1546

Examples

#' \dontrun{

g <- netData[[2]]

tp <- calc_topological_roles(g,nsim=10)

# using a community object

m <- cluster_walktrap(g)

tp <- calc_topological_roles(g,community=m)
}

lsaravia/EcoNetwork documentation built on Nov. 12, 2023, 5:34 p.m.