In [ ]:
import rfn_analysis as ra

In [ ]:
import os

In [ ]:
base_dir = os.path.expanduser("~/Dropbox/Publications/RFNModularity/Data")

In [ ]:
import networkx as nx

In [ ]:
from glob import glob

In [ ]:
net = nx.read_gpickle(os.path.join(base_dir, "setups/phase_2/medium/node_robust/sim1551_final.gpickle.bz2"))
net.draw_layers(os.path.join(base_dir, "../EPJB/example_network.eps"));

In [ ]:
for complexity in ["low", "medium", "high"]:
    for rob_type in ["link", "node", "noise"]:
        for (i, filename) in enumerate(glob(os.path.join(base_dir,
                "setups/phase_2/%s/%s_robust/*.bz2" % (complexity, rob_type)))):
            net = nx.read_gpickle(filename)
            net.draw_modules(os.path.join(base_dir,
                    "../EPJB/%s_robust_%s_complexity_sample_network_%d.eps" % (rob_type, complexity, i + 1)),
                    spectral_partition=True)

In [ ]:
for complexity in ["2.2", "4.0", "9.3", "12.9"]:
    for (i, filename) in enumerate(glob(os.path.join(base_dir, "complexity/phase_1/%s/*.bz2" % (complexity)))):
        net = nx.read_gpickle(filename)
        net.draw_modules(os.path.join(base_dir,
                "../EPJB/phase_1_%s_complexity_sample_network_%d.eps" % (complexity, i + 1)),
                spectral_partition=True)

In [ ]:
for complexity in ["2.2", "4.0", "9.3", "12.9"]:
    for rob_type in ["link", "node", "noise"]:
        for (i, filename) in enumerate(glob(os.path.join(base_dir,
                "complexity/phase_2/%s/%s_robust/*.bz2" % (complexity, rob_type)))):
            net = nx.read_gpickle(filename)
            net.draw_modules(os.path.join(base_dir,
                    "../EPJB/%s_robust_%s_complexity_sample_network_%d.eps" % (rob_type, complexity, i + 1)),
                    spectral_partition=True)