Skip to content
Snippets Groups Projects
Commit e4a6c52d authored by Maximilian Schmidt's avatar Maximilian Schmidt
Browse files

Remove absolute path to infomap, improve function and doc, add info to README

parent d2830aa2
No related branches found
No related tags found
1 merge request!1Add all necessary files for the multi-area model
......@@ -176,10 +176,12 @@ To install the required packages in a conda environment, execute:
Note that NEST needs to be installed separately, see <http://www.nest-simulator.org/installation/>.
In addition, reproducing the figures of Schmidt et al. (2017) requires python-igraph and networkx. To install these additional packages, execute:
In addition, reproducing the figures of [1] requires python-igraph and networkx. To install these additional packages, execute:
`pip install -r figures/Schmidt2017/additional_requirements.txt`
In addition, Figure 7 of [1] requires installing the `infomap` package to perform the map equation clustering. See <http://www.mapequation.org/code.html> for all necessary information.
The SLN fit in `multiarea_model/data_multiarea/VisualCortex_Data.py` and `figures/Schmidt2017/Fig5_cc_laminar_pattern.py` requires an installation of R and the R library `aod` (<http://cran.r-project.org/package=aod>). Without R installation, both scripts will directly use the resulting values of the fit (see Fig. 5 of [1]).
## Contributors
......
......@@ -5,7 +5,7 @@ import numpy as np
import os
def perform_map_equation(graph_matrix, node_list, filename=''):
def perform_map_equation(graph_matrix, node_list, filename='', infomap_path=None):
"""
Perform the map equation of
Rosvall M, Axelsson D, Bergstrom CT (2009) The map equation.
......@@ -21,6 +21,9 @@ def perform_map_equation(graph_matrix, node_list, filename=''):
the graph_matrix and node_list.
filename : str
Output file name without ending.
infomap_path : str
Path to installation of infomap. If None, the
infomap executable has to be in the system path.
Returns
-------
......@@ -58,7 +61,8 @@ def perform_map_equation(graph_matrix, node_list, filename=''):
"""
2. Execute map equation algorithm
"""
os.chdir('/home/schmidt/opt/infomap')
if infomap_path:
os.chdir(infomap_path)
os.system('./Infomap --directed --clu --map --verbose ' +
base_dir + '/' + net_fn + ' ' + base_dir)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment