Skip to content

Bipartite monolayer network example

Shai Pilosof edited this page Jul 21, 2020 · 1 revision

Data set

A weighted bipartite network describing a plant-flower visitor interaction web (25 plant species and 79 flower visitor species) in the vicinity of Bristol, U.K. Data can be obtained using data(memmott1999) using package bipartite in R. To distinguish between the two node sets we number the pollinator species from 1-79 and the plants from 80-104.

Input

A link list with columns from, to and weight. Because this is a bipartite network the from column can only contain nodes 1-79 and the to column nodes 84-104.

R Code

network_object <- create_monolayer_object(memmott1999, bipartite = T, directed = F, group_names = c('A','P'))
infomap_object <- run_infomap_monolayer(network_object, infomap_executable='Infomap',
                                        flow_model = 'undirected',
                                        silent=T, trials=20, two_level=T, seed=123)
# Plot the matrix (plotting function in beta)
plot_modular_matrix(infomap_object)

Infomap

Under the hood, the function run_infomap_monolayer runs:

./Infomap infomap.txt . --tree -i link-list --seed 123 -N 20 -f undirected -2

With this command, Infomap detects modules that contain both plants and pollinators.

  • -f undirected indicates flow on an undirected network.
  • -2 indicates a two-level solution, with no hierarchical modules.

Output

A tree file is produced by Infomap, but is parsed by run_infomap_monolayer from infomapecology (in R: ?run_infomap_monolayer).