Robin преди 2 години
родител
ревизия
6a3e789e45
променени са 100 файла, в които са добавени 18627 реда и са изтрити 21 реда
  1. 0 1
      .gitignore
  2. 29 0
      LICENSE
  3. 10 2
      README.md
  4. 452 0
      brunel_network/Snakefile
  5. 80 0
      brunel_network/config.py
  6. BIN
      brunel_network/images/eigenspectrum/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal_original.png
  7. BIN
      brunel_network/images/pvalue_overview/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal-add.png
  8. BIN
      brunel_network/images/pvalue_overview/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal-redraw_original.png
  9. BIN
      brunel_network/images/pvalue_overview/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal-shuffle.png
  10. BIN
      brunel_network/images/pvalue_trend/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal-add.png
  11. BIN
      brunel_network/images/pvalue_trend/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal-shuffle.png
  12. 3620 0
      brunel_network/results/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/rewiring_results.csv
  13. 53 0
      brunel_network/scripts/add_weights.py
  14. 128 0
      brunel_network/scripts/build_network.py
  15. 45 0
      brunel_network/scripts/correlation_matrix_from_spikes.py
  16. 64 0
      brunel_network/scripts/firing_rate_correlation.py
  17. 43 0
      brunel_network/scripts/nest_to_neo.py
  18. 159 0
      brunel_network/scripts/plot_eigenspectrum.py
  19. 103 0
      brunel_network/scripts/plot_pvalue_overview.py
  20. 82 0
      brunel_network/scripts/plot_pvalue_trend.py
  21. 793 0
      brunel_network/scripts/plot_rewiring.ipynb
  22. 79 0
      brunel_network/scripts/process_result_dataframe.py
  23. 48 0
      brunel_network/scripts/shuffle_weights.py
  24. 137 0
      brunel_network/scripts/simulate_network.py
  25. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.2E-0.1E/correlations.png
  26. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.2E-0.1E/spikes_50000-60000ms.png
  27. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.2E-0.1E/spikes_59000-60000ms.png
  28. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.2E-0.1E/weights.png
  29. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.2E-0.5E/spikes_55000-60000ms.png
  30. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.2E-0.5E/weights.png
  31. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.5E-0.5E/correlations.png
  32. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.5E-0.5E/spikes_55000-60000ms.png
  33. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.5E-0.5E/weights.png
  34. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.5E-0.6E/correlations.png
  35. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.5E-0.6E/spikes_55000-60000ms.png
  36. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_12800E-0.05E/weights.png
  37. 5056 0
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/config.yml
  38. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/original/correlations.png
  39. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/original/spikes_50000-60000ms.png
  40. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/original/spikes_55000-60000ms.png
  41. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/original/spikes_59000-60000ms.png
  42. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/original/weights.png
  43. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/shuffle_0.2_E-E/correlations.png
  44. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/shuffle_0.2_E-E/spikes_50000-60000ms.png
  45. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/shuffle_0.2_E-E/spikes_59000-60000ms.png
  46. BIN
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/shuffle_0.2_E-E/weights.png
  47. 538 0
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_10/config.yml
  48. 540 0
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_2/config.yml
  49. 540 0
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_3/config.yml
  50. 540 0
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_4/config.yml
  51. 540 0
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_5/config.yml
  52. 540 0
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_6/config.yml
  53. 540 0
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_7/config.yml
  54. 540 0
      brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_8/config.yml
  55. 657 0
      eigenangles.bib
  56. 0 18
      environment.yaml
  57. 20 0
      environment.yml
  58. BIN
      paper_figures/CPP-pairwise_comparison.png
  59. BIN
      paper_figures/C_SpiNNaker_comparison.png
  60. BIN
      paper_figures/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal_original.png
  61. BIN
      paper_figures/figure_1/angle_distributions.png
  62. 254 0
      paper_figures/figure_1/figure_1.ipynb
  63. 428 0
      paper_figures/figure_2/figure_2.ipynb
  64. BIN
      paper_figures/figure_2/test_construction.png
  65. BIN
      paper_figures/rewiring_comparisons_absolute_synapse_number_median.png
  66. BIN
      paper_figures/rewiring_comparisons_relative_synapse_number_median.png
  67. BIN
      paper_figures/spikes_55000-60000ms.png
  68. BIN
      paper_figures/stochastic_activity_similarity.png
  69. 87 0
      polychrony_network/Snakefile
  70. 7 0
      polychrony_network/config.py
  71. 2 0
      polychrony_network/results/eigenangle_test_after1h.csv
  72. 2 0
      polychrony_network/results/eigenangle_test_after2h.csv
  73. 2 0
      polychrony_network/results/eigenangle_test_after3h.csv
  74. 2 0
      polychrony_network/results/eigenangle_test_after4h.csv
  75. 2 0
      polychrony_network/results/eigenangle_test_after5h.csv
  76. 2 0
      polychrony_network/results/ks_test_after1h.csv
  77. 2 0
      polychrony_network/results/ks_test_after2h.csv
  78. 2 0
      polychrony_network/results/ks_test_after3h.csv
  79. 2 0
      polychrony_network/results/ks_test_after4h.csv
  80. 2 0
      polychrony_network/results/ks_test_after5h.csv
  81. 11 0
      polychrony_network/results/simulator_comparison.csv
  82. 74 0
      polychrony_network/scripts/correlation_matrix_from_spikes.py
  83. 381 0
      polychrony_network/scripts/plot_C-SpiNNaker_comparison.ipynb
  84. 0 0
      scripts/__init__.py
  85. 271 0
      scripts/eigenangle_test.py
  86. 61 0
      scripts/generate_poisson_correlation_matrix.py
  87. 24 0
      scripts/ks_test.py
  88. 35 0
      scripts/merge_dataframes.py
  89. 31 0
      scripts/plot_matrix.py
  90. 40 0
      scripts/plot_spiketrains.py
  91. 684 0
      scripts/plot_stochastic_activity_similarity.ipynb
  92. 33 0
      scripts/score_to_dataframe.py
  93. 76 0
      scripts/utils.py
  94. 109 0
      stochastic_activity/Snakefile
  95. 17 0
      stochastic_activity/config.py
  96. 2 0
      stochastic_activity/results/CPP-pairwise_equivalent_N100_t0-30000ms_bin2ms_rate10Hz_hub6,8_corr0.3,0.1_bkgr0.0/eigenangle_test_0-1.csv
  97. 2 0
      stochastic_activity/results/CPP-pairwise_equivalent_N100_t0-30000ms_bin2ms_rate10Hz_hub6,8_corr0.3,0.1_bkgr0.0/eigenangle_test_0-10.csv
  98. 2 0
      stochastic_activity/results/CPP-pairwise_equivalent_N100_t0-30000ms_bin2ms_rate10Hz_hub6,8_corr0.3,0.1_bkgr0.0/eigenangle_test_0-11.csv
  99. 2 0
      stochastic_activity/results/CPP-pairwise_equivalent_N100_t0-30000ms_bin2ms_rate10Hz_hub6,8_corr0.3,0.1_bkgr0.0/eigenangle_test_0-12.csv
  100. 0 0
      stochastic_activity/results/CPP-pairwise_equivalent_N100_t0-30000ms_bin2ms_rate10Hz_hub6,8_corr0.3,0.1_bkgr0.0/eigenangle_test_0-13.csv

+ 0 - 1
.gitignore

@@ -11,7 +11,6 @@ set_*
 *.dat
 *.swp
 *.json
-*.png
 Slurm/
 nest-simulator*/
 

+ 29 - 0
LICENSE

@@ -0,0 +1,29 @@
+BSD 3-Clause License
+
+Copyright (c) 2022, Robin Gutzen
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 10 - 2
README.md

@@ -1,3 +1,11 @@
-# eigenangles
 
-Interactive repository accompanying the manuscript "Eigenangles: evaluating the statistical similarity of neural network simulations via eigenvector angles" by Gutzen et al.
+# Eigenangles: evaluating the statistical similarity of neural network simulations via eigenvector angles
+Code and data repository accompanying the publication by Gutzen et al. (2022) https://doi.org/...
+
+<RRID> <zenodo doi> <mybinder link>
+
+## Abstract
+
+## Folder Structure
+
+## Cite

+ 452 - 0
brunel_network/Snakefile

@@ -0,0 +1,452 @@
+import config
+import numpy as np
+from pathlib import Path
+
+wildcard_constraints:
+    source_pop = 'E|I',
+    target_pop = 'E|I',
+    fraction = '[\d\.]+',
+    f = '[\d\.]+',
+    N = '\d+',
+    epsilon = '[\d\.]+',
+    eta = '[\d\.]+',
+    mu = '[\d\.]+',
+    seed = '\d+',
+    seed_a = '\d+',
+    seed_b = '\d+',
+    sigma_ex = '[\d\.]+',
+    sigma_in = '[\d\.]+',
+    plot = '[\w\d\-]+',
+    matrix = 'weights|correlations',
+    measures = 'weights|correlations|ratecorr',
+    protocol = '[\w\d\-\.]+',
+    syndist = '[a-z\-]+',
+    network_specs = '[\w\d\.]+',
+
+rule rewire_and_redraw:
+    input:
+        expand('simulation_output/'\
+             + 'N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}_sex{sigma_ex}_'\
+             + 'sin{sigma_in}_{syndist}/seed_{seed}/{protocol}/{outfile}', #'{plot}.png',
+            N = config.N,
+            f = config.f,
+            mu = config.mu,
+            epsilon = config.epsilon,
+            eta = config.eta,
+            sigma_ex = config.sigma_ex,
+            sigma_in = config.sigma_in,
+            syndist = config.syndist,
+            seed = config.seed,
+            outfile = 'correlations.npy',
+            # plot = ['correlations', 'weights',
+            #         'spikes_50000-60000ms', 'spikes_59000-60000ms'],
+            protocol = ['original']
+                      + expand('shuffle_{frac}_{source}-{target}',
+                               frac=config.shuffle_frac,
+                               source=config.shuffle_source,
+                               target=config.shuffle_target)
+                      + expand('add_{source_frac}{source}-{target_frac}{target}',
+                               source_frac=config.add_source_frac,
+                               target_frac=config.add_target_frac,
+                               source=config.add_source,
+                               target=config.add_target)
+            )
+
+rule redraw_comparisons:
+    input:
+        expand('results/N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}_sex{sigma_ex}_'\
+             + 'sin{sigma_in}_{syndist}/redraw_{protocol}/{measure}_{seed_pair}.csv',
+            N = config.N,
+            f = config.f,
+            mu = config.mu,
+            epsilon = config.epsilon,
+            eta = config.eta,
+            sigma_ex = config.sigma_ex,
+            sigma_in = config.sigma_in,
+            syndist = config.syndist,
+            seed_pair = config.seed_pairs[::int(len(config.seed)/2)],
+            measure = ['correlations', 'weights', 'ratecorr'],
+            protocol = 'original'
+            )
+
+rule rewire_comparisons:
+    input:
+        expand('results/N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}_sex{sigma_ex}_'\
+             + 'sin{sigma_in}_{syndist}/{protocol}/{measure}_{seed}.csv',
+            N = config.N,
+            f = config.f,
+            mu = config.mu,
+            epsilon = config.epsilon,
+            eta = config.eta,
+            sigma_ex = config.sigma_ex,
+            sigma_in = config.sigma_in,
+            syndist = config.syndist,
+            seed = config.seed,
+            measure = ['correlations', 'weights', 'ratecorr'],
+            protocol = expand('shuffle_{frac}_{source}-{target}',
+                               frac=config.shuffle_frac,
+                               source=config.shuffle_source,
+                               target=config.shuffle_target)
+                     + expand('add_{source_frac}{source}-{target_frac}{target}',
+                               source_frac=config.add_source_frac,
+                               target_frac=config.add_target_frac,
+                               source=config.add_source,
+                               target=config.add_target)
+            )
+
+
+# REWIRE EXPERIMENTS
+
+def id_span(N, f, pop):
+    N, f = int(N), float(f)
+    N_exc = int(N*f)
+    if pop == 'E':
+        return (0, N_exc)
+    elif pop =='I':
+        return (N_exc, N)
+    else:
+        raise ValueError
+
+rule shuffle_weights:
+    input:
+        script = 'scripts/shuffle_weights.py',
+        weights = '{root}/N{N}_f{f}_{specs}/original/weights.npy'
+    output:
+        weights = '{root}/N{N}_f{f}_{specs}/'\
+                + 'shuffle_{fraction}_{source_pop}-{target_pop}/weights.npy'
+    params:
+        source_span = lambda w: id_span(w.N, w.f, w.source_pop),
+        target_span = lambda w: id_span(w.N, w.f, w.target_pop),
+    shell:
+        """
+        python {input.script} --input "{input.weights}" \
+                              --output "{output.weights}" \
+                              --source_span {params.source_span} \
+                              --target_span {params.target_span} \
+                              --fraction {wildcards.fraction}
+        """
+
+rule add_weights:
+    input:
+        script = 'scripts/add_weights.py',
+        weights = '{root}/N{N}_f{f}_{specs}/original/weights.npy'
+    output:
+        weights = '{root}/N{N}_f{f}_{specs}/'\
+                + 'add_{source_frac}{source_pop}-{target_frac}{target_pop}'\
+                + '/weights.npy'
+    params:
+        source_span = lambda w: id_span(w.N, w.f, w.source_pop),
+        target_span = lambda w: id_span(w.N, w.f, w.target_pop),
+        weight_mean = lambda w: config.J_ex if w.source_pop == 'E' else config.J_in,
+        weight_std =  lambda w: config.sigma_ex if w.source_pop == 'E' else config.sigma_in,
+        syndist = config.syndist
+    shell:
+        """
+        python {input.script} --input "{input.weights}" \
+                              --output "{output}" \
+                              --source_span {params.source_span} \
+                              --target_span {params.target_span} \
+                              --source_fraction {wildcards.source_frac} \
+                              --target_fraction {wildcards.target_frac} \
+                              --weight_mean {params.weight_mean} \
+                              --weight_std {params.weight_std} \
+                              --syndist {params.syndist}
+        """
+
+
+# COMPARE NETWORK ACTIVITY AND CONNECTIVITY
+
+rule compare_redrawn_networks:
+    input:
+        script = "../scripts/eigenangle_test.py",
+        matrix_a = 'simulation_output/'\
+                 + 'N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}_sex{sigma_ex}'\
+                 + '_sin{sigma_in}_{syndist}/seed_{seed_a}/{protocol}/{matrix}.npy',
+        matrix_b = 'simulation_output/'\
+                 + 'N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}_sex{sigma_ex}'\
+                 + '_sin{sigma_in}_{syndist}/seed_{seed_b}/{protocol}/{matrix}.npy'
+    output:
+        temp('results/N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}_sex{sigma_ex}'\
+           + '_sin{sigma_in}_{syndist}/redraw_{protocol}/'\
+           + '{matrix}_{seed_a}-{seed_b}.json')
+    params:
+        bin_num = config.bin_num,
+        is_connectivity = lambda w: True if ('weights' in w.matrix) else False,
+        shuffle_neuron_ids = lambda w, output: 'redraw' in str(output)
+    shell:
+        """
+        python {input.script} --matrix_a {input.matrix_a} \
+                              --matrix_b {input.matrix_b} \
+                              --output {output} \
+                              --N {wildcards.N} \
+                              --bin_num {params.bin_num} \
+                              --mu {wildcards.mu} \
+                              --f {wildcards.f} \
+                              --epsilon {wildcards.epsilon} \
+                              --sigma_ex {wildcards.sigma_ex} \
+                              --sigma_in {wildcards.sigma_in} \
+                              --is_connectivity {params.is_connectivity} \
+                              --shuffle_neuron_ids {params.shuffle_neuron_ids}
+        """
+
+use rule compare_redrawn_networks as compare_rewired_network with:
+    input:
+        script = "../scripts/eigenangle_test.py",
+        matrix_a = 'simulation_output/'\
+                 + 'N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}_sex{sigma_ex}'\
+                 + '_sin{sigma_in}_{syndist}/seed_{seed}/original/{matrix}.npy',
+        matrix_b = 'simulation_output/'\
+                 + 'N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}_sex{sigma_ex}'\
+                 + '_sin{sigma_in}_{syndist}/seed_{seed}/{protocol}/{matrix}.npy',
+    output:
+        temp('results/N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}_sex{sigma_ex}'\
+           + '_sin{sigma_in}_{syndist}/{protocol}/{matrix}_{seed}.json')
+
+
+def get_spikes(wildcards):
+    network_specs = wildcards.network_specs
+    protocol = wildcards.protocol
+    seeds = wildcards.seeds
+    path = lambda prcl, s: f'simulation_output/{network_specs}/' \
+                         + f'seed_{s}/{prcl}/spikes.pkl'
+    if 'redraw' in protocol:
+        protocol = protocol.strip('redraw_')
+        return [path(protocol, seed) for seed in seeds.split('-')]
+    else:
+        return [path(p, seeds) for p in ['original', protocol]]
+
+rule calc_firing_rate_correlation:
+    input:
+        script = 'scripts/firing_rate_correlation.py',
+        spikes = get_spikes
+    params:
+        sim_folder = 'simulation_output'
+    output:
+        'results/{network_specs}/{protocol}/ratecorr_{seeds}.csv'
+    shell:
+        """
+        python {input.script} --output "{output}" \
+                              --input "{input.spikes}" \
+                              --protocol {wildcards.protocol} \
+                              --seeds {wildcards.seeds}
+        """
+
+# BUILD AND SIMULATE NETWORK
+
+rule build_network:
+    input:
+        script = 'scripts/build_network.py',
+        config = 'config.py'
+    params:
+        out_config = lambda w, output: Path(output.weights).parents[1] / 'config.yml'
+    output:
+        weights = 'simulation_output/'\
+                + 'N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}_sex{sigma_ex}_'\
+                + 'sin{sigma_in}_{syndist}/seed_{seed}/original/weights.npy'
+    shell:
+        """
+        python {input.script} --weights_path {output.weights} \
+                              --out_config {params.out_config} \
+                              --network_config {input.config} \
+                              --N {wildcards.N} \
+                              --f {wildcards.f} \
+                              --mu {wildcards.mu} \
+                              --sigma_ex {wildcards.sigma_ex} \
+                              --sigma_in {wildcards.sigma_in} \
+                              --epsilon {wildcards.epsilon} \
+                              --seed {wildcards.seed} \
+                              --syndist {wildcards.syndist}
+        """
+
+rule simulate_network:
+    input:
+        script = 'scripts/simulate_network.py',
+        weights = 'simulation_output/'\
+                + 'N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}_sex{sigma_ex}_'\
+                + 'sin{sigma_in}_{syndist}/seed_{seed}/{protocol}/weights.npy',
+    output:
+        spikes_ex = temp('simulation_output/'\
+                  + 'N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}_sex{sigma_ex}_'\
+                  + 'sin{sigma_in}_{syndist}/seed_{seed}/{protocol}/spikes_ex.gdf'),
+        spikes_in = temp('simulation_output/'\
+                  + 'N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}_sex{sigma_ex}_'\
+                  + 'sin{sigma_in}_{syndist}/seed_{seed}/{protocol}/spikes_in.gdf'),
+    params:
+        simtime = config.simtime,
+        config_path = 'config.py'
+    shell:
+        """
+        python {input.script} --spikes_ex_path {output.spikes_ex} \
+                              --spikes_in_path {output.spikes_in} \
+                              --weights_path {input.weights} \
+                              --network_config {params.config_path} \
+                              --N {wildcards.N} \
+                              --f {wildcards.f} \
+                              --mu {wildcards.mu} \
+                              --sigma_ex {wildcards.sigma_ex} \
+                              --sigma_in {wildcards.sigma_in} \
+                              --epsilon {wildcards.epsilon} \
+                              --simtime {params.simtime} \
+                              --seed {wildcards.seed} \
+                              --eta {wildcards.eta}
+        """
+
+# TRANSFORM RULES
+
+rule nest_to_neo:
+    input:
+        script = 'scripts/nest_to_neo.py',
+        spikes_ex = 'simulation_output/N{N}_f{f}_{specs}/spikes_ex.gdf',
+        spikes_in = 'simulation_output/N{N}_f{f}_{specs}/spikes_in.gdf',
+    output:
+        'simulation_output/N{N}_f{f}_{specs}/spikes.pkl'
+    params:
+        t_start = 0,
+        t_stop = config.simtime
+    shell:
+        """
+        python {input.script} --spikes_ex "{input.spikes_ex}" \
+                              --spikes_in "{input.spikes_in}" \
+                              --output {output} \
+                              --t_stop {params.t_stop} \
+                              --t_start {params.t_start} \
+                              --N {wildcards.N} \
+                              --f {wildcards.f}
+        """
+
+rule create_correlation_matrix_from_spikes:
+    input:
+        script = 'scripts/correlation_matrix_from_spikes.py',
+        spikes = '{spikes_dir}/spikes.pkl',
+    output:
+        correlation = '{spikes_dir}/correlations.npy'
+    params:
+        t_start = config.cut_inital_time,
+        t_stop = config.simtime,
+        bin_size = config.bin_size
+    shell:
+        """
+        python {input.script} --spikes "{input.spikes}" \
+                              --output {output} \
+                              --t_stop {params.t_stop} \
+                              --t_start {params.t_start} \
+                              --bin_size {params.bin_size}
+        """
+
+rule score_to_dataframe:
+    input:
+        script = '../scripts/score_to_dataframe.py',
+        data = 'results/N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}_sex{sigma_ex}' \
+             + '_sin{sigma_in}_{syndist}/{protocol}/{matrix}_{seeds}.json'
+    output:
+        'results/N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}_sex{sigma_ex}' \
+        + '_sin{sigma_in}_{syndist}/{protocol}/{matrix}_{seeds}.csv'
+    params:
+        bin_num = config.bin_num,
+        simtime = config.simtime
+    shell:
+        """
+        python {input.script} --output "{output}" \
+                              --input "{input.data}" \
+                              --params {wildcards} \
+                              --bin_num {params.bin_num} \
+                              --simtime {params.simtime}
+        """
+
+rule merge_comparison_results:
+    input:
+        script = '../scripts/merge_dataframes.py',
+    params:
+        exclude = ['merged_ratecorr_results', 'merged_comparison_results',
+                   'rewiring_results', 'ratecorr']
+    output:
+        temp('{dir}/merged_comparison_results.csv')
+    shell:
+        """
+        python {input.script} --output "{output}" \
+                              --exclude "{params.exclude}"
+        """
+
+use rule merge_comparison_results as merge_ratecorr_results with:
+    params:
+        exclude = ['merged_ratecorr_results', 'merged_comparison_results',
+                   'rewiring_results', 'weights', 'correlations']
+    output:
+        temp('{dir}/merged_ratecorr_results.csv')
+
+rule process_result_dataframe:
+    input:
+        script = 'scripts/process_result_dataframe.py',
+        comparison_df = '{dir}/merged_comparison_results.csv',
+        ratecorr_df = '{dir}/merged_ratecorr_results.csv'
+    output:
+        '{dir}/rewiring_results.csv'
+    shell:
+        """
+        python {input.script}  --output "{output}" \
+                               --comparison_df "{input.comparison_df}" \
+                               --ratecorr_df "{input.ratecorr_df}"
+        """
+
+# PLOT SIMULATION OUTPUT
+
+rule plot_spiketrains:
+    input:
+        script = '../scripts/plot_spiketrains.py',
+        spikes = '{spikes_dir}/spikes.pkl'
+    output:
+        '{spikes_dir}/spikes_{t_start}-{t_stop}ms.png'
+    shell:
+        """
+        python {input.script} --spikes "{input.spikes}" \
+                              --output "{output}" \
+                              --t_start {wildcards.t_start} \
+                              --t_stop {wildcards.t_stop}
+        """
+
+rule plot_matrix:
+    input:
+        script = '../scripts/plot_matrix.py',
+        matrix = '{dir}/{matrix}.npy'
+    output:
+        '{dir}/{matrix}.png'
+    shell:
+        """
+        python {input.script} --input "{input.matrix}" \
+                              --output "{output}"
+        """
+
+rule plot_eigenspectrum:
+    input:
+        script = 'scripts/plot_eigenspectrum.py',
+        files = expand('simulation_output/N{{N}}_f{{f}}_mu{{mu}}_p{{epsilon}}' \
+                     + '_eta{{eta}}_sex{{sigma_ex}}_sin{{sigma_in}}_{{syndist}}' \
+                     + '/seed_{seed}/{{protocol}}/weights.npy',
+                       seed = range(1,9))
+    output:
+        'images/eigenspectrum/N{N}_f{f}_mu{mu}_p{epsilon}_eta{eta}' \
+      + '_sex{sigma_ex}_sin{sigma_in}_{syndist}_{protocol}.png'
+    shell:
+        """
+        python {input.script} --input "{input.files}" \
+                              --output "{output}" \
+                              --N {wildcards.N} \
+                              --f {wildcards.f} \
+                              --mu {wildcards.mu} \
+                              --sigma_ex {wildcards.sigma_ex} \
+                              --sigma_in {wildcards.sigma_in} \
+                              --epsilon {wildcards.epsilon} \
+        """
+
+rule plot_pvalues:
+    input:
+        script = 'scripts/plot_pvalue_{plot_name}.py',
+        dataframe = 'results/{network_specs}/rewiring_results.csv'
+    output:
+        'images/pvalue_{plot_name}/{network_specs}-{protocol}.png'
+    shell:
+        """
+        python {input.script} --input "{input.dataframe}" \
+                              --output "{output}" \
+                              --protocol {wildcards.protocol}
+        """

+ 80 - 0
brunel_network/config.py

@@ -0,0 +1,80 @@
+import itertools
+
+# number of neurons
+N = 1000
+# fraction of excitatory cells
+f = 0.8
+# exc. strength (postsynaptic amplitude in mV)
+mu = 0.1
+# connection probability
+epsilon = 0.1
+# external rate relative to threshold rate
+eta = 0.9
+# variance of weight sample distributions
+syndist = 'lognormal' # 'truncated-normal' 'lognormal' 'normal'
+sigma_ex = 0.12
+sigma_in = 0.1
+# simulation time
+simtime = 61000 #ms
+
+###### rewiring parameters ######
+shuffle_source = ['E', 'I']
+shuffle_target = ['E', 'I']
+shuffle_frac = [1.0, 3500]
+
+add_source = 'E'
+add_target = 'E'
+add_source_frac = [0.2, 12800]
+add_target_frac = [0.1, 0.2, 0.4, 0.6, 0.8, 1.0]
+
+###### derived & fixed network parameters ######
+J_ex = mu
+# enforce global balance state
+J_in = -f * J_ex / (1-f)
+
+dt = 0.1  # the resolution in ms
+delay = [.5, 3]  #1.5 # min/max synaptic delays in ms (uniform)
+
+NE = int(f * N)  # number of excitatory neurons
+NI = N - NE # number of inhibitory neurons
+
+in_connection_rule = 'pairwise_bernoulli'
+ex_connection_rule = 'pairwise_bernoulli'
+
+synapse_model = 'static_synapse'
+neuron_model = 'iaf_psc_delta'
+tauMem = 20.0  # time constant of membrane potential in ms
+theta = 20.0  # membrane threshold potential in mV
+neuron_params = {"C_m": 1.0,
+                 "tau_m": tauMem,
+                 "t_ref": 2.0,
+                 "E_L": 0.0,
+                 "V_reset": 0.0,
+                 "V_m": 0.0,
+                 "V_th": theta}
+
+# Driving stiumulus parameters
+stimulus = "poisson_generator"
+parrot_input = False
+CE = epsilon * NE  # estimated number of excitatory synapses per neuron
+CI = epsilon * NI  # estimated number of inhibitory synapses per neuron
+
+if J_ex:
+    nu_th = theta / (J_ex * CE * tauMem)
+else:
+    nu_th = theta / (CE * tauMem)
+
+nu_ex = eta * nu_th
+p_rate = 1000.0 * nu_ex * CE
+p_rate_func = lambda eta: 1000 * eta*nu_th * CE
+
+###### non-network parameters ######
+# cut swinging-in time
+cut_inital_time = 1000 #ms
+# bin size for correlation calculation
+bin_size = 2 #ms
+# derived number of bins
+bin_num = int((simtime - cut_inital_time) / bin_size)
+# seeds for multiple runs with same specification
+seed = list(range(1,101))
+seed_pairs = [f'{i[0]}-{i[1]}' for i in itertools.combinations(seed,2)]

BIN
brunel_network/images/eigenspectrum/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal_original.png


BIN
brunel_network/images/pvalue_overview/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal-add.png


BIN
brunel_network/images/pvalue_overview/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal-redraw_original.png


BIN
brunel_network/images/pvalue_overview/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal-shuffle.png


BIN
brunel_network/images/pvalue_trend/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal-add.png


BIN
brunel_network/images/pvalue_trend/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal-shuffle.png


Файловите разлики са ограничени, защото са твърде много
+ 3620 - 0
brunel_network/results/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/rewiring_results.csv


+ 53 - 0
brunel_network/scripts/add_weights.py

@@ -0,0 +1,53 @@
+import numpy as np
+from itertools import product
+import argparse
+from copy import copy
+from build_network import get_weight_dist_func
+from pathlib import Path
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--input", nargs='?', type=Path)
+    CLI.add_argument("--output", nargs='?', type=Path)
+    CLI.add_argument("--source_span", nargs=2, type=int)
+    CLI.add_argument("--target_span", nargs=2, type=int)
+    CLI.add_argument("--source_fraction", nargs='?', type=float, default=0.2)
+    CLI.add_argument("--target_fraction", nargs='?', type=float, default=1)
+    CLI.add_argument("--weight_mean", nargs='?', type=float, default=1)
+    CLI.add_argument("--weight_std", nargs='?', type=float, default=1)
+    CLI.add_argument("--syndist", nargs='?', type=str)
+    args, unknown = CLI.parse_known_args()
+
+    weights = np.load(args.input)
+    source_ids = np.arange(args.source_span[0], args.source_span[1])
+    target_ids = np.arange(args.target_span[0], args.target_span[1])
+    neuron_tuples = np.array(list(product(source_ids, target_ids)))
+
+    # select target group
+    N_targets = int(args.target_fraction * len(target_ids))
+    target_tuples = np.array(list(product(source_ids, target_ids[:N_targets])))
+
+    synapse_values = weights[target_tuples[:,0], target_tuples[:,1]]
+    nonzero_synapse_idx = np.nonzero(synapse_values)[0]
+    zero_synapse_idx = np.where(synapse_values == 0)[0]
+    N_synapses = len(nonzero_synapse_idx)
+
+    # select empty synapse locations to add
+    if args.source_fraction <= 1:
+        N_new_synapses = int(N_synapses * args.source_fraction)
+    else:
+        N_new_synapses = int(args.source_fraction)
+
+    new_synapse_idx = np.random.choice(zero_synapse_idx, size=N_new_synapses, replace=False)
+
+    # find N_new_synapses tuples with 0-weight for selected targets
+    new_synapses = target_tuples[new_synapse_idx]
+
+    # draw new weight values and add the connections
+    weight_func = get_weight_dist_func(args.syndist)
+    new_weights = [weight_func(args.weight_mean, args.weight_std).GetValue()
+                   for _ in range(N_new_synapses)]
+
+    weights[new_synapses[:,0], new_synapses[:,1]] = new_weights
+
+    np.save(args.output, weights)

+ 128 - 0
brunel_network/scripts/build_network.py

@@ -0,0 +1,128 @@
+import nest
+import time
+import numpy as np
+import scipy as sc
+import yaml
+import itertools
+import argparse
+import sys
+import os
+
+def truncated_normal(m, s):
+    alpha = - m/s
+    phi = 1/np.sqrt(2*np.pi) * np.exp(-alpha**2/2)
+    Z = 1 - .5*(1+sc.special.erf(alpha/np.sqrt(2)))
+    sig = s / np.sqrt(1 + alpha*phi/Z - (phi/Z)**2)
+    mu = m - sig*phi/Z
+    return nest.math.redraw(nest.random.normal(mean=mu, std=sig), min=0, max=100)
+
+def lognormal(m, s):
+    mu = np.log(m/np.sqrt(1 + s**2/m**2))
+    sig = np.sqrt(np.log(1+s**2/m**2))
+    return nest.math.redraw(nest.random.lognormal(mean=mu, std=sig), min=0, max=100)
+
+def normal(m, s):
+    return nest.random.normal(mean=m, std=s)
+
+def get_weight_dist_func(dist_name):
+    if dist_name == 'truncated-normal':
+        return truncated_normal
+    elif dist_name == 'lognormal':
+        return lognormal
+    elif dist_name == 'normal':
+        return normal
+    else:
+        raise ValueError(f'{dist_name} not found!')
+
+def build_network(config):
+
+    # Initalizing Network
+    nest.ResetKernel()
+    np.random.seed(config['seed'])
+    nest.rng_seed = config['seed']
+
+    nest.SetDefaults(config['neuron_model'], config['neuron_params'])
+
+    nodes_ex = nest.Create(config['neuron_model'], config['NE'])
+    nodes_in = nest.Create(config['neuron_model'], config['NI'])
+
+    # Connecting Network
+    weight_dist = get_weight_dist_func(config['syndist'])
+
+    ## Excitatory Connections
+    conn_params_ex = {'rule' : config['ex_connection_rule'],
+                      'p'    : config['epsilon']}
+
+    syn_dict_ex = {'weight': weight_dist(m=config['J_ex'],
+                                         s=config['sigma_ex'])}
+
+    nest.Connect(pre=nodes_ex,
+                 post=nodes_ex + nodes_in,
+                 conn_spec=conn_params_ex,
+                 syn_spec=syn_dict_ex)
+
+    ## Inhibitory Connections
+    conn_params_in = {'rule' : config['in_connection_rule'],
+                      'p'    : config['epsilon']}
+
+    # drawing positive weights
+    syn_dict_in = {'weight': weight_dist(m=np.abs(config['J_in']),
+                                         s=config['sigma_in'])}
+
+    nest.Connect(nodes_in, nodes_ex + nodes_in,
+                 conn_params_in, syn_dict_in)
+
+    conn = nest.GetConnections(source = nodes_ex + nodes_in,
+                               target = nodes_ex + nodes_in)
+
+    weight_matrix = np.zeros((config['N'], config['N']))
+    for s, t, w in nest.GetStatus(conn, ['source', 'target', 'weight']):
+        weight_matrix[s-1][t-1] = w
+
+    # setting inhibitory weights to negative values
+    weight_matrix[-config['NI']:, :] *= -1
+
+    return weight_matrix
+
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--N",                 nargs='?', type=int)
+    CLI.add_argument("--f",                 nargs='?', type=float)
+    CLI.add_argument("--mu",                nargs='?', type=float)
+    CLI.add_argument("--epsilon",           nargs='?', type=float)
+    CLI.add_argument("--syndist",           nargs='?', type=str)
+    CLI.add_argument("--sigma_ex",          nargs='?', type=float)
+    CLI.add_argument("--sigma_in",          nargs='?', type=float)
+    CLI.add_argument("--seed",              nargs='?', type=int)
+    CLI.add_argument("--weights_path",      nargs='?', type=str)
+    CLI.add_argument("--network_config",    nargs='?', type=str)
+    CLI.add_argument("--out_config",        nargs='?', type=str)
+    args, unknown = CLI.parse_known_args()
+
+    dirname = os.path.dirname(args.weights_path)
+    if not os.path.exists(dirname):
+        os.makedirs(dirname)
+
+    # Loading default configs from config file
+    sys.path.append(os.path.dirname(args.network_config))
+    import config as network_config
+
+    locals_dict = locals()
+    config = dict([(k,v) for k,v in vars(network_config).items()
+                   if k not in locals_dict])
+    # Updating config with comandline arguments
+    # (These are only the parameters which are eventually expanded)
+    update_params = ['N', 'f', 'mu', 'syndist', 'epsilon',
+                     'sigma_ex', 'sigma_in', 'seed']
+    config.update(dict([(k,v) for k,v in vars(args).items()
+                        if k in update_params]))
+    config['NE'] = int(args.f * args.N)
+    config['NI'] = args.N - config['NE']
+
+    yaml.dump(config, open(args.out_config, 'w'))
+
+    # Building network
+    weight_matrix = build_network(config)
+
+    np.save(args.weights_path, weight_matrix)

+ 45 - 0
brunel_network/scripts/correlation_matrix_from_spikes.py

@@ -0,0 +1,45 @@
+from networkunit import models, tests, scores
+import neo
+import quantities as pq
+import numpy as np
+import matplotlib.pyplot as plt
+import argparse
+from scipy.linalg import eigh
+
+
+class brunel_spikes(models.loaded_spiketrains):
+    default_params = {**models.loaded_spiketrains.default_params}
+
+    def load(self):
+        io = neo.io.get_io(self.params['file_path'])
+        block = io.read_block()
+        spiketrains = block.segments[0].spiketrains
+        spiketrains = [st.time_slice(t_start=self.params['t_start'],
+                                     t_stop=self.params['t_stop'])
+                       for st in spiketrains]
+        return spiketrains
+
+class correlation_matrix_test(tests.correlation_matrix_test):
+    score_type = scores.effect_size
+    params = {'cluster_matrix':False,
+              'remove_autocorr':False,
+              'nan_to_num':True}
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--spikes", nargs='?', type=str)
+    CLI.add_argument("--output", nargs='?', type=str)
+    CLI.add_argument("--t_start", nargs='?', type=float, default=0)
+    CLI.add_argument("--t_stop", "--T", nargs='?', type=float)
+    CLI.add_argument("--bin_size", nargs='?', type=float)
+    args, unknown = CLI.parse_known_args()
+
+    spikes_model = brunel_spikes(file_path=args.spikes,
+                                 t_start=args.t_start*pq.ms,
+                                 t_stop=args.t_stop*pq.ms,
+                                 align_to_0=True)
+
+    corr_test = correlation_matrix_test(bin_size=args.bin_size*pq.ms)
+    cc_matrix = corr_test.generate_prediction(spikes_model)
+
+    np.save(args.output, cc_matrix)

+ 64 - 0
brunel_network/scripts/firing_rate_correlation.py

@@ -0,0 +1,64 @@
+import argparse
+import pandas as pd
+import numpy as np
+from elephant.statistics import mean_firing_rate
+import neo
+from pathlib import Path
+import os
+import sys
+sys.path.append(str(Path.cwd().parents[0] / 'scripts'))
+from utils import load_df, compact_column
+
+def load_rate_vectors(path):
+    try:
+        spiketrains = load_spiketrains(path)
+        spiketrains_exc = filter_spiketrains(spiketrains, neuron_type='excitatory')
+        spiketrains_inh = filter_spiketrains(spiketrains, neuron_type='inhibitory')
+        return [calc_rate_vector(st) for st in [spiketrains,
+                                                spiketrains_exc, spiketrains_inh]]
+
+    except FileNotFoundError:
+        return [np.array([]), np.array([]), np.array([])]
+
+def filter_spiketrains(spiketrains, **kwargs):
+    for key, value in kwargs.items():
+        spiketrains = [st for st in spiketrains if st.annotations[key] == value]
+    return spiketrains
+
+def load_spiketrains(path):
+    io = neo.io.get_io(path)
+    return io.read_block().segments[0].spiketrains
+
+def calc_rate_vector(spiketrains):
+    return np.array([mean_firing_rate(st) for st in spiketrains])
+
+def calc_vector_correlation(vector_a, vector_b):
+    if len(vector_a) and len(vector_b):
+        return np.corrcoef(vector_a, vector_b)[0,1]
+    else:
+        return np.nan
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--input", nargs='?', type=lambda s: s.split(' '))
+    CLI.add_argument("--output", nargs='?', type=Path)
+    args, unknown = CLI.parse_known_args()
+
+    if len(args.input) != 2:
+        raise ValueError(f'Expected two input files, got {len(args.input)}!')
+
+    rates_a, rates_exc_a, rates_inh_a = load_rate_vectors(args.input[0])
+    rates_b, rates_exc_b, rates_inh_b = load_rate_vectors(args.input[1])
+
+    ratecorr = calc_vector_correlation(rates_a, rates_b)
+    ratecorr_exc = calc_vector_correlation(rates_exc_a, rates_exc_b)
+    ratecorr_inh = calc_vector_correlation(rates_inh_a, rates_inh_b)
+
+    params = dict([(k.strip('-'),v) for k,v in zip(unknown[:-1:2],unknown[1::2])])
+    params.update(rate_correlation=ratecorr,
+                  rate_correlation_exc=ratecorr_exc,
+                  rate_correlation_inh=ratecorr_inh)
+
+    df = pd.Series(params).to_frame().T
+
+    df.to_csv(args.output)

+ 43 - 0
brunel_network/scripts/nest_to_neo.py

@@ -0,0 +1,43 @@
+import neo
+import quantities as pq
+import numpy as np
+import matplotlib.pyplot as plt
+import argparse
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--spikes_ex", nargs='?', type=str)
+    CLI.add_argument("--spikes_in", nargs='?', type=str)
+    CLI.add_argument("--output", nargs='?', type=str)
+    CLI.add_argument("--t_stop", "--T", nargs='?', type=float)
+    CLI.add_argument("--t_start", nargs='?', type=float, default=0)
+    CLI.add_argument("--N", nargs='?', type=float)
+    CLI.add_argument("--f", nargs='?', type=float)
+    args, unknown = CLI.parse_known_args()
+
+    N_ex = int(round(args.f*args.N))
+    N_in = int(round((1-args.f)*args.N))
+    gid_ex = [i+1 for i in range(N_ex)]
+    gid_in = [i+1+N_ex for i in range(N_in)]
+
+    spiketrains = []
+    for spikes_path, gid, ntype in zip([args.spikes_ex, args.spikes_in],
+                                        [gid_ex,         gid_in],
+                                        ['excitatory',   'inhibitory']):
+        io = neo.NestIO(spikes_path)
+        block = io.read_block(gid_list=gid,
+                              t_start=args.t_start*pq.ms,
+                              t_stop=args.t_stop*pq.ms)
+        for st in block.segments[0].spiketrains:
+            st.annotate(neuron_type=ntype)
+        spiketrains.extend(block.segments[0].spiketrains)
+        del block
+
+    block = neo.Block()
+    segment = neo.Segment()
+    block.segments.append(segment)
+    block.segments[0].spiketrains = spiketrains
+
+    io = neo.io.get_io(args.output)
+    io.write(block)
+    

+ 159 - 0
brunel_network/scripts/plot_eigenspectrum.py

@@ -0,0 +1,159 @@
+import numpy as np
+import scipy as sc
+import argparse
+from scipy.integrate import quad
+import math
+from types import SimpleNamespace
+import itertools
+import matplotlib.pyplot as plt
+import seaborn as sns
+import sys
+from pathlib import Path
+sys.path.append(str(Path.cwd().parents[0] / 'scripts'))
+from eigenangle_test import EigenangleTest
+
+def process_eigenvectors(vecs, lengths):
+    sort_idx = np.argsort(lengths)
+    vecs = vecs.T[sort_idx]
+    for i, eva in enumerate(vecs):
+        vecs[i] = eva * np.sign(eva[np.argmax(np.absolute(eva))])
+        vecs[i] /= np.linalg.norm(eva)
+    return vecs
+
+def load_eigenspectrum(path_list, N):
+    matrix_num = len(path_list)
+    all_eigenvalues = np.empty(N*matrix_num, dtype=complex)
+    all_eigenangles = np.array([], dtype=float)
+
+    for i, path_a in enumerate(path_list):
+        matrix = np.load(path_a)
+        eigenvalues, vectors_a = sc.linalg.eig(matrix)
+        all_eigenvalues[N*i:N*(i+1)] = eigenvalues
+
+        vectors_a = process_eigenvectors(vectors_a, np.real(eigenvalues))
+
+        for j, path_b in enumerate(path_list[i+1:]):
+            matrix = np.load(path_b)
+            eigenvalues , vectors_b = sc.linalg.eig(matrix)
+            vectors_b = process_eigenvectors(vectors_b, np.real(eigenvalues))
+
+            M = np.real(np.dot(vectors_a, np.conjugate(vectors_b).T))
+            M = np.real(M)
+            M[np.argwhere(M > 1)] = 1.
+
+            all_eigenangles = np.append(all_eigenangles, np.arccos(np.diag(M)))
+    return all_eigenvalues, all_eigenangles
+
+def plot_eigenvalue_dist(test, eigenvalues, ax=None, color=None, width=.9,
+                         bins=20, scale=1):
+    hist, edges = np.histogram(np.real(eigenvalues), bins=bins, density=True)
+    dx = np.diff(edges)[0]
+
+    xvalues = np.linspace(-test.critical_radius, test.critical_radius, 200)
+    norm = quad(test.eigenvalue_real_dist,
+                -test.critical_radius, test.critical_radius)[0]
+    yvalues = [np.nan_to_num(test.eigenvalue_real_dist(x))*scale/norm
+              for x in xvalues]
+
+    if ax is None:
+        fig, ax = plt.subplots()
+
+    ax.bar(edges[:-1]+dx/2, hist*scale, color=color, width=width*dx)
+    ax.plot(xvalues, yvalues, 'k--')
+    curve_area = np.nansum(yvalues)*np.diff(xvalues)[0]
+    return ax
+
+def plot_eigenangle_dist(test, eigenangles, ax=None, color=None,
+                         width=.9, bins=20):
+    edges = np.linspace(0, np.pi, bins)
+    hist, edges = np.histogram(eigenangles, bins=edges, density=True)
+    dx = np.diff(edges)[0]
+    xvalues = edges[:-1] + dx/2
+
+    if ax is None:
+        fig, ax = plt.subplots()
+
+    ax.bar(xvalues, hist, color=color, width=width*dx)
+
+    edges = np.linspace(0, np.pi, bins*10)
+    yvalues = [test.angle_dist(x) for x in edges]
+    ax.plot(edges, yvalues, 'k--')
+    return ax
+
+def plot_eigenspectrum(test, eigenvalues, eigenangles, original=False):
+    sns.set(style='ticks', context='talk')
+    sns.set_color_codes('colorblind')
+    mosaic = """
+             AB
+             """
+    figsize = (15,7)
+    fig, ax = plt.subplot_mosaic(mosaic, figsize=figsize,
+                                 gridspec_kw=dict(hspace=.2, width_ratios=[1,1]))
+    ax = SimpleNamespace(**ax)
+
+    plot_eigenvalue_dist(eigenangle_test, np.real(eigenvalues), ax.A, scale=1,
+                         color=sns.color_palette('deep')[0], width=.9, bins=40)
+    ax.A.set_yticks([])
+    ax.A.set_xlabel(r'real eigenvalue $\lambda_{\mathbb{R}}$')
+    sns.despine(ax=ax.A, left=True, right=True, top=True)
+
+    inset_size = .35
+    iax = fig.add_axes((.38,.55,inset_size*figsize[1]/figsize[0],inset_size))
+    iax.plot(np.real(eigenvalues), np.imag(eigenvalues), linestyle='None',
+             color=sns.color_palette('deep')[0], marker='.', markersize=1)
+    vmax = max([np.abs(np.real(eigenvalues)).max(),
+                np.abs(np.imag(eigenvalues)).max()])
+    iax.set_xlim((-vmax, vmax))
+    iax.set_ylim((-vmax, vmax))
+    iax.set_axis_off()
+
+    bins = 300
+    binwidth = np.pi/bins
+    plot_eigenangle_dist(eigenangle_test, eigenangles, ax.B,
+                         sns.color_palette('rocket')[2], width=.9, bins=bins,)
+    ax.B.set_xlim((min(eigenangles)-binwidth, max(eigenangles)+binwidth))
+
+    if original:
+        ax.B.set_xlim((np.pi*11/24, np.pi*13/24))
+        ax.B.set_xticks([np.pi*15/32, np.pi/2, np.pi*17/32])
+        ax.B.set_xticklabels([r'$\frac{15}{32}\pi$', r'$\frac{1}{2}\pi$',
+                              r'$\frac{17}{32}\pi$'])
+    else:
+        ax.B.set_yscale('log')
+        ax.B.set_ylim((0.001,30))
+
+    ax.B.set_yticks([])
+    ax.B.set_xlabel(f'eigenangle $\phi$')
+    sns.despine(ax=ax.B, left=True, right=True, top=True)
+
+    return fig
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--input",     nargs='?', type=lambda s: s.split(' '))
+    CLI.add_argument("--output",    nargs='?', type=Path)
+    CLI.add_argument("--N",         nargs='?', type=int)
+    CLI.add_argument("--f",         nargs='?', type=float)
+    CLI.add_argument("--mu",        nargs='?', type=float)
+    CLI.add_argument("--epsilon",   nargs='?', type=float)
+    CLI.add_argument("--sigma_ex",  nargs='?', type=float)
+    CLI.add_argument("--sigma_in",  nargs='?', type=float)
+    args, unknown = CLI.parse_known_args()
+
+    eigenangle_test = EigenangleTest(N=args.N,
+                                     f=args.f,
+                                     mu=args.mu,
+                                     epsilon=args.epsilon,
+                                     sigma_ex=args.sigma_ex,
+                                     sigma_in=args.sigma_in,
+                                     is_connectivity=True)
+
+    eigenvalues, eigenangles = load_eigenspectrum(args.input, N=args.N)
+
+    fig = plot_eigenspectrum(eigenangle_test, eigenvalues, eigenangles,
+                             original=('original' in args.input[0]))
+
+    fig.suptitle(f'{Path(args.output).name.strip(".png")}')
+    fig.align_labels()
+
+    plt.savefig(args.output, bbox_inches='tight')

+ 103 - 0
brunel_network/scripts/plot_pvalue_overview.py

@@ -0,0 +1,103 @@
+import pandas as pd
+import numpy as np
+import argparse
+import seaborn as sns
+import matplotlib.pyplot as plt
+from mpl_toolkits.axes_grid1 import make_axes_locatable
+import sys
+from pathlib import Path
+sys.path.append(str(Path.cwd().parents[0]))
+sys.path.append(str(Path.cwd().parents[0] / 'scripts'))
+from utils import load_df, colormap, stack_columns
+
+
+def plot_pvalues(data, ax=None, x='matrix', order=['weights', 'correlations'],
+                 border=0.1, alpha=0.5, lineplot=False):
+    if ax is None:
+        fig, ax = plt.subplots()
+
+    data = stack_columns(data, new_column='matrix',
+                         prefixes=['pvalue'],
+                         suffixes=['weights', 'correlations'])
+
+    sns.stripplot(x=x, y="pvalue", hue="matrix", data=data,
+                  ax=ax, palette=colormap, order=order, alpha=alpha)
+    if lineplot:
+        sns.lineplot(data=data, x=x, y='pvalue', hue='matrix',
+                     ax=ax, palette=colormap, alpha=0)
+    ax.set_xlabel('')
+    ax.set_yscale('linear')
+    ax.set_ylim((border, 1.05))
+    sns.despine(ax=ax, left=True, right=True, top=True, bottom=True)
+    ax.get_legend().remove()
+    ax.axhline(0.1, color='0.8', linestyle=':', linewidth=4)
+
+    divider = make_axes_locatable(ax)
+    axlog = divider.append_axes("bottom", size=3.5, pad=0, sharex=ax)
+    axlog.set_yscale('log')
+    minp = data[data.pvalue > 0].pvalue.min()
+    axlog.set_ylim((minp/10, border))
+
+    sns.stripplot(x=x, y="pvalue", hue="matrix",
+                  data=data, ax=axlog, palette=colormap,
+                  order=order, alpha=alpha)
+    if lineplot:
+        sns.lineplot(data=data, x=x, y='pvalue', hue='matrix',
+                     ax=axlog, palette=colormap, alpha=0)
+
+    axlog.set_ylabel('')
+    sns.despine(ax=axlog, left=True, right=True, top=True, bottom=True)
+    axlog.set_xlabel('')
+    axlog.get_legend().remove()
+    return axlog
+
+def plot_pvalue_overview(data):
+    fig, axes = plt.subplots(ncols=3, figsize=(12,7),
+                             gridspec_kw=dict(wspace=.5, width_ratios=[1,.2,.2]))
+    alpha = 0.3
+    # weights and correlation
+    plot_pvalues(data, axes[0], alpha=alpha)
+
+    # ratio
+    ax = axes[1]
+    sns.stripplot(y="pvalue_ratio", data=data, ax=ax,
+                  color=colormap['ratio'], alpha=alpha)
+    ax.axhline(1, color='0.3', linestyle=':')
+    ax.set_yscale('log')
+    ax.yaxis.set_ticks_position('right')
+    ax.yaxis.set_label_position('right')
+    ax.set_ylabel(r'$p_c / p_w$')
+    ax.set_xlabel('')
+    ax.set_xticklabels(['ratio'])
+    sns.despine(ax=ax, left=True, right=True, top=True, bottom=True)
+
+    # rate correlation
+    ax = axes[2]
+    sns.stripplot(y="rate_correlation", data=data, ax=ax,
+                  color=colormap['rate_correlation'], alpha=alpha)
+    ax.yaxis.set_ticks_position('right')
+    ax.yaxis.set_label_position('right')
+    ax.set_ylabel('rate vector correlation')
+    ax.set_xlabel('')
+    ax.set_xticklabels(['rates'])
+    sns.despine(ax=ax, left=True, right=True, top=True, bottom=True)
+    return fig
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--input", nargs='?', type=Path)
+    CLI.add_argument("--output", nargs='?', type=Path)
+    CLI.add_argument("--protocol", nargs='?', type=str)
+    args, unknown = CLI.parse_known_args()
+
+    df = load_df(args.input)
+    data = df[df.protocol.str.contains(args.protocol)]
+    if 'redraw' not in args.protocol:
+        data = data[~data.protocol.str.contains('redraw')]
+
+    sns.set(style='ticks', palette='deep', context='talk')
+
+    fig = plot_pvalue_overview(data)
+    fig.suptitle(f'{Path(args.output).name.strip(".png")}', fontsize=17)
+
+    plt.savefig(args.output, bbox_inches=None)

+ 82 - 0
brunel_network/scripts/plot_pvalue_trend.py

@@ -0,0 +1,82 @@
+import pandas as pd
+import numpy as np
+import argparse
+import seaborn as sns
+import matplotlib.pyplot as plt
+import itertools
+import sys
+from pathlib import Path
+sys.path.append(str(Path.cwd().parents[0]))
+sys.path.append(str(Path.cwd().parents[0] / 'scripts'))
+from utils import load_df, colormap, stack_columns, multicolor_ylabel
+from process_result_dataframe import order_df
+
+def plot_pvalue_trend(data):
+    fig, ax = plt.subplots(figsize=(15,7))
+    y = 'log_pvalue'
+    alpha = 0.5
+
+    # weight & correlations
+    plot_data = stack_columns(data, new_column='matrix',
+                              prefixes=['score', 'pvalue', 'log_pvalue'],
+                              suffixes=['weights', 'correlations'])
+    sns.stripplot(x='protocol', y=y, hue="matrix", data=plot_data,
+                  ax=ax, palette=colormap, alpha=alpha)
+    sns.lineplot(data=plot_data, x='protocol', y=y, hue='matrix',
+                 ax=ax, palette=colormap, alpha=.5)
+    multicolor_ylabel(ax,
+                      ('log p (', 'weights', ', ', 'correlations', ')'),
+                      ('k', colormap["weights"], 'k', colormap["correlations"], 'k'),
+                      bbox_to_anchor=(-0.1, 0.5))
+    ax.tick_params(axis='x', labelrotation = 45)
+    ax.set_xlabel('')
+    ax.set_xlim((0, 5))
+    ax.set_ylim((np.nanmin(plot_data[y])-1, np.nanmax(plot_data[y])+1))
+    sns.despine(ax=ax, left=True, right=True, top=True, bottom=True)
+    ax.get_legend().remove()
+
+    # p ratio
+    ax1 = ax.twinx()
+    y = f'{y}_ratio'
+
+    sns.stripplot(x="protocol", y=y, data=data, alpha=alpha,
+                  ax=ax1, color=colormap['ratio'])
+    sns.lineplot(data=data, x='protocol', y=y,
+                 ax=ax1, color=colormap['ratio'], alpha=.5)
+    ax1.axhline(0, color=colormap['ratio'], alpha=0.8, linestyle=':', linewidth=1)
+    multicolor_ylabel(ax1, [r'$\log \ p_c / p_w$'], [colormap['ratio']],
+                      bbox_to_anchor=(1.08, 0.5))
+    ax1.set_ylim((np.nanmin(data[y])-1, np.nanmax(data[y])+1))
+    sns.despine(ax=ax1, left=True, top=True, bottom=True)
+
+    # rate correlation
+    ax2 = ax.twinx()
+    y = 'rate_correlation'
+
+    sns.stripplot(x="protocol", y=y, data=data, alpha=alpha,
+                  ax=ax2, color=colormap[y])
+    sns.lineplot(data=data, x='protocol', y=y,
+                 ax=ax2, color=colormap[y], alpha=.5)
+    multicolor_ylabel(ax2, ['rate correlation'], [colormap[y]],
+                      bbox_to_anchor=(1.22, 0.5))
+    ax2.spines['right'].set_position(('outward', 110))
+    sns.despine(ax=ax2, left=True, top=True, bottom=True)
+    return fig
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--input", nargs='?', type=Path)
+    CLI.add_argument("--output", nargs='?', type=Path)
+    CLI.add_argument("--protocol", nargs='?', type=str)
+    args, unknown = CLI.parse_known_args()
+
+    df = load_df(args.input)
+    df = order_df(df)
+    data = df[df.protocol.str.contains(args.protocol)]
+
+    sns.set(style='ticks', palette='deep', context='talk')
+
+    fig = plot_pvalue_trend(data)
+    fig.suptitle(f'{Path(args.output).name.strip(".png")}', fontsize=17)
+
+    plt.savefig(args.output, bbox_inches='tight')

Файловите разлики са ограничени, защото са твърде много
+ 793 - 0
brunel_network/scripts/plot_rewiring.ipynb


+ 79 - 0
brunel_network/scripts/process_result_dataframe.py

@@ -0,0 +1,79 @@
+import argparse
+import pandas as pd
+import numpy as np
+from elephant.statistics import mean_firing_rate
+import neo
+from pathlib import Path
+import os
+import sys
+sys.path.append(str(Path.cwd().parents[0] / 'scripts'))
+from utils import load_df, compact_column
+
+
+def add_logp_column(df, col_name_str='pvalue', log_prefix='log_'):
+    col_names = [col for col in df.columns if col_name_str in col]
+    for col_name in col_names:
+        pvalue = df[col_name].to_numpy().astype(float)
+        pvalue[~np.isfinite(pvalue)] = np.nan
+        df[col_name] = pvalue
+        log_pvalue = np.array([np.log10(p) if p else np.nan for p in pvalue])
+        log_pvalue[~np.isfinite(log_pvalue)] = np.nan
+        df[f'{log_prefix}{col_name}'] = log_pvalue
+    return df
+
+def calc_ratio(row, numerator, denominator, inf_value=np.nan):
+    if row[denominator] == 0:
+        return inf_value
+    else:
+        return row[numerator] / row[denominator]
+
+def add_pvalue_ratio(df, ratio_keys=['correlations', 'weights'],
+                         ratio_columns=['pvalue', 'score']):
+
+    for col in ratio_columns:
+        df[f'{col}_ratio'] = df.apply(
+                lambda row: calc_ratio(row,
+                                       f'{col}_{ratio_keys[0]}',
+                                       f'{col}_{ratio_keys[1]}'), axis=1)
+    return df
+
+def add_rate_correlation_column(df, ratecorr_df, on=['protocol', 'seeds']):
+    return df.merge(ratecorr_df, how='outer', on=None)
+
+def sort_protocol_values(protocol):
+    if 'ffle' in protocol:
+        _ , fraction, populations = protocol.split('_')
+        pop_order = np.array(['E-E', 'E-I', 'I-E', 'I-I'])
+        value = np.where(populations == pop_order)[0][0]
+        return float(fraction) + value/100
+    elif 'add' in protocol:
+        source, target = protocol.split('_')[-1].split('-')
+        source, target = source.strip('E'), target.strip('E')
+        return float(source)*100 + float(target)
+    else:
+        return 0
+
+def order_df(df):
+    key_function = lambda protocols: [sort_protocol_values(p) for p in protocols]
+    df = df.sort_values('protocol', key=key_function)
+    return df
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--output", nargs='?', type=Path)
+    CLI.add_argument("--comparison_df", nargs='?', type=Path)
+    CLI.add_argument("--ratecorr_df", nargs='?', type=Path, default=None)
+    args, unknown = CLI.parse_known_args()
+
+    df = load_df(args.comparison_df)
+
+    df = compact_column(df)
+    df = add_pvalue_ratio(df)
+    df = add_logp_column(df)
+
+    if args.ratecorr_df is not None:
+        df = add_rate_correlation_column(df, load_df(args.ratecorr_df))
+
+    df = order_df(df)
+
+    df.to_csv(args.output)

+ 48 - 0
brunel_network/scripts/shuffle_weights.py

@@ -0,0 +1,48 @@
+import numpy as np
+from itertools import product
+import argparse
+from copy import copy
+from pathlib import Path
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--input", nargs='?', type=Path)
+    CLI.add_argument("--output", nargs='?', type=Path)
+    CLI.add_argument("--source_span", nargs=2, type=int)
+    CLI.add_argument("--target_span", nargs=2, type=int)
+    CLI.add_argument("--fraction", nargs='?', type=float, default=1)
+    args, unknown = CLI.parse_known_args()
+
+    weights = np.load(args.input)
+    source_ids = np.arange(args.source_span[0], args.source_span[1])
+    target_ids = np.arange(args.target_span[0], args.target_span[1])
+    neuron_tuples = np.array(list(product(source_ids, target_ids)))
+    N_tuple = neuron_tuples.shape[0]
+
+    # select N_rewire_synapses non-0 synapses -> a
+    synapse_values = weights[neuron_tuples[:,0], neuron_tuples[:,1]]
+    nonzero_synapse_idx = np.nonzero(synapse_values)[0]
+    if args.fraction <= 1:
+        N_rewire_synapses = int(args.fraction*len(nonzero_synapse_idx))
+    else:
+        N_rewire_synapses = int(args.fraction)
+
+    rewire_idx_a = np.random.choice(nonzero_synapse_idx, size=N_rewire_synapses,
+                                    replace=False)
+
+    # select N_rewire_synapses from all remaining synapses -> b
+    remaining_idx = np.setdiff1d(np.arange(N_tuple), rewire_idx_a)
+    rewire_idx_b = np.random.choice(remaining_idx, size=N_rewire_synapses,
+                                    replace=False)
+
+    # swap weights of group a with group b
+    weight_idx_a = neuron_tuples[rewire_idx_a]
+    weight_idx_b = neuron_tuples[rewire_idx_b]
+
+    weights_a = copy(weights[weight_idx_a[:,0], weight_idx_a[:,1]])
+    weights_b = copy(weights[weight_idx_b[:,0], weight_idx_b[:,1]])
+
+    weights[weight_idx_a[:,0], weight_idx_a[:,1]] = weights_b
+    weights[weight_idx_b[:,0], weight_idx_b[:,1]] = weights_a
+
+    np.save(args.output, weights)

+ 137 - 0
brunel_network/scripts/simulate_network.py

@@ -0,0 +1,137 @@
+import nest
+import time
+import numpy as np
+import json
+import argparse
+import sys
+import os
+from pathlib import Path
+
+
+def build_network(config, weights, spikes_ex_output, spikes_in_output):
+    # Initalizing Network
+    nest.ResetKernel()
+    data_path = Path(spikes_ex_output).parents[0]
+    data_prefix = Path(spikes_ex_output).parts[-1].split('_')[0] + '_'
+    file_extension = Path(spikes_ex_output).suffix.strip('.')
+
+    np.random.seed(config['seed'])
+    nest.rng_seed = config['seed']
+    nest.SetKernelStatus({"resolution"     : config['dt'],
+                          "print_time"     : True,
+                          "overwrite_files": True,
+                          "rng_seed"       : config['seed'],
+                          "data_path"      : str(data_path),
+                          "data_prefix"    : data_prefix})
+
+    nest.SetDefaults(config['neuron_model'], config['neuron_params'])
+
+    delay_dist = nest.random.uniform(min=config['delay'][0],
+                                     max=config['delay'][1])
+    avg_delay = np.mean(config['delay'])
+
+    nest.CopyModel(config['synapse_model'], "excitatory",
+                   {"weight": config['J_ex'], "delay": avg_delay})
+
+    nodes_ex = nest.Create(config['neuron_model'], config['NE'])
+    nodes_in = nest.Create(config['neuron_model'], config['NI'])
+    espikes = nest.Create("spike_recorder")
+    ispikes = nest.Create("spike_recorder")
+    espikes.set(record_to='ascii', label='ex', file_extension=file_extension,
+                precision=2)
+    ispikes.set(record_to='ascii', label='in', file_extension=file_extension,
+                precision=2)
+
+    noise = nest.Create(config['stimulus'], params={"rate": config['p_rate']})
+    if config['parrot_input']:
+        stimulus_input = nest.Create('parrot_neuron', 1)
+        nest.Connect(noise, stimulus_input, syn_spec="excitatory")
+    else:
+        stimulus_input = noise
+
+    # Connecting Devices
+
+    # nest.Connect(noise, nodes_ex, syn_spec="excitatory")
+    # nest.Connect(noise, nodes_in, syn_spec="excitatory")
+    nest.Connect(stimulus_input, nodes_ex+nodes_in, syn_spec="excitatory")
+
+    nest.Connect(nodes_ex, espikes, syn_spec="excitatory")
+    nest.Connect(nodes_in, ispikes, syn_spec="excitatory")
+
+    # Connecting Network
+
+    for pre, weight in zip(nodes_ex + nodes_in, weights):
+        nonzero_indices = np.where(weight != 0)[0]
+        weight = weight[nonzero_indices]
+        post_array = np.array(nodes_ex + nodes_in)[nonzero_indices]
+        pre_array = np.ones(len(nonzero_indices), dtype=int)*pre.get('global_id')
+        # delay = np.array([config['delay'] for _ in nonzero_indices])
+        delay = np.array([delay_dist.GetValue() for _ in nonzero_indices])
+
+        nest.Connect(pre_array, post_array, conn_spec='one_to_one',
+                     syn_spec={'weight': weight, 'delay': delay})
+
+    # conn = nest.GetConnections(source = nodes_ex + nodes_in,
+    #                            target = nodes_ex + nodes_in)
+    #
+    # weight_matrix = np.zeros((config['N'],config['N']))
+    # for s, t, w in nest.GetStatus(conn, ['source', 'target', 'weight']):
+    #     weight_matrix[s-1][t-1] = w
+
+    fname = lambda spikes, id: f'{data_prefix}{id}-{spikes.get("global_id")}' \
+                             + f'-{spikes.get("vp")}.{file_extension}'
+    espikes_path = data_path / fname(espikes, 'ex')
+    ispikes_path = data_path / fname(ispikes, 'in')
+    return espikes_path, ispikes_path
+
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--N",                 nargs='?', type=int)
+    CLI.add_argument("--f",                 nargs='?', type=float)
+    CLI.add_argument("--mu",                nargs='?', type=float)
+    CLI.add_argument("--epsilon",           nargs='?', type=float)
+    CLI.add_argument("--sigma_ex",          nargs='?', type=float)
+    CLI.add_argument("--sigma_in",          nargs='?', type=float)
+    CLI.add_argument("--simtime",           nargs='?', type=float)
+    CLI.add_argument("--eta",               nargs='?', type=float)
+    CLI.add_argument("--seed",              nargs='?', type=int)
+    CLI.add_argument("--spikes_ex_path",    nargs='?', type=str)
+    CLI.add_argument("--spikes_in_path",    nargs='?', type=str)
+    CLI.add_argument("--weights_path",      nargs='?', type=str)
+    CLI.add_argument("--network_config",    nargs='?', type=str)
+    args, unknown = CLI.parse_known_args()
+
+    dirname = os.path.dirname(args.weights_path)
+    if not os.path.exists(dirname):
+        os.makedirs(dirname)
+
+    # Loading default configs from config file
+    sys.path.append(os.path.dirname(args.network_config))
+    import config as network_config
+
+    locals_dict = locals()
+    config = dict([(k,v) for k,v in vars(network_config).items()
+                   if k not in locals_dict])
+    # Updating config with comandline arguments
+    # (These are only the parameters which are eventually expanded)
+    args.p_rate = network_config.p_rate_func(args.eta)
+
+    update_params = ['N', 'f', 'mu', 'epsilon', 'signma_ex', 'sigma_in',
+                     'simtime', 'seed', 'eta', 'p_rate']
+    config.update(dict([(k,v) for k,v in vars(args).items()
+                        if k in update_params]))
+
+    # Building network
+    starttime = time.time()
+    espikes_path, ispikes_path = build_network(config=config,
+                                          weights=np.load(args.weights_path),
+                                          spikes_ex_output= args.spikes_ex_path,
+                                          spikes_in_output= args.spikes_in_path)
+    # Run simulation
+    nest.Simulate(config['simtime'])
+    endtime = time.time()
+    print("Simulation time : {:.2} s".format(endtime-starttime))
+
+    espikes_path.rename(args.spikes_ex_path)
+    ispikes_path.rename(args.spikes_in_path)

BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.2E-0.1E/correlations.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.2E-0.1E/spikes_50000-60000ms.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.2E-0.1E/spikes_59000-60000ms.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.2E-0.1E/weights.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.2E-0.5E/spikes_55000-60000ms.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.2E-0.5E/weights.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.5E-0.5E/correlations.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.5E-0.5E/spikes_55000-60000ms.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.5E-0.5E/weights.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.5E-0.6E/correlations.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_0.5E-0.6E/spikes_55000-60000ms.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/add_12800E-0.05E/weights.png


Файловите разлики са ограничени, защото са твърде много
+ 5056 - 0
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/config.yml


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/original/correlations.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/original/spikes_50000-60000ms.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/original/spikes_55000-60000ms.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/original/spikes_59000-60000ms.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/original/weights.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/shuffle_0.2_E-E/correlations.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/shuffle_0.2_E-E/spikes_50000-60000ms.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/shuffle_0.2_E-E/spikes_59000-60000ms.png


BIN
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_1/shuffle_0.2_E-E/weights.png


+ 538 - 0
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_10/config.yml

@@ -0,0 +1,538 @@
+CE: 80.0
+CI: 20.0
+J_ex: 0.1
+J_in: -0.4000000000000002
+N: 1000
+NE: 800
+NI: 200
+add_source: E
+add_source_frac: 0.2
+add_target: E
+add_target_frac:
+- 0.05
+- 0.1
+- 0.2
+- 0.4
+- 0.6
+- 0.8
+- 1.0
+bin_num: 30000
+bin_size: 2
+chain_epsilon: 0.6
+chain_length: 3
+chain_pop: E
+chain_size:
+- 0.05
+- 0.1
+- 0.15
+- 0.2
+chain_strength:
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_epsilon:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_number: 3
+cluster_pop: E
+cluster_size:
+- 0.02
+- 0.04
+- 0.06
+- 0.08
+connectors:
+- 0
+- 30
+cut_inital_time: 1000
+delay:
+- 0.5
+- 3
+dt: 0.1
+epsilon: 0.1
+eta: 0.9
+ex_connection_rule: pairwise_bernoulli
+f: 0.8
+hub_epsilon: 0.5
+hub_pop: E
+hub_size:
+- 0.04
+- 0.06
+- 0.08
+- 0.1
+hub_strength:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+in_connection_rule: pairwise_bernoulli
+mu: 0.1
+neuron_model: iaf_psc_delta
+neuron_params:
+  C_m: 1.0
+  E_L: 0.0
+  V_m: 0.0
+  V_reset: 0.0
+  V_th: 20.0
+  t_ref: 2.0
+  tau_m: 20.0
+nu_ex: 0.1125
+nu_th: 0.125
+p_rate: 9000.0
+p_rate_func: !!python/name:config.%3Clambda%3E ''
+parrot_input: false
+seed: 10
+seed_pairs:
+- 1-2
+- 1-3
+- 1-4
+- 1-5
+- 1-6
+- 1-7
+- 1-8
+- 1-9
+- 1-10
+- 1-11
+- 1-12
+- 1-13
+- 1-14
+- 1-15
+- 1-16
+- 1-17
+- 1-18
+- 1-19
+- 1-20
+- 1-21
+- 1-22
+- 1-23
+- 1-24
+- 1-25
+- 1-26
+- 1-27
+- 1-28
+- 1-29
+- 1-30
+- 2-3
+- 2-4
+- 2-5
+- 2-6
+- 2-7
+- 2-8
+- 2-9
+- 2-10
+- 2-11
+- 2-12
+- 2-13
+- 2-14
+- 2-15
+- 2-16
+- 2-17
+- 2-18
+- 2-19
+- 2-20
+- 2-21
+- 2-22
+- 2-23
+- 2-24
+- 2-25
+- 2-26
+- 2-27
+- 2-28
+- 2-29
+- 2-30
+- 3-4
+- 3-5
+- 3-6
+- 3-7
+- 3-8
+- 3-9
+- 3-10
+- 3-11
+- 3-12
+- 3-13
+- 3-14
+- 3-15
+- 3-16
+- 3-17
+- 3-18
+- 3-19
+- 3-20
+- 3-21
+- 3-22
+- 3-23
+- 3-24
+- 3-25
+- 3-26
+- 3-27
+- 3-28
+- 3-29
+- 3-30
+- 4-5
+- 4-6
+- 4-7
+- 4-8
+- 4-9
+- 4-10
+- 4-11
+- 4-12
+- 4-13
+- 4-14
+- 4-15
+- 4-16
+- 4-17
+- 4-18
+- 4-19
+- 4-20
+- 4-21
+- 4-22
+- 4-23
+- 4-24
+- 4-25
+- 4-26
+- 4-27
+- 4-28
+- 4-29
+- 4-30
+- 5-6
+- 5-7
+- 5-8
+- 5-9
+- 5-10
+- 5-11
+- 5-12
+- 5-13
+- 5-14
+- 5-15
+- 5-16
+- 5-17
+- 5-18
+- 5-19
+- 5-20
+- 5-21
+- 5-22
+- 5-23
+- 5-24
+- 5-25
+- 5-26
+- 5-27
+- 5-28
+- 5-29
+- 5-30
+- 6-7
+- 6-8
+- 6-9
+- 6-10
+- 6-11
+- 6-12
+- 6-13
+- 6-14
+- 6-15
+- 6-16
+- 6-17
+- 6-18
+- 6-19
+- 6-20
+- 6-21
+- 6-22
+- 6-23
+- 6-24
+- 6-25
+- 6-26
+- 6-27
+- 6-28
+- 6-29
+- 6-30
+- 7-8
+- 7-9
+- 7-10
+- 7-11
+- 7-12
+- 7-13
+- 7-14
+- 7-15
+- 7-16
+- 7-17
+- 7-18
+- 7-19
+- 7-20
+- 7-21
+- 7-22
+- 7-23
+- 7-24
+- 7-25
+- 7-26
+- 7-27
+- 7-28
+- 7-29
+- 7-30
+- 8-9
+- 8-10
+- 8-11
+- 8-12
+- 8-13
+- 8-14
+- 8-15
+- 8-16
+- 8-17
+- 8-18
+- 8-19
+- 8-20
+- 8-21
+- 8-22
+- 8-23
+- 8-24
+- 8-25
+- 8-26
+- 8-27
+- 8-28
+- 8-29
+- 8-30
+- 9-10
+- 9-11
+- 9-12
+- 9-13
+- 9-14
+- 9-15
+- 9-16
+- 9-17
+- 9-18
+- 9-19
+- 9-20
+- 9-21
+- 9-22
+- 9-23
+- 9-24
+- 9-25
+- 9-26
+- 9-27
+- 9-28
+- 9-29
+- 9-30
+- 10-11
+- 10-12
+- 10-13
+- 10-14
+- 10-15
+- 10-16
+- 10-17
+- 10-18
+- 10-19
+- 10-20
+- 10-21
+- 10-22
+- 10-23
+- 10-24
+- 10-25
+- 10-26
+- 10-27
+- 10-28
+- 10-29
+- 10-30
+- 11-12
+- 11-13
+- 11-14
+- 11-15
+- 11-16
+- 11-17
+- 11-18
+- 11-19
+- 11-20
+- 11-21
+- 11-22
+- 11-23
+- 11-24
+- 11-25
+- 11-26
+- 11-27
+- 11-28
+- 11-29
+- 11-30
+- 12-13
+- 12-14
+- 12-15
+- 12-16
+- 12-17
+- 12-18
+- 12-19
+- 12-20
+- 12-21
+- 12-22
+- 12-23
+- 12-24
+- 12-25
+- 12-26
+- 12-27
+- 12-28
+- 12-29
+- 12-30
+- 13-14
+- 13-15
+- 13-16
+- 13-17
+- 13-18
+- 13-19
+- 13-20
+- 13-21
+- 13-22
+- 13-23
+- 13-24
+- 13-25
+- 13-26
+- 13-27
+- 13-28
+- 13-29
+- 13-30
+- 14-15
+- 14-16
+- 14-17
+- 14-18
+- 14-19
+- 14-20
+- 14-21
+- 14-22
+- 14-23
+- 14-24
+- 14-25
+- 14-26
+- 14-27
+- 14-28
+- 14-29
+- 14-30
+- 15-16
+- 15-17
+- 15-18
+- 15-19
+- 15-20
+- 15-21
+- 15-22
+- 15-23
+- 15-24
+- 15-25
+- 15-26
+- 15-27
+- 15-28
+- 15-29
+- 15-30
+- 16-17
+- 16-18
+- 16-19
+- 16-20
+- 16-21
+- 16-22
+- 16-23
+- 16-24
+- 16-25
+- 16-26
+- 16-27
+- 16-28
+- 16-29
+- 16-30
+- 17-18
+- 17-19
+- 17-20
+- 17-21
+- 17-22
+- 17-23
+- 17-24
+- 17-25
+- 17-26
+- 17-27
+- 17-28
+- 17-29
+- 17-30
+- 18-19
+- 18-20
+- 18-21
+- 18-22
+- 18-23
+- 18-24
+- 18-25
+- 18-26
+- 18-27
+- 18-28
+- 18-29
+- 18-30
+- 19-20
+- 19-21
+- 19-22
+- 19-23
+- 19-24
+- 19-25
+- 19-26
+- 19-27
+- 19-28
+- 19-29
+- 19-30
+- 20-21
+- 20-22
+- 20-23
+- 20-24
+- 20-25
+- 20-26
+- 20-27
+- 20-28
+- 20-29
+- 20-30
+- 21-22
+- 21-23
+- 21-24
+- 21-25
+- 21-26
+- 21-27
+- 21-28
+- 21-29
+- 21-30
+- 22-23
+- 22-24
+- 22-25
+- 22-26
+- 22-27
+- 22-28
+- 22-29
+- 22-30
+- 23-24
+- 23-25
+- 23-26
+- 23-27
+- 23-28
+- 23-29
+- 23-30
+- 24-25
+- 24-26
+- 24-27
+- 24-28
+- 24-29
+- 24-30
+- 25-26
+- 25-27
+- 25-28
+- 25-29
+- 25-30
+- 26-27
+- 26-28
+- 26-29
+- 26-30
+- 27-28
+- 27-29
+- 27-30
+- 28-29
+- 28-30
+- 29-30
+shuffle_frac: 1.0
+shuffle_source:
+- E
+- I
+shuffle_target:
+- E
+- I
+sigma_ex: 0.12
+sigma_in: 0.1
+simtime: 61000
+stimulus: poisson_generator
+synapse_model: static_synapse
+syndist: lognormal
+tauMem: 20.0
+theta: 20.0

+ 540 - 0
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_2/config.yml

@@ -0,0 +1,540 @@
+CE: 80.0
+CI: 20.0
+J_ex: 0.1
+J_in: -0.4000000000000002
+N: 1000
+NE: 800
+NI: 200
+add_source: E
+add_source_frac:
+- 0.2
+- 12800
+add_target: E
+add_target_frac:
+- 0.05
+- 0.1
+- 0.2
+- 0.4
+- 0.6
+- 0.8
+- 1.0
+bin_num: 30000
+bin_size: 2
+chain_epsilon: 0.6
+chain_length: 3
+chain_pop: E
+chain_size:
+- 0.05
+- 0.1
+- 0.15
+- 0.2
+chain_strength:
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_epsilon:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_number: 3
+cluster_pop: E
+cluster_size:
+- 0.02
+- 0.04
+- 0.06
+- 0.08
+connectors:
+- 0
+- 30
+cut_inital_time: 1000
+delay:
+- 0.5
+- 3
+dt: 0.1
+epsilon: 0.1
+eta: 0.9
+ex_connection_rule: pairwise_bernoulli
+f: 0.8
+hub_epsilon: 0.5
+hub_pop: E
+hub_size:
+- 0.04
+- 0.06
+- 0.08
+- 0.1
+hub_strength:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+in_connection_rule: pairwise_bernoulli
+mu: 0.1
+neuron_model: iaf_psc_delta
+neuron_params:
+  C_m: 1.0
+  E_L: 0.0
+  V_m: 0.0
+  V_reset: 0.0
+  V_th: 20.0
+  t_ref: 2.0
+  tau_m: 20.0
+nu_ex: 0.1125
+nu_th: 0.125
+p_rate: 9000.0
+p_rate_func: !!python/name:config.%3Clambda%3E ''
+parrot_input: false
+seed: 2
+seed_pairs:
+- 1-2
+- 1-3
+- 1-4
+- 1-5
+- 1-6
+- 1-7
+- 1-8
+- 1-9
+- 1-10
+- 1-11
+- 1-12
+- 1-13
+- 1-14
+- 1-15
+- 1-16
+- 1-17
+- 1-18
+- 1-19
+- 1-20
+- 1-21
+- 1-22
+- 1-23
+- 1-24
+- 1-25
+- 1-26
+- 1-27
+- 1-28
+- 1-29
+- 1-30
+- 2-3
+- 2-4
+- 2-5
+- 2-6
+- 2-7
+- 2-8
+- 2-9
+- 2-10
+- 2-11
+- 2-12
+- 2-13
+- 2-14
+- 2-15
+- 2-16
+- 2-17
+- 2-18
+- 2-19
+- 2-20
+- 2-21
+- 2-22
+- 2-23
+- 2-24
+- 2-25
+- 2-26
+- 2-27
+- 2-28
+- 2-29
+- 2-30
+- 3-4
+- 3-5
+- 3-6
+- 3-7
+- 3-8
+- 3-9
+- 3-10
+- 3-11
+- 3-12
+- 3-13
+- 3-14
+- 3-15
+- 3-16
+- 3-17
+- 3-18
+- 3-19
+- 3-20
+- 3-21
+- 3-22
+- 3-23
+- 3-24
+- 3-25
+- 3-26
+- 3-27
+- 3-28
+- 3-29
+- 3-30
+- 4-5
+- 4-6
+- 4-7
+- 4-8
+- 4-9
+- 4-10
+- 4-11
+- 4-12
+- 4-13
+- 4-14
+- 4-15
+- 4-16
+- 4-17
+- 4-18
+- 4-19
+- 4-20
+- 4-21
+- 4-22
+- 4-23
+- 4-24
+- 4-25
+- 4-26
+- 4-27
+- 4-28
+- 4-29
+- 4-30
+- 5-6
+- 5-7
+- 5-8
+- 5-9
+- 5-10
+- 5-11
+- 5-12
+- 5-13
+- 5-14
+- 5-15
+- 5-16
+- 5-17
+- 5-18
+- 5-19
+- 5-20
+- 5-21
+- 5-22
+- 5-23
+- 5-24
+- 5-25
+- 5-26
+- 5-27
+- 5-28
+- 5-29
+- 5-30
+- 6-7
+- 6-8
+- 6-9
+- 6-10
+- 6-11
+- 6-12
+- 6-13
+- 6-14
+- 6-15
+- 6-16
+- 6-17
+- 6-18
+- 6-19
+- 6-20
+- 6-21
+- 6-22
+- 6-23
+- 6-24
+- 6-25
+- 6-26
+- 6-27
+- 6-28
+- 6-29
+- 6-30
+- 7-8
+- 7-9
+- 7-10
+- 7-11
+- 7-12
+- 7-13
+- 7-14
+- 7-15
+- 7-16
+- 7-17
+- 7-18
+- 7-19
+- 7-20
+- 7-21
+- 7-22
+- 7-23
+- 7-24
+- 7-25
+- 7-26
+- 7-27
+- 7-28
+- 7-29
+- 7-30
+- 8-9
+- 8-10
+- 8-11
+- 8-12
+- 8-13
+- 8-14
+- 8-15
+- 8-16
+- 8-17
+- 8-18
+- 8-19
+- 8-20
+- 8-21
+- 8-22
+- 8-23
+- 8-24
+- 8-25
+- 8-26
+- 8-27
+- 8-28
+- 8-29
+- 8-30
+- 9-10
+- 9-11
+- 9-12
+- 9-13
+- 9-14
+- 9-15
+- 9-16
+- 9-17
+- 9-18
+- 9-19
+- 9-20
+- 9-21
+- 9-22
+- 9-23
+- 9-24
+- 9-25
+- 9-26
+- 9-27
+- 9-28
+- 9-29
+- 9-30
+- 10-11
+- 10-12
+- 10-13
+- 10-14
+- 10-15
+- 10-16
+- 10-17
+- 10-18
+- 10-19
+- 10-20
+- 10-21
+- 10-22
+- 10-23
+- 10-24
+- 10-25
+- 10-26
+- 10-27
+- 10-28
+- 10-29
+- 10-30
+- 11-12
+- 11-13
+- 11-14
+- 11-15
+- 11-16
+- 11-17
+- 11-18
+- 11-19
+- 11-20
+- 11-21
+- 11-22
+- 11-23
+- 11-24
+- 11-25
+- 11-26
+- 11-27
+- 11-28
+- 11-29
+- 11-30
+- 12-13
+- 12-14
+- 12-15
+- 12-16
+- 12-17
+- 12-18
+- 12-19
+- 12-20
+- 12-21
+- 12-22
+- 12-23
+- 12-24
+- 12-25
+- 12-26
+- 12-27
+- 12-28
+- 12-29
+- 12-30
+- 13-14
+- 13-15
+- 13-16
+- 13-17
+- 13-18
+- 13-19
+- 13-20
+- 13-21
+- 13-22
+- 13-23
+- 13-24
+- 13-25
+- 13-26
+- 13-27
+- 13-28
+- 13-29
+- 13-30
+- 14-15
+- 14-16
+- 14-17
+- 14-18
+- 14-19
+- 14-20
+- 14-21
+- 14-22
+- 14-23
+- 14-24
+- 14-25
+- 14-26
+- 14-27
+- 14-28
+- 14-29
+- 14-30
+- 15-16
+- 15-17
+- 15-18
+- 15-19
+- 15-20
+- 15-21
+- 15-22
+- 15-23
+- 15-24
+- 15-25
+- 15-26
+- 15-27
+- 15-28
+- 15-29
+- 15-30
+- 16-17
+- 16-18
+- 16-19
+- 16-20
+- 16-21
+- 16-22
+- 16-23
+- 16-24
+- 16-25
+- 16-26
+- 16-27
+- 16-28
+- 16-29
+- 16-30
+- 17-18
+- 17-19
+- 17-20
+- 17-21
+- 17-22
+- 17-23
+- 17-24
+- 17-25
+- 17-26
+- 17-27
+- 17-28
+- 17-29
+- 17-30
+- 18-19
+- 18-20
+- 18-21
+- 18-22
+- 18-23
+- 18-24
+- 18-25
+- 18-26
+- 18-27
+- 18-28
+- 18-29
+- 18-30
+- 19-20
+- 19-21
+- 19-22
+- 19-23
+- 19-24
+- 19-25
+- 19-26
+- 19-27
+- 19-28
+- 19-29
+- 19-30
+- 20-21
+- 20-22
+- 20-23
+- 20-24
+- 20-25
+- 20-26
+- 20-27
+- 20-28
+- 20-29
+- 20-30
+- 21-22
+- 21-23
+- 21-24
+- 21-25
+- 21-26
+- 21-27
+- 21-28
+- 21-29
+- 21-30
+- 22-23
+- 22-24
+- 22-25
+- 22-26
+- 22-27
+- 22-28
+- 22-29
+- 22-30
+- 23-24
+- 23-25
+- 23-26
+- 23-27
+- 23-28
+- 23-29
+- 23-30
+- 24-25
+- 24-26
+- 24-27
+- 24-28
+- 24-29
+- 24-30
+- 25-26
+- 25-27
+- 25-28
+- 25-29
+- 25-30
+- 26-27
+- 26-28
+- 26-29
+- 26-30
+- 27-28
+- 27-29
+- 27-30
+- 28-29
+- 28-30
+- 29-30
+shuffle_frac: 1.0
+shuffle_source:
+- E
+- I
+shuffle_target:
+- E
+- I
+sigma_ex: 0.12
+sigma_in: 0.1
+simtime: 61000
+stimulus: poisson_generator
+synapse_model: static_synapse
+syndist: lognormal
+tauMem: 20.0
+theta: 20.0

+ 540 - 0
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_3/config.yml

@@ -0,0 +1,540 @@
+CE: 80.0
+CI: 20.0
+J_ex: 0.1
+J_in: -0.4000000000000002
+N: 1000
+NE: 800
+NI: 200
+add_source: E
+add_source_frac:
+- 0.2
+- 12800
+add_target: E
+add_target_frac:
+- 0.05
+- 0.1
+- 0.2
+- 0.4
+- 0.6
+- 0.8
+- 1.0
+bin_num: 30000
+bin_size: 2
+chain_epsilon: 0.6
+chain_length: 3
+chain_pop: E
+chain_size:
+- 0.05
+- 0.1
+- 0.15
+- 0.2
+chain_strength:
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_epsilon:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_number: 3
+cluster_pop: E
+cluster_size:
+- 0.02
+- 0.04
+- 0.06
+- 0.08
+connectors:
+- 0
+- 30
+cut_inital_time: 1000
+delay:
+- 0.5
+- 3
+dt: 0.1
+epsilon: 0.1
+eta: 0.9
+ex_connection_rule: pairwise_bernoulli
+f: 0.8
+hub_epsilon: 0.5
+hub_pop: E
+hub_size:
+- 0.04
+- 0.06
+- 0.08
+- 0.1
+hub_strength:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+in_connection_rule: pairwise_bernoulli
+mu: 0.1
+neuron_model: iaf_psc_delta
+neuron_params:
+  C_m: 1.0
+  E_L: 0.0
+  V_m: 0.0
+  V_reset: 0.0
+  V_th: 20.0
+  t_ref: 2.0
+  tau_m: 20.0
+nu_ex: 0.1125
+nu_th: 0.125
+p_rate: 9000.0
+p_rate_func: !!python/name:config.%3Clambda%3E ''
+parrot_input: false
+seed: 3
+seed_pairs:
+- 1-2
+- 1-3
+- 1-4
+- 1-5
+- 1-6
+- 1-7
+- 1-8
+- 1-9
+- 1-10
+- 1-11
+- 1-12
+- 1-13
+- 1-14
+- 1-15
+- 1-16
+- 1-17
+- 1-18
+- 1-19
+- 1-20
+- 1-21
+- 1-22
+- 1-23
+- 1-24
+- 1-25
+- 1-26
+- 1-27
+- 1-28
+- 1-29
+- 1-30
+- 2-3
+- 2-4
+- 2-5
+- 2-6
+- 2-7
+- 2-8
+- 2-9
+- 2-10
+- 2-11
+- 2-12
+- 2-13
+- 2-14
+- 2-15
+- 2-16
+- 2-17
+- 2-18
+- 2-19
+- 2-20
+- 2-21
+- 2-22
+- 2-23
+- 2-24
+- 2-25
+- 2-26
+- 2-27
+- 2-28
+- 2-29
+- 2-30
+- 3-4
+- 3-5
+- 3-6
+- 3-7
+- 3-8
+- 3-9
+- 3-10
+- 3-11
+- 3-12
+- 3-13
+- 3-14
+- 3-15
+- 3-16
+- 3-17
+- 3-18
+- 3-19
+- 3-20
+- 3-21
+- 3-22
+- 3-23
+- 3-24
+- 3-25
+- 3-26
+- 3-27
+- 3-28
+- 3-29
+- 3-30
+- 4-5
+- 4-6
+- 4-7
+- 4-8
+- 4-9
+- 4-10
+- 4-11
+- 4-12
+- 4-13
+- 4-14
+- 4-15
+- 4-16
+- 4-17
+- 4-18
+- 4-19
+- 4-20
+- 4-21
+- 4-22
+- 4-23
+- 4-24
+- 4-25
+- 4-26
+- 4-27
+- 4-28
+- 4-29
+- 4-30
+- 5-6
+- 5-7
+- 5-8
+- 5-9
+- 5-10
+- 5-11
+- 5-12
+- 5-13
+- 5-14
+- 5-15
+- 5-16
+- 5-17
+- 5-18
+- 5-19
+- 5-20
+- 5-21
+- 5-22
+- 5-23
+- 5-24
+- 5-25
+- 5-26
+- 5-27
+- 5-28
+- 5-29
+- 5-30
+- 6-7
+- 6-8
+- 6-9
+- 6-10
+- 6-11
+- 6-12
+- 6-13
+- 6-14
+- 6-15
+- 6-16
+- 6-17
+- 6-18
+- 6-19
+- 6-20
+- 6-21
+- 6-22
+- 6-23
+- 6-24
+- 6-25
+- 6-26
+- 6-27
+- 6-28
+- 6-29
+- 6-30
+- 7-8
+- 7-9
+- 7-10
+- 7-11
+- 7-12
+- 7-13
+- 7-14
+- 7-15
+- 7-16
+- 7-17
+- 7-18
+- 7-19
+- 7-20
+- 7-21
+- 7-22
+- 7-23
+- 7-24
+- 7-25
+- 7-26
+- 7-27
+- 7-28
+- 7-29
+- 7-30
+- 8-9
+- 8-10
+- 8-11
+- 8-12
+- 8-13
+- 8-14
+- 8-15
+- 8-16
+- 8-17
+- 8-18
+- 8-19
+- 8-20
+- 8-21
+- 8-22
+- 8-23
+- 8-24
+- 8-25
+- 8-26
+- 8-27
+- 8-28
+- 8-29
+- 8-30
+- 9-10
+- 9-11
+- 9-12
+- 9-13
+- 9-14
+- 9-15
+- 9-16
+- 9-17
+- 9-18
+- 9-19
+- 9-20
+- 9-21
+- 9-22
+- 9-23
+- 9-24
+- 9-25
+- 9-26
+- 9-27
+- 9-28
+- 9-29
+- 9-30
+- 10-11
+- 10-12
+- 10-13
+- 10-14
+- 10-15
+- 10-16
+- 10-17
+- 10-18
+- 10-19
+- 10-20
+- 10-21
+- 10-22
+- 10-23
+- 10-24
+- 10-25
+- 10-26
+- 10-27
+- 10-28
+- 10-29
+- 10-30
+- 11-12
+- 11-13
+- 11-14
+- 11-15
+- 11-16
+- 11-17
+- 11-18
+- 11-19
+- 11-20
+- 11-21
+- 11-22
+- 11-23
+- 11-24
+- 11-25
+- 11-26
+- 11-27
+- 11-28
+- 11-29
+- 11-30
+- 12-13
+- 12-14
+- 12-15
+- 12-16
+- 12-17
+- 12-18
+- 12-19
+- 12-20
+- 12-21
+- 12-22
+- 12-23
+- 12-24
+- 12-25
+- 12-26
+- 12-27
+- 12-28
+- 12-29
+- 12-30
+- 13-14
+- 13-15
+- 13-16
+- 13-17
+- 13-18
+- 13-19
+- 13-20
+- 13-21
+- 13-22
+- 13-23
+- 13-24
+- 13-25
+- 13-26
+- 13-27
+- 13-28
+- 13-29
+- 13-30
+- 14-15
+- 14-16
+- 14-17
+- 14-18
+- 14-19
+- 14-20
+- 14-21
+- 14-22
+- 14-23
+- 14-24
+- 14-25
+- 14-26
+- 14-27
+- 14-28
+- 14-29
+- 14-30
+- 15-16
+- 15-17
+- 15-18
+- 15-19
+- 15-20
+- 15-21
+- 15-22
+- 15-23
+- 15-24
+- 15-25
+- 15-26
+- 15-27
+- 15-28
+- 15-29
+- 15-30
+- 16-17
+- 16-18
+- 16-19
+- 16-20
+- 16-21
+- 16-22
+- 16-23
+- 16-24
+- 16-25
+- 16-26
+- 16-27
+- 16-28
+- 16-29
+- 16-30
+- 17-18
+- 17-19
+- 17-20
+- 17-21
+- 17-22
+- 17-23
+- 17-24
+- 17-25
+- 17-26
+- 17-27
+- 17-28
+- 17-29
+- 17-30
+- 18-19
+- 18-20
+- 18-21
+- 18-22
+- 18-23
+- 18-24
+- 18-25
+- 18-26
+- 18-27
+- 18-28
+- 18-29
+- 18-30
+- 19-20
+- 19-21
+- 19-22
+- 19-23
+- 19-24
+- 19-25
+- 19-26
+- 19-27
+- 19-28
+- 19-29
+- 19-30
+- 20-21
+- 20-22
+- 20-23
+- 20-24
+- 20-25
+- 20-26
+- 20-27
+- 20-28
+- 20-29
+- 20-30
+- 21-22
+- 21-23
+- 21-24
+- 21-25
+- 21-26
+- 21-27
+- 21-28
+- 21-29
+- 21-30
+- 22-23
+- 22-24
+- 22-25
+- 22-26
+- 22-27
+- 22-28
+- 22-29
+- 22-30
+- 23-24
+- 23-25
+- 23-26
+- 23-27
+- 23-28
+- 23-29
+- 23-30
+- 24-25
+- 24-26
+- 24-27
+- 24-28
+- 24-29
+- 24-30
+- 25-26
+- 25-27
+- 25-28
+- 25-29
+- 25-30
+- 26-27
+- 26-28
+- 26-29
+- 26-30
+- 27-28
+- 27-29
+- 27-30
+- 28-29
+- 28-30
+- 29-30
+shuffle_frac: 1.0
+shuffle_source:
+- E
+- I
+shuffle_target:
+- E
+- I
+sigma_ex: 0.12
+sigma_in: 0.1
+simtime: 61000
+stimulus: poisson_generator
+synapse_model: static_synapse
+syndist: lognormal
+tauMem: 20.0
+theta: 20.0

+ 540 - 0
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_4/config.yml

@@ -0,0 +1,540 @@
+CE: 80.0
+CI: 20.0
+J_ex: 0.1
+J_in: -0.4000000000000002
+N: 1000
+NE: 800
+NI: 200
+add_source: E
+add_source_frac:
+- 0.2
+- 12800
+add_target: E
+add_target_frac:
+- 0.05
+- 0.1
+- 0.2
+- 0.4
+- 0.6
+- 0.8
+- 1.0
+bin_num: 30000
+bin_size: 2
+chain_epsilon: 0.6
+chain_length: 3
+chain_pop: E
+chain_size:
+- 0.05
+- 0.1
+- 0.15
+- 0.2
+chain_strength:
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_epsilon:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_number: 3
+cluster_pop: E
+cluster_size:
+- 0.02
+- 0.04
+- 0.06
+- 0.08
+connectors:
+- 0
+- 30
+cut_inital_time: 1000
+delay:
+- 0.5
+- 3
+dt: 0.1
+epsilon: 0.1
+eta: 0.9
+ex_connection_rule: pairwise_bernoulli
+f: 0.8
+hub_epsilon: 0.5
+hub_pop: E
+hub_size:
+- 0.04
+- 0.06
+- 0.08
+- 0.1
+hub_strength:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+in_connection_rule: pairwise_bernoulli
+mu: 0.1
+neuron_model: iaf_psc_delta
+neuron_params:
+  C_m: 1.0
+  E_L: 0.0
+  V_m: 0.0
+  V_reset: 0.0
+  V_th: 20.0
+  t_ref: 2.0
+  tau_m: 20.0
+nu_ex: 0.1125
+nu_th: 0.125
+p_rate: 9000.0
+p_rate_func: !!python/name:config.%3Clambda%3E ''
+parrot_input: false
+seed: 4
+seed_pairs:
+- 1-2
+- 1-3
+- 1-4
+- 1-5
+- 1-6
+- 1-7
+- 1-8
+- 1-9
+- 1-10
+- 1-11
+- 1-12
+- 1-13
+- 1-14
+- 1-15
+- 1-16
+- 1-17
+- 1-18
+- 1-19
+- 1-20
+- 1-21
+- 1-22
+- 1-23
+- 1-24
+- 1-25
+- 1-26
+- 1-27
+- 1-28
+- 1-29
+- 1-30
+- 2-3
+- 2-4
+- 2-5
+- 2-6
+- 2-7
+- 2-8
+- 2-9
+- 2-10
+- 2-11
+- 2-12
+- 2-13
+- 2-14
+- 2-15
+- 2-16
+- 2-17
+- 2-18
+- 2-19
+- 2-20
+- 2-21
+- 2-22
+- 2-23
+- 2-24
+- 2-25
+- 2-26
+- 2-27
+- 2-28
+- 2-29
+- 2-30
+- 3-4
+- 3-5
+- 3-6
+- 3-7
+- 3-8
+- 3-9
+- 3-10
+- 3-11
+- 3-12
+- 3-13
+- 3-14
+- 3-15
+- 3-16
+- 3-17
+- 3-18
+- 3-19
+- 3-20
+- 3-21
+- 3-22
+- 3-23
+- 3-24
+- 3-25
+- 3-26
+- 3-27
+- 3-28
+- 3-29
+- 3-30
+- 4-5
+- 4-6
+- 4-7
+- 4-8
+- 4-9
+- 4-10
+- 4-11
+- 4-12
+- 4-13
+- 4-14
+- 4-15
+- 4-16
+- 4-17
+- 4-18
+- 4-19
+- 4-20
+- 4-21
+- 4-22
+- 4-23
+- 4-24
+- 4-25
+- 4-26
+- 4-27
+- 4-28
+- 4-29
+- 4-30
+- 5-6
+- 5-7
+- 5-8
+- 5-9
+- 5-10
+- 5-11
+- 5-12
+- 5-13
+- 5-14
+- 5-15
+- 5-16
+- 5-17
+- 5-18
+- 5-19
+- 5-20
+- 5-21
+- 5-22
+- 5-23
+- 5-24
+- 5-25
+- 5-26
+- 5-27
+- 5-28
+- 5-29
+- 5-30
+- 6-7
+- 6-8
+- 6-9
+- 6-10
+- 6-11
+- 6-12
+- 6-13
+- 6-14
+- 6-15
+- 6-16
+- 6-17
+- 6-18
+- 6-19
+- 6-20
+- 6-21
+- 6-22
+- 6-23
+- 6-24
+- 6-25
+- 6-26
+- 6-27
+- 6-28
+- 6-29
+- 6-30
+- 7-8
+- 7-9
+- 7-10
+- 7-11
+- 7-12
+- 7-13
+- 7-14
+- 7-15
+- 7-16
+- 7-17
+- 7-18
+- 7-19
+- 7-20
+- 7-21
+- 7-22
+- 7-23
+- 7-24
+- 7-25
+- 7-26
+- 7-27
+- 7-28
+- 7-29
+- 7-30
+- 8-9
+- 8-10
+- 8-11
+- 8-12
+- 8-13
+- 8-14
+- 8-15
+- 8-16
+- 8-17
+- 8-18
+- 8-19
+- 8-20
+- 8-21
+- 8-22
+- 8-23
+- 8-24
+- 8-25
+- 8-26
+- 8-27
+- 8-28
+- 8-29
+- 8-30
+- 9-10
+- 9-11
+- 9-12
+- 9-13
+- 9-14
+- 9-15
+- 9-16
+- 9-17
+- 9-18
+- 9-19
+- 9-20
+- 9-21
+- 9-22
+- 9-23
+- 9-24
+- 9-25
+- 9-26
+- 9-27
+- 9-28
+- 9-29
+- 9-30
+- 10-11
+- 10-12
+- 10-13
+- 10-14
+- 10-15
+- 10-16
+- 10-17
+- 10-18
+- 10-19
+- 10-20
+- 10-21
+- 10-22
+- 10-23
+- 10-24
+- 10-25
+- 10-26
+- 10-27
+- 10-28
+- 10-29
+- 10-30
+- 11-12
+- 11-13
+- 11-14
+- 11-15
+- 11-16
+- 11-17
+- 11-18
+- 11-19
+- 11-20
+- 11-21
+- 11-22
+- 11-23
+- 11-24
+- 11-25
+- 11-26
+- 11-27
+- 11-28
+- 11-29
+- 11-30
+- 12-13
+- 12-14
+- 12-15
+- 12-16
+- 12-17
+- 12-18
+- 12-19
+- 12-20
+- 12-21
+- 12-22
+- 12-23
+- 12-24
+- 12-25
+- 12-26
+- 12-27
+- 12-28
+- 12-29
+- 12-30
+- 13-14
+- 13-15
+- 13-16
+- 13-17
+- 13-18
+- 13-19
+- 13-20
+- 13-21
+- 13-22
+- 13-23
+- 13-24
+- 13-25
+- 13-26
+- 13-27
+- 13-28
+- 13-29
+- 13-30
+- 14-15
+- 14-16
+- 14-17
+- 14-18
+- 14-19
+- 14-20
+- 14-21
+- 14-22
+- 14-23
+- 14-24
+- 14-25
+- 14-26
+- 14-27
+- 14-28
+- 14-29
+- 14-30
+- 15-16
+- 15-17
+- 15-18
+- 15-19
+- 15-20
+- 15-21
+- 15-22
+- 15-23
+- 15-24
+- 15-25
+- 15-26
+- 15-27
+- 15-28
+- 15-29
+- 15-30
+- 16-17
+- 16-18
+- 16-19
+- 16-20
+- 16-21
+- 16-22
+- 16-23
+- 16-24
+- 16-25
+- 16-26
+- 16-27
+- 16-28
+- 16-29
+- 16-30
+- 17-18
+- 17-19
+- 17-20
+- 17-21
+- 17-22
+- 17-23
+- 17-24
+- 17-25
+- 17-26
+- 17-27
+- 17-28
+- 17-29
+- 17-30
+- 18-19
+- 18-20
+- 18-21
+- 18-22
+- 18-23
+- 18-24
+- 18-25
+- 18-26
+- 18-27
+- 18-28
+- 18-29
+- 18-30
+- 19-20
+- 19-21
+- 19-22
+- 19-23
+- 19-24
+- 19-25
+- 19-26
+- 19-27
+- 19-28
+- 19-29
+- 19-30
+- 20-21
+- 20-22
+- 20-23
+- 20-24
+- 20-25
+- 20-26
+- 20-27
+- 20-28
+- 20-29
+- 20-30
+- 21-22
+- 21-23
+- 21-24
+- 21-25
+- 21-26
+- 21-27
+- 21-28
+- 21-29
+- 21-30
+- 22-23
+- 22-24
+- 22-25
+- 22-26
+- 22-27
+- 22-28
+- 22-29
+- 22-30
+- 23-24
+- 23-25
+- 23-26
+- 23-27
+- 23-28
+- 23-29
+- 23-30
+- 24-25
+- 24-26
+- 24-27
+- 24-28
+- 24-29
+- 24-30
+- 25-26
+- 25-27
+- 25-28
+- 25-29
+- 25-30
+- 26-27
+- 26-28
+- 26-29
+- 26-30
+- 27-28
+- 27-29
+- 27-30
+- 28-29
+- 28-30
+- 29-30
+shuffle_frac: 1.0
+shuffle_source:
+- E
+- I
+shuffle_target:
+- E
+- I
+sigma_ex: 0.12
+sigma_in: 0.1
+simtime: 61000
+stimulus: poisson_generator
+synapse_model: static_synapse
+syndist: lognormal
+tauMem: 20.0
+theta: 20.0

+ 540 - 0
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_5/config.yml

@@ -0,0 +1,540 @@
+CE: 80.0
+CI: 20.0
+J_ex: 0.1
+J_in: -0.4000000000000002
+N: 1000
+NE: 800
+NI: 200
+add_source: E
+add_source_frac:
+- 0.2
+- 12800
+add_target: E
+add_target_frac:
+- 0.05
+- 0.1
+- 0.2
+- 0.4
+- 0.6
+- 0.8
+- 1.0
+bin_num: 30000
+bin_size: 2
+chain_epsilon: 0.6
+chain_length: 3
+chain_pop: E
+chain_size:
+- 0.05
+- 0.1
+- 0.15
+- 0.2
+chain_strength:
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_epsilon:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_number: 3
+cluster_pop: E
+cluster_size:
+- 0.02
+- 0.04
+- 0.06
+- 0.08
+connectors:
+- 0
+- 30
+cut_inital_time: 1000
+delay:
+- 0.5
+- 3
+dt: 0.1
+epsilon: 0.1
+eta: 0.9
+ex_connection_rule: pairwise_bernoulli
+f: 0.8
+hub_epsilon: 0.5
+hub_pop: E
+hub_size:
+- 0.04
+- 0.06
+- 0.08
+- 0.1
+hub_strength:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+in_connection_rule: pairwise_bernoulli
+mu: 0.1
+neuron_model: iaf_psc_delta
+neuron_params:
+  C_m: 1.0
+  E_L: 0.0
+  V_m: 0.0
+  V_reset: 0.0
+  V_th: 20.0
+  t_ref: 2.0
+  tau_m: 20.0
+nu_ex: 0.1125
+nu_th: 0.125
+p_rate: 9000.0
+p_rate_func: !!python/name:config.%3Clambda%3E ''
+parrot_input: false
+seed: 5
+seed_pairs:
+- 1-2
+- 1-3
+- 1-4
+- 1-5
+- 1-6
+- 1-7
+- 1-8
+- 1-9
+- 1-10
+- 1-11
+- 1-12
+- 1-13
+- 1-14
+- 1-15
+- 1-16
+- 1-17
+- 1-18
+- 1-19
+- 1-20
+- 1-21
+- 1-22
+- 1-23
+- 1-24
+- 1-25
+- 1-26
+- 1-27
+- 1-28
+- 1-29
+- 1-30
+- 2-3
+- 2-4
+- 2-5
+- 2-6
+- 2-7
+- 2-8
+- 2-9
+- 2-10
+- 2-11
+- 2-12
+- 2-13
+- 2-14
+- 2-15
+- 2-16
+- 2-17
+- 2-18
+- 2-19
+- 2-20
+- 2-21
+- 2-22
+- 2-23
+- 2-24
+- 2-25
+- 2-26
+- 2-27
+- 2-28
+- 2-29
+- 2-30
+- 3-4
+- 3-5
+- 3-6
+- 3-7
+- 3-8
+- 3-9
+- 3-10
+- 3-11
+- 3-12
+- 3-13
+- 3-14
+- 3-15
+- 3-16
+- 3-17
+- 3-18
+- 3-19
+- 3-20
+- 3-21
+- 3-22
+- 3-23
+- 3-24
+- 3-25
+- 3-26
+- 3-27
+- 3-28
+- 3-29
+- 3-30
+- 4-5
+- 4-6
+- 4-7
+- 4-8
+- 4-9
+- 4-10
+- 4-11
+- 4-12
+- 4-13
+- 4-14
+- 4-15
+- 4-16
+- 4-17
+- 4-18
+- 4-19
+- 4-20
+- 4-21
+- 4-22
+- 4-23
+- 4-24
+- 4-25
+- 4-26
+- 4-27
+- 4-28
+- 4-29
+- 4-30
+- 5-6
+- 5-7
+- 5-8
+- 5-9
+- 5-10
+- 5-11
+- 5-12
+- 5-13
+- 5-14
+- 5-15
+- 5-16
+- 5-17
+- 5-18
+- 5-19
+- 5-20
+- 5-21
+- 5-22
+- 5-23
+- 5-24
+- 5-25
+- 5-26
+- 5-27
+- 5-28
+- 5-29
+- 5-30
+- 6-7
+- 6-8
+- 6-9
+- 6-10
+- 6-11
+- 6-12
+- 6-13
+- 6-14
+- 6-15
+- 6-16
+- 6-17
+- 6-18
+- 6-19
+- 6-20
+- 6-21
+- 6-22
+- 6-23
+- 6-24
+- 6-25
+- 6-26
+- 6-27
+- 6-28
+- 6-29
+- 6-30
+- 7-8
+- 7-9
+- 7-10
+- 7-11
+- 7-12
+- 7-13
+- 7-14
+- 7-15
+- 7-16
+- 7-17
+- 7-18
+- 7-19
+- 7-20
+- 7-21
+- 7-22
+- 7-23
+- 7-24
+- 7-25
+- 7-26
+- 7-27
+- 7-28
+- 7-29
+- 7-30
+- 8-9
+- 8-10
+- 8-11
+- 8-12
+- 8-13
+- 8-14
+- 8-15
+- 8-16
+- 8-17
+- 8-18
+- 8-19
+- 8-20
+- 8-21
+- 8-22
+- 8-23
+- 8-24
+- 8-25
+- 8-26
+- 8-27
+- 8-28
+- 8-29
+- 8-30
+- 9-10
+- 9-11
+- 9-12
+- 9-13
+- 9-14
+- 9-15
+- 9-16
+- 9-17
+- 9-18
+- 9-19
+- 9-20
+- 9-21
+- 9-22
+- 9-23
+- 9-24
+- 9-25
+- 9-26
+- 9-27
+- 9-28
+- 9-29
+- 9-30
+- 10-11
+- 10-12
+- 10-13
+- 10-14
+- 10-15
+- 10-16
+- 10-17
+- 10-18
+- 10-19
+- 10-20
+- 10-21
+- 10-22
+- 10-23
+- 10-24
+- 10-25
+- 10-26
+- 10-27
+- 10-28
+- 10-29
+- 10-30
+- 11-12
+- 11-13
+- 11-14
+- 11-15
+- 11-16
+- 11-17
+- 11-18
+- 11-19
+- 11-20
+- 11-21
+- 11-22
+- 11-23
+- 11-24
+- 11-25
+- 11-26
+- 11-27
+- 11-28
+- 11-29
+- 11-30
+- 12-13
+- 12-14
+- 12-15
+- 12-16
+- 12-17
+- 12-18
+- 12-19
+- 12-20
+- 12-21
+- 12-22
+- 12-23
+- 12-24
+- 12-25
+- 12-26
+- 12-27
+- 12-28
+- 12-29
+- 12-30
+- 13-14
+- 13-15
+- 13-16
+- 13-17
+- 13-18
+- 13-19
+- 13-20
+- 13-21
+- 13-22
+- 13-23
+- 13-24
+- 13-25
+- 13-26
+- 13-27
+- 13-28
+- 13-29
+- 13-30
+- 14-15
+- 14-16
+- 14-17
+- 14-18
+- 14-19
+- 14-20
+- 14-21
+- 14-22
+- 14-23
+- 14-24
+- 14-25
+- 14-26
+- 14-27
+- 14-28
+- 14-29
+- 14-30
+- 15-16
+- 15-17
+- 15-18
+- 15-19
+- 15-20
+- 15-21
+- 15-22
+- 15-23
+- 15-24
+- 15-25
+- 15-26
+- 15-27
+- 15-28
+- 15-29
+- 15-30
+- 16-17
+- 16-18
+- 16-19
+- 16-20
+- 16-21
+- 16-22
+- 16-23
+- 16-24
+- 16-25
+- 16-26
+- 16-27
+- 16-28
+- 16-29
+- 16-30
+- 17-18
+- 17-19
+- 17-20
+- 17-21
+- 17-22
+- 17-23
+- 17-24
+- 17-25
+- 17-26
+- 17-27
+- 17-28
+- 17-29
+- 17-30
+- 18-19
+- 18-20
+- 18-21
+- 18-22
+- 18-23
+- 18-24
+- 18-25
+- 18-26
+- 18-27
+- 18-28
+- 18-29
+- 18-30
+- 19-20
+- 19-21
+- 19-22
+- 19-23
+- 19-24
+- 19-25
+- 19-26
+- 19-27
+- 19-28
+- 19-29
+- 19-30
+- 20-21
+- 20-22
+- 20-23
+- 20-24
+- 20-25
+- 20-26
+- 20-27
+- 20-28
+- 20-29
+- 20-30
+- 21-22
+- 21-23
+- 21-24
+- 21-25
+- 21-26
+- 21-27
+- 21-28
+- 21-29
+- 21-30
+- 22-23
+- 22-24
+- 22-25
+- 22-26
+- 22-27
+- 22-28
+- 22-29
+- 22-30
+- 23-24
+- 23-25
+- 23-26
+- 23-27
+- 23-28
+- 23-29
+- 23-30
+- 24-25
+- 24-26
+- 24-27
+- 24-28
+- 24-29
+- 24-30
+- 25-26
+- 25-27
+- 25-28
+- 25-29
+- 25-30
+- 26-27
+- 26-28
+- 26-29
+- 26-30
+- 27-28
+- 27-29
+- 27-30
+- 28-29
+- 28-30
+- 29-30
+shuffle_frac: 1.0
+shuffle_source:
+- E
+- I
+shuffle_target:
+- E
+- I
+sigma_ex: 0.12
+sigma_in: 0.1
+simtime: 61000
+stimulus: poisson_generator
+synapse_model: static_synapse
+syndist: lognormal
+tauMem: 20.0
+theta: 20.0

+ 540 - 0
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_6/config.yml

@@ -0,0 +1,540 @@
+CE: 80.0
+CI: 20.0
+J_ex: 0.1
+J_in: -0.4000000000000002
+N: 1000
+NE: 800
+NI: 200
+add_source: E
+add_source_frac:
+- 0.2
+- 12800
+add_target: E
+add_target_frac:
+- 0.05
+- 0.1
+- 0.2
+- 0.4
+- 0.6
+- 0.8
+- 1.0
+bin_num: 30000
+bin_size: 2
+chain_epsilon: 0.6
+chain_length: 3
+chain_pop: E
+chain_size:
+- 0.05
+- 0.1
+- 0.15
+- 0.2
+chain_strength:
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_epsilon:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_number: 3
+cluster_pop: E
+cluster_size:
+- 0.02
+- 0.04
+- 0.06
+- 0.08
+connectors:
+- 0
+- 30
+cut_inital_time: 1000
+delay:
+- 0.5
+- 3
+dt: 0.1
+epsilon: 0.1
+eta: 0.9
+ex_connection_rule: pairwise_bernoulli
+f: 0.8
+hub_epsilon: 0.5
+hub_pop: E
+hub_size:
+- 0.04
+- 0.06
+- 0.08
+- 0.1
+hub_strength:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+in_connection_rule: pairwise_bernoulli
+mu: 0.1
+neuron_model: iaf_psc_delta
+neuron_params:
+  C_m: 1.0
+  E_L: 0.0
+  V_m: 0.0
+  V_reset: 0.0
+  V_th: 20.0
+  t_ref: 2.0
+  tau_m: 20.0
+nu_ex: 0.1125
+nu_th: 0.125
+p_rate: 9000.0
+p_rate_func: !!python/name:config.%3Clambda%3E ''
+parrot_input: false
+seed: 6
+seed_pairs:
+- 1-2
+- 1-3
+- 1-4
+- 1-5
+- 1-6
+- 1-7
+- 1-8
+- 1-9
+- 1-10
+- 1-11
+- 1-12
+- 1-13
+- 1-14
+- 1-15
+- 1-16
+- 1-17
+- 1-18
+- 1-19
+- 1-20
+- 1-21
+- 1-22
+- 1-23
+- 1-24
+- 1-25
+- 1-26
+- 1-27
+- 1-28
+- 1-29
+- 1-30
+- 2-3
+- 2-4
+- 2-5
+- 2-6
+- 2-7
+- 2-8
+- 2-9
+- 2-10
+- 2-11
+- 2-12
+- 2-13
+- 2-14
+- 2-15
+- 2-16
+- 2-17
+- 2-18
+- 2-19
+- 2-20
+- 2-21
+- 2-22
+- 2-23
+- 2-24
+- 2-25
+- 2-26
+- 2-27
+- 2-28
+- 2-29
+- 2-30
+- 3-4
+- 3-5
+- 3-6
+- 3-7
+- 3-8
+- 3-9
+- 3-10
+- 3-11
+- 3-12
+- 3-13
+- 3-14
+- 3-15
+- 3-16
+- 3-17
+- 3-18
+- 3-19
+- 3-20
+- 3-21
+- 3-22
+- 3-23
+- 3-24
+- 3-25
+- 3-26
+- 3-27
+- 3-28
+- 3-29
+- 3-30
+- 4-5
+- 4-6
+- 4-7
+- 4-8
+- 4-9
+- 4-10
+- 4-11
+- 4-12
+- 4-13
+- 4-14
+- 4-15
+- 4-16
+- 4-17
+- 4-18
+- 4-19
+- 4-20
+- 4-21
+- 4-22
+- 4-23
+- 4-24
+- 4-25
+- 4-26
+- 4-27
+- 4-28
+- 4-29
+- 4-30
+- 5-6
+- 5-7
+- 5-8
+- 5-9
+- 5-10
+- 5-11
+- 5-12
+- 5-13
+- 5-14
+- 5-15
+- 5-16
+- 5-17
+- 5-18
+- 5-19
+- 5-20
+- 5-21
+- 5-22
+- 5-23
+- 5-24
+- 5-25
+- 5-26
+- 5-27
+- 5-28
+- 5-29
+- 5-30
+- 6-7
+- 6-8
+- 6-9
+- 6-10
+- 6-11
+- 6-12
+- 6-13
+- 6-14
+- 6-15
+- 6-16
+- 6-17
+- 6-18
+- 6-19
+- 6-20
+- 6-21
+- 6-22
+- 6-23
+- 6-24
+- 6-25
+- 6-26
+- 6-27
+- 6-28
+- 6-29
+- 6-30
+- 7-8
+- 7-9
+- 7-10
+- 7-11
+- 7-12
+- 7-13
+- 7-14
+- 7-15
+- 7-16
+- 7-17
+- 7-18
+- 7-19
+- 7-20
+- 7-21
+- 7-22
+- 7-23
+- 7-24
+- 7-25
+- 7-26
+- 7-27
+- 7-28
+- 7-29
+- 7-30
+- 8-9
+- 8-10
+- 8-11
+- 8-12
+- 8-13
+- 8-14
+- 8-15
+- 8-16
+- 8-17
+- 8-18
+- 8-19
+- 8-20
+- 8-21
+- 8-22
+- 8-23
+- 8-24
+- 8-25
+- 8-26
+- 8-27
+- 8-28
+- 8-29
+- 8-30
+- 9-10
+- 9-11
+- 9-12
+- 9-13
+- 9-14
+- 9-15
+- 9-16
+- 9-17
+- 9-18
+- 9-19
+- 9-20
+- 9-21
+- 9-22
+- 9-23
+- 9-24
+- 9-25
+- 9-26
+- 9-27
+- 9-28
+- 9-29
+- 9-30
+- 10-11
+- 10-12
+- 10-13
+- 10-14
+- 10-15
+- 10-16
+- 10-17
+- 10-18
+- 10-19
+- 10-20
+- 10-21
+- 10-22
+- 10-23
+- 10-24
+- 10-25
+- 10-26
+- 10-27
+- 10-28
+- 10-29
+- 10-30
+- 11-12
+- 11-13
+- 11-14
+- 11-15
+- 11-16
+- 11-17
+- 11-18
+- 11-19
+- 11-20
+- 11-21
+- 11-22
+- 11-23
+- 11-24
+- 11-25
+- 11-26
+- 11-27
+- 11-28
+- 11-29
+- 11-30
+- 12-13
+- 12-14
+- 12-15
+- 12-16
+- 12-17
+- 12-18
+- 12-19
+- 12-20
+- 12-21
+- 12-22
+- 12-23
+- 12-24
+- 12-25
+- 12-26
+- 12-27
+- 12-28
+- 12-29
+- 12-30
+- 13-14
+- 13-15
+- 13-16
+- 13-17
+- 13-18
+- 13-19
+- 13-20
+- 13-21
+- 13-22
+- 13-23
+- 13-24
+- 13-25
+- 13-26
+- 13-27
+- 13-28
+- 13-29
+- 13-30
+- 14-15
+- 14-16
+- 14-17
+- 14-18
+- 14-19
+- 14-20
+- 14-21
+- 14-22
+- 14-23
+- 14-24
+- 14-25
+- 14-26
+- 14-27
+- 14-28
+- 14-29
+- 14-30
+- 15-16
+- 15-17
+- 15-18
+- 15-19
+- 15-20
+- 15-21
+- 15-22
+- 15-23
+- 15-24
+- 15-25
+- 15-26
+- 15-27
+- 15-28
+- 15-29
+- 15-30
+- 16-17
+- 16-18
+- 16-19
+- 16-20
+- 16-21
+- 16-22
+- 16-23
+- 16-24
+- 16-25
+- 16-26
+- 16-27
+- 16-28
+- 16-29
+- 16-30
+- 17-18
+- 17-19
+- 17-20
+- 17-21
+- 17-22
+- 17-23
+- 17-24
+- 17-25
+- 17-26
+- 17-27
+- 17-28
+- 17-29
+- 17-30
+- 18-19
+- 18-20
+- 18-21
+- 18-22
+- 18-23
+- 18-24
+- 18-25
+- 18-26
+- 18-27
+- 18-28
+- 18-29
+- 18-30
+- 19-20
+- 19-21
+- 19-22
+- 19-23
+- 19-24
+- 19-25
+- 19-26
+- 19-27
+- 19-28
+- 19-29
+- 19-30
+- 20-21
+- 20-22
+- 20-23
+- 20-24
+- 20-25
+- 20-26
+- 20-27
+- 20-28
+- 20-29
+- 20-30
+- 21-22
+- 21-23
+- 21-24
+- 21-25
+- 21-26
+- 21-27
+- 21-28
+- 21-29
+- 21-30
+- 22-23
+- 22-24
+- 22-25
+- 22-26
+- 22-27
+- 22-28
+- 22-29
+- 22-30
+- 23-24
+- 23-25
+- 23-26
+- 23-27
+- 23-28
+- 23-29
+- 23-30
+- 24-25
+- 24-26
+- 24-27
+- 24-28
+- 24-29
+- 24-30
+- 25-26
+- 25-27
+- 25-28
+- 25-29
+- 25-30
+- 26-27
+- 26-28
+- 26-29
+- 26-30
+- 27-28
+- 27-29
+- 27-30
+- 28-29
+- 28-30
+- 29-30
+shuffle_frac: 1.0
+shuffle_source:
+- E
+- I
+shuffle_target:
+- E
+- I
+sigma_ex: 0.12
+sigma_in: 0.1
+simtime: 61000
+stimulus: poisson_generator
+synapse_model: static_synapse
+syndist: lognormal
+tauMem: 20.0
+theta: 20.0

+ 540 - 0
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_7/config.yml

@@ -0,0 +1,540 @@
+CE: 80.0
+CI: 20.0
+J_ex: 0.1
+J_in: -0.4000000000000002
+N: 1000
+NE: 800
+NI: 200
+add_source: E
+add_source_frac:
+- 0.2
+- 12800
+add_target: E
+add_target_frac:
+- 0.05
+- 0.1
+- 0.2
+- 0.4
+- 0.6
+- 0.8
+- 1.0
+bin_num: 30000
+bin_size: 2
+chain_epsilon: 0.6
+chain_length: 3
+chain_pop: E
+chain_size:
+- 0.05
+- 0.1
+- 0.15
+- 0.2
+chain_strength:
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_epsilon:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_number: 3
+cluster_pop: E
+cluster_size:
+- 0.02
+- 0.04
+- 0.06
+- 0.08
+connectors:
+- 0
+- 30
+cut_inital_time: 1000
+delay:
+- 0.5
+- 3
+dt: 0.1
+epsilon: 0.1
+eta: 0.9
+ex_connection_rule: pairwise_bernoulli
+f: 0.8
+hub_epsilon: 0.5
+hub_pop: E
+hub_size:
+- 0.04
+- 0.06
+- 0.08
+- 0.1
+hub_strength:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+in_connection_rule: pairwise_bernoulli
+mu: 0.1
+neuron_model: iaf_psc_delta
+neuron_params:
+  C_m: 1.0
+  E_L: 0.0
+  V_m: 0.0
+  V_reset: 0.0
+  V_th: 20.0
+  t_ref: 2.0
+  tau_m: 20.0
+nu_ex: 0.1125
+nu_th: 0.125
+p_rate: 9000.0
+p_rate_func: !!python/name:config.%3Clambda%3E ''
+parrot_input: false
+seed: 7
+seed_pairs:
+- 1-2
+- 1-3
+- 1-4
+- 1-5
+- 1-6
+- 1-7
+- 1-8
+- 1-9
+- 1-10
+- 1-11
+- 1-12
+- 1-13
+- 1-14
+- 1-15
+- 1-16
+- 1-17
+- 1-18
+- 1-19
+- 1-20
+- 1-21
+- 1-22
+- 1-23
+- 1-24
+- 1-25
+- 1-26
+- 1-27
+- 1-28
+- 1-29
+- 1-30
+- 2-3
+- 2-4
+- 2-5
+- 2-6
+- 2-7
+- 2-8
+- 2-9
+- 2-10
+- 2-11
+- 2-12
+- 2-13
+- 2-14
+- 2-15
+- 2-16
+- 2-17
+- 2-18
+- 2-19
+- 2-20
+- 2-21
+- 2-22
+- 2-23
+- 2-24
+- 2-25
+- 2-26
+- 2-27
+- 2-28
+- 2-29
+- 2-30
+- 3-4
+- 3-5
+- 3-6
+- 3-7
+- 3-8
+- 3-9
+- 3-10
+- 3-11
+- 3-12
+- 3-13
+- 3-14
+- 3-15
+- 3-16
+- 3-17
+- 3-18
+- 3-19
+- 3-20
+- 3-21
+- 3-22
+- 3-23
+- 3-24
+- 3-25
+- 3-26
+- 3-27
+- 3-28
+- 3-29
+- 3-30
+- 4-5
+- 4-6
+- 4-7
+- 4-8
+- 4-9
+- 4-10
+- 4-11
+- 4-12
+- 4-13
+- 4-14
+- 4-15
+- 4-16
+- 4-17
+- 4-18
+- 4-19
+- 4-20
+- 4-21
+- 4-22
+- 4-23
+- 4-24
+- 4-25
+- 4-26
+- 4-27
+- 4-28
+- 4-29
+- 4-30
+- 5-6
+- 5-7
+- 5-8
+- 5-9
+- 5-10
+- 5-11
+- 5-12
+- 5-13
+- 5-14
+- 5-15
+- 5-16
+- 5-17
+- 5-18
+- 5-19
+- 5-20
+- 5-21
+- 5-22
+- 5-23
+- 5-24
+- 5-25
+- 5-26
+- 5-27
+- 5-28
+- 5-29
+- 5-30
+- 6-7
+- 6-8
+- 6-9
+- 6-10
+- 6-11
+- 6-12
+- 6-13
+- 6-14
+- 6-15
+- 6-16
+- 6-17
+- 6-18
+- 6-19
+- 6-20
+- 6-21
+- 6-22
+- 6-23
+- 6-24
+- 6-25
+- 6-26
+- 6-27
+- 6-28
+- 6-29
+- 6-30
+- 7-8
+- 7-9
+- 7-10
+- 7-11
+- 7-12
+- 7-13
+- 7-14
+- 7-15
+- 7-16
+- 7-17
+- 7-18
+- 7-19
+- 7-20
+- 7-21
+- 7-22
+- 7-23
+- 7-24
+- 7-25
+- 7-26
+- 7-27
+- 7-28
+- 7-29
+- 7-30
+- 8-9
+- 8-10
+- 8-11
+- 8-12
+- 8-13
+- 8-14
+- 8-15
+- 8-16
+- 8-17
+- 8-18
+- 8-19
+- 8-20
+- 8-21
+- 8-22
+- 8-23
+- 8-24
+- 8-25
+- 8-26
+- 8-27
+- 8-28
+- 8-29
+- 8-30
+- 9-10
+- 9-11
+- 9-12
+- 9-13
+- 9-14
+- 9-15
+- 9-16
+- 9-17
+- 9-18
+- 9-19
+- 9-20
+- 9-21
+- 9-22
+- 9-23
+- 9-24
+- 9-25
+- 9-26
+- 9-27
+- 9-28
+- 9-29
+- 9-30
+- 10-11
+- 10-12
+- 10-13
+- 10-14
+- 10-15
+- 10-16
+- 10-17
+- 10-18
+- 10-19
+- 10-20
+- 10-21
+- 10-22
+- 10-23
+- 10-24
+- 10-25
+- 10-26
+- 10-27
+- 10-28
+- 10-29
+- 10-30
+- 11-12
+- 11-13
+- 11-14
+- 11-15
+- 11-16
+- 11-17
+- 11-18
+- 11-19
+- 11-20
+- 11-21
+- 11-22
+- 11-23
+- 11-24
+- 11-25
+- 11-26
+- 11-27
+- 11-28
+- 11-29
+- 11-30
+- 12-13
+- 12-14
+- 12-15
+- 12-16
+- 12-17
+- 12-18
+- 12-19
+- 12-20
+- 12-21
+- 12-22
+- 12-23
+- 12-24
+- 12-25
+- 12-26
+- 12-27
+- 12-28
+- 12-29
+- 12-30
+- 13-14
+- 13-15
+- 13-16
+- 13-17
+- 13-18
+- 13-19
+- 13-20
+- 13-21
+- 13-22
+- 13-23
+- 13-24
+- 13-25
+- 13-26
+- 13-27
+- 13-28
+- 13-29
+- 13-30
+- 14-15
+- 14-16
+- 14-17
+- 14-18
+- 14-19
+- 14-20
+- 14-21
+- 14-22
+- 14-23
+- 14-24
+- 14-25
+- 14-26
+- 14-27
+- 14-28
+- 14-29
+- 14-30
+- 15-16
+- 15-17
+- 15-18
+- 15-19
+- 15-20
+- 15-21
+- 15-22
+- 15-23
+- 15-24
+- 15-25
+- 15-26
+- 15-27
+- 15-28
+- 15-29
+- 15-30
+- 16-17
+- 16-18
+- 16-19
+- 16-20
+- 16-21
+- 16-22
+- 16-23
+- 16-24
+- 16-25
+- 16-26
+- 16-27
+- 16-28
+- 16-29
+- 16-30
+- 17-18
+- 17-19
+- 17-20
+- 17-21
+- 17-22
+- 17-23
+- 17-24
+- 17-25
+- 17-26
+- 17-27
+- 17-28
+- 17-29
+- 17-30
+- 18-19
+- 18-20
+- 18-21
+- 18-22
+- 18-23
+- 18-24
+- 18-25
+- 18-26
+- 18-27
+- 18-28
+- 18-29
+- 18-30
+- 19-20
+- 19-21
+- 19-22
+- 19-23
+- 19-24
+- 19-25
+- 19-26
+- 19-27
+- 19-28
+- 19-29
+- 19-30
+- 20-21
+- 20-22
+- 20-23
+- 20-24
+- 20-25
+- 20-26
+- 20-27
+- 20-28
+- 20-29
+- 20-30
+- 21-22
+- 21-23
+- 21-24
+- 21-25
+- 21-26
+- 21-27
+- 21-28
+- 21-29
+- 21-30
+- 22-23
+- 22-24
+- 22-25
+- 22-26
+- 22-27
+- 22-28
+- 22-29
+- 22-30
+- 23-24
+- 23-25
+- 23-26
+- 23-27
+- 23-28
+- 23-29
+- 23-30
+- 24-25
+- 24-26
+- 24-27
+- 24-28
+- 24-29
+- 24-30
+- 25-26
+- 25-27
+- 25-28
+- 25-29
+- 25-30
+- 26-27
+- 26-28
+- 26-29
+- 26-30
+- 27-28
+- 27-29
+- 27-30
+- 28-29
+- 28-30
+- 29-30
+shuffle_frac: 1.0
+shuffle_source:
+- E
+- I
+shuffle_target:
+- E
+- I
+sigma_ex: 0.12
+sigma_in: 0.1
+simtime: 61000
+stimulus: poisson_generator
+synapse_model: static_synapse
+syndist: lognormal
+tauMem: 20.0
+theta: 20.0

+ 540 - 0
brunel_network/simulation_output/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal/seed_8/config.yml

@@ -0,0 +1,540 @@
+CE: 80.0
+CI: 20.0
+J_ex: 0.1
+J_in: -0.4000000000000002
+N: 1000
+NE: 800
+NI: 200
+add_source: E
+add_source_frac:
+- 0.2
+- 12800
+add_target: E
+add_target_frac:
+- 0.05
+- 0.1
+- 0.2
+- 0.4
+- 0.6
+- 0.8
+- 1.0
+bin_num: 30000
+bin_size: 2
+chain_epsilon: 0.6
+chain_length: 3
+chain_pop: E
+chain_size:
+- 0.05
+- 0.1
+- 0.15
+- 0.2
+chain_strength:
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_epsilon:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+- 0.6
+cluster_number: 3
+cluster_pop: E
+cluster_size:
+- 0.02
+- 0.04
+- 0.06
+- 0.08
+connectors:
+- 0
+- 30
+cut_inital_time: 1000
+delay:
+- 0.5
+- 3
+dt: 0.1
+epsilon: 0.1
+eta: 0.9
+ex_connection_rule: pairwise_bernoulli
+f: 0.8
+hub_epsilon: 0.5
+hub_pop: E
+hub_size:
+- 0.04
+- 0.06
+- 0.08
+- 0.1
+hub_strength:
+- 0.2
+- 0.3
+- 0.4
+- 0.5
+in_connection_rule: pairwise_bernoulli
+mu: 0.1
+neuron_model: iaf_psc_delta
+neuron_params:
+  C_m: 1.0
+  E_L: 0.0
+  V_m: 0.0
+  V_reset: 0.0
+  V_th: 20.0
+  t_ref: 2.0
+  tau_m: 20.0
+nu_ex: 0.1125
+nu_th: 0.125
+p_rate: 9000.0
+p_rate_func: !!python/name:config.%3Clambda%3E ''
+parrot_input: false
+seed: 8
+seed_pairs:
+- 1-2
+- 1-3
+- 1-4
+- 1-5
+- 1-6
+- 1-7
+- 1-8
+- 1-9
+- 1-10
+- 1-11
+- 1-12
+- 1-13
+- 1-14
+- 1-15
+- 1-16
+- 1-17
+- 1-18
+- 1-19
+- 1-20
+- 1-21
+- 1-22
+- 1-23
+- 1-24
+- 1-25
+- 1-26
+- 1-27
+- 1-28
+- 1-29
+- 1-30
+- 2-3
+- 2-4
+- 2-5
+- 2-6
+- 2-7
+- 2-8
+- 2-9
+- 2-10
+- 2-11
+- 2-12
+- 2-13
+- 2-14
+- 2-15
+- 2-16
+- 2-17
+- 2-18
+- 2-19
+- 2-20
+- 2-21
+- 2-22
+- 2-23
+- 2-24
+- 2-25
+- 2-26
+- 2-27
+- 2-28
+- 2-29
+- 2-30
+- 3-4
+- 3-5
+- 3-6
+- 3-7
+- 3-8
+- 3-9
+- 3-10
+- 3-11
+- 3-12
+- 3-13
+- 3-14
+- 3-15
+- 3-16
+- 3-17
+- 3-18
+- 3-19
+- 3-20
+- 3-21
+- 3-22
+- 3-23
+- 3-24
+- 3-25
+- 3-26
+- 3-27
+- 3-28
+- 3-29
+- 3-30
+- 4-5
+- 4-6
+- 4-7
+- 4-8
+- 4-9
+- 4-10
+- 4-11
+- 4-12
+- 4-13
+- 4-14
+- 4-15
+- 4-16
+- 4-17
+- 4-18
+- 4-19
+- 4-20
+- 4-21
+- 4-22
+- 4-23
+- 4-24
+- 4-25
+- 4-26
+- 4-27
+- 4-28
+- 4-29
+- 4-30
+- 5-6
+- 5-7
+- 5-8
+- 5-9
+- 5-10
+- 5-11
+- 5-12
+- 5-13
+- 5-14
+- 5-15
+- 5-16
+- 5-17
+- 5-18
+- 5-19
+- 5-20
+- 5-21
+- 5-22
+- 5-23
+- 5-24
+- 5-25
+- 5-26
+- 5-27
+- 5-28
+- 5-29
+- 5-30
+- 6-7
+- 6-8
+- 6-9
+- 6-10
+- 6-11
+- 6-12
+- 6-13
+- 6-14
+- 6-15
+- 6-16
+- 6-17
+- 6-18
+- 6-19
+- 6-20
+- 6-21
+- 6-22
+- 6-23
+- 6-24
+- 6-25
+- 6-26
+- 6-27
+- 6-28
+- 6-29
+- 6-30
+- 7-8
+- 7-9
+- 7-10
+- 7-11
+- 7-12
+- 7-13
+- 7-14
+- 7-15
+- 7-16
+- 7-17
+- 7-18
+- 7-19
+- 7-20
+- 7-21
+- 7-22
+- 7-23
+- 7-24
+- 7-25
+- 7-26
+- 7-27
+- 7-28
+- 7-29
+- 7-30
+- 8-9
+- 8-10
+- 8-11
+- 8-12
+- 8-13
+- 8-14
+- 8-15
+- 8-16
+- 8-17
+- 8-18
+- 8-19
+- 8-20
+- 8-21
+- 8-22
+- 8-23
+- 8-24
+- 8-25
+- 8-26
+- 8-27
+- 8-28
+- 8-29
+- 8-30
+- 9-10
+- 9-11
+- 9-12
+- 9-13
+- 9-14
+- 9-15
+- 9-16
+- 9-17
+- 9-18
+- 9-19
+- 9-20
+- 9-21
+- 9-22
+- 9-23
+- 9-24
+- 9-25
+- 9-26
+- 9-27
+- 9-28
+- 9-29
+- 9-30
+- 10-11
+- 10-12
+- 10-13
+- 10-14
+- 10-15
+- 10-16
+- 10-17
+- 10-18
+- 10-19
+- 10-20
+- 10-21
+- 10-22
+- 10-23
+- 10-24
+- 10-25
+- 10-26
+- 10-27
+- 10-28
+- 10-29
+- 10-30
+- 11-12
+- 11-13
+- 11-14
+- 11-15
+- 11-16
+- 11-17
+- 11-18
+- 11-19
+- 11-20
+- 11-21
+- 11-22
+- 11-23
+- 11-24
+- 11-25
+- 11-26
+- 11-27
+- 11-28
+- 11-29
+- 11-30
+- 12-13
+- 12-14
+- 12-15
+- 12-16
+- 12-17
+- 12-18
+- 12-19
+- 12-20
+- 12-21
+- 12-22
+- 12-23
+- 12-24
+- 12-25
+- 12-26
+- 12-27
+- 12-28
+- 12-29
+- 12-30
+- 13-14
+- 13-15
+- 13-16
+- 13-17
+- 13-18
+- 13-19
+- 13-20
+- 13-21
+- 13-22
+- 13-23
+- 13-24
+- 13-25
+- 13-26
+- 13-27
+- 13-28
+- 13-29
+- 13-30
+- 14-15
+- 14-16
+- 14-17
+- 14-18
+- 14-19
+- 14-20
+- 14-21
+- 14-22
+- 14-23
+- 14-24
+- 14-25
+- 14-26
+- 14-27
+- 14-28
+- 14-29
+- 14-30
+- 15-16
+- 15-17
+- 15-18
+- 15-19
+- 15-20
+- 15-21
+- 15-22
+- 15-23
+- 15-24
+- 15-25
+- 15-26
+- 15-27
+- 15-28
+- 15-29
+- 15-30
+- 16-17
+- 16-18
+- 16-19
+- 16-20
+- 16-21
+- 16-22
+- 16-23
+- 16-24
+- 16-25
+- 16-26
+- 16-27
+- 16-28
+- 16-29
+- 16-30
+- 17-18
+- 17-19
+- 17-20
+- 17-21
+- 17-22
+- 17-23
+- 17-24
+- 17-25
+- 17-26
+- 17-27
+- 17-28
+- 17-29
+- 17-30
+- 18-19
+- 18-20
+- 18-21
+- 18-22
+- 18-23
+- 18-24
+- 18-25
+- 18-26
+- 18-27
+- 18-28
+- 18-29
+- 18-30
+- 19-20
+- 19-21
+- 19-22
+- 19-23
+- 19-24
+- 19-25
+- 19-26
+- 19-27
+- 19-28
+- 19-29
+- 19-30
+- 20-21
+- 20-22
+- 20-23
+- 20-24
+- 20-25
+- 20-26
+- 20-27
+- 20-28
+- 20-29
+- 20-30
+- 21-22
+- 21-23
+- 21-24
+- 21-25
+- 21-26
+- 21-27
+- 21-28
+- 21-29
+- 21-30
+- 22-23
+- 22-24
+- 22-25
+- 22-26
+- 22-27
+- 22-28
+- 22-29
+- 22-30
+- 23-24
+- 23-25
+- 23-26
+- 23-27
+- 23-28
+- 23-29
+- 23-30
+- 24-25
+- 24-26
+- 24-27
+- 24-28
+- 24-29
+- 24-30
+- 25-26
+- 25-27
+- 25-28
+- 25-29
+- 25-30
+- 26-27
+- 26-28
+- 26-29
+- 26-30
+- 27-28
+- 27-29
+- 27-30
+- 28-29
+- 28-30
+- 29-30
+shuffle_frac: 1.0
+shuffle_source:
+- E
+- I
+shuffle_target:
+- E
+- I
+sigma_ex: 0.12
+sigma_in: 0.1
+simtime: 61000
+stimulus: poisson_generator
+synapse_model: static_synapse
+syndist: lognormal
+tauMem: 20.0
+theta: 20.0

+ 657 - 0
eigenangles.bib

@@ -0,0 +1,657 @@
+
+@article{Ahmadian2015_012820,
+  title = {Properties of Networks with Partially Structured and Partially Random Connectivity},
+  author = {Ahmadian, Yashar and Fumarola, Francesco and Miller, Kenneth D.},
+  year = {2015},
+  month = jan,
+  journal = {Physical Review E},
+  volume = {91},
+  number = {1},
+  pages = {012820},
+  doi = {10.1103/PhysRevE.91.012820},
+
+}
+
+@article{Albert2002_47,
+  title = {Statistical Mechanics of Complex Networks},
+  author = {Albert, R{\'e}ka Reka R{\'e}ka and Barab{\'a}si, Albert-L{\'a}szl{\'o} and Barabasi, Albert-Laszlo and Barab{\'a}si, Albert-L{\'a}szl{\'o}},
+  year = {2002},
+  month = jan,
+  journal = {Reviews of Modern Physics},
+  volume = {74},
+  number = {1},
+  pages = {47},
+  issn = {0034-6861, 1539-0756},
+  doi = {10.1103/RevModPhys.74.47},
+  pmid = {16204838},
+  
+}
+
+@article{Aljadeff2015_088101,
+  title = {Transition to {{Chaos}} in {{Random Networks}} with {{Cell-Type-Specific Connectivity}}},
+  author = {Aljadeff, Johnatan and Stern, Merav and Sharpee, Tatyana},
+  year = {2015},
+  month = feb,
+  journal = {Physical Review Letters},
+  volume = {114},
+  number = {8},
+  pages = {088101},
+  doi = {10.1103/PhysRevLett.114.088101},
+
+}
+
+@article{Anderson2017_,
+  title = {The {{High-Dimensional Geometry}} of {{Binary Neural Networks}}},
+  author = {Anderson, Alexander G. and Berg, Cory P.},
+  year = {2017},
+  month = may,
+  journal = {arXiv:1705.07199 [cs]},
+  eprint = {1705.07199},
+  eprinttype = {arxiv},
+  primaryclass = {cs},
+  archiveprefix = {arXiv},
+  keywords = {Computer Science - Machine Learning},
+  note = {Comment: 12 pages, 4 Figures},
+
+}
+
+@article{Aviel2003_1321,
+  title = {On {{Embedding Synfire Chains}} in a {{Balanced Network}}},
+  author = {Aviel, Y. and Mehring, C. and Abeles, M. and Horn, D.},
+  year = {2003},
+  month = jun,
+  journal = {Neural Computation},
+  volume = {15},
+  number = {6},
+  pages = {1321--1340},
+  issn = {0899-7667},
+  doi = {10.1162/089976603321780290},
+
+}
+
+@article{Bullmore2009_186,
+  title = {Complex Brain Networks: Graph Theoretical Analysis of Structural and Functional Systems},
+  shorttitle = {Complex Brain Networks},
+  author = {Bullmore, Ed and Sporns, Olaf},
+  year = {2009},
+  month = mar,
+  journal = {Nature Reviews Neuroscience},
+  volume = {10},
+  number = {3},
+  pages = {186--198},
+  issn = {1471-003X, 1471-0048},
+  doi = {10.1038/nrn2575},
+  langid = {english},
+
+}
+
+@article{Cai2013_1837,
+  ids = {Cai2013_1837a},
+  title = {Distributions of Angles in Random Packing on Spheres.},
+  author = {Cai, T Tony and Fan, Jianqing and Jiang, Tiefeng},
+  year = {2013},
+  journal = {Journal of Machine Learning Research},
+  volume = {14},
+  number = {1},
+  pages = {1837--1864},
+  issn = {1532-4435},
+  pmcid = {PMC4196685},
+  pmid = {25324693},
+  keywords = {empirical law,extreme-value distribution,maximum of random variables,minimum of random variables,packing on sphere,random angle,uniform distribution on sphere},
+
+}
+
+@article{Calsbeek2009_2627,
+  title = {Empirical {{Comparison}} of {{G Matrix Test Statistics}}: {{Finding Biologically Relevant Change}}},
+  shorttitle = {Empirical {{Comparison}} of {{G Matrix Test Statistics}}},
+  author = {Calsbeek, Brittny and Goodnight, Charles J.},
+  year = {2009},
+  journal = {Evolution},
+  volume = {63},
+  number = {10},
+  pages = {2627--2635},
+  issn = {1558-5646},
+  doi = {10.1111/j.1558-5646.2009.00735.x},
+  langid = {english},
+  keywords = {Breeder's equation,G matrix evolution,matrix comparison,selection skewers},
+  annotation = {\_eprint: https://onlinelibrary.wiley.com/doi/pdf/10.1111/j.1558-5646.2009.00735.x},
+
+}
+
+@article{Curto2019_11,
+  title = {Relating Network Connectivity to Dynamics: Opportunities and Challenges for Theoretical Neuroscience},
+  shorttitle = {Relating Network Connectivity to Dynamics},
+  author = {Curto, Carina and Morrison, Katherine},
+  year = {2019},
+  month = oct,
+  journal = {Current Opinion in Neurobiology},
+  series = {Computational {{Neuroscience}}},
+  volume = {58},
+  pages = {11--20},
+  issn = {0959-4388},
+  doi = {10.1016/j.conb.2019.06.003},
+  langid = {english},
+
+}
+
+@article{Dahmen2019_13051,
+  title = {Second Type of Criticality in the Brain Uncovers Rich Multiple-Neuron Dynamics},
+  author = {Dahmen, David and Gr{\"u}n, Sonja and Diesmann, Markus and Helias, Moritz},
+  year = {2019},
+  month = jun,
+  journal = {Proceedings of the National Academy of Sciences},
+  volume = {116},
+  number = {26},
+  pages = {13051--13060},
+  publisher = {{National Academy of Sciences}},
+  issn = {0027-8424, 1091-6490},
+  doi = {10.1073/pnas.1818972116},
+  chapter = {PNAS Plus},
+  copyright = {Copyright \textcopyright{} 2019 the Author(s). Published by PNAS.. https://creativecommons.org/licenses/by/4.0/This open access article is distributed under Creative Commons Attribution License 4.0 (CC BY).},
+  langid = {english},
+  pmid = {31189590},
+  keywords = {balanced state,correlated neural activity,cortical dynamics,criticality},
+
+}
+
+@article{Dahmen2022_e68422,
+  title = {Global Organization of Neuronal Activity Only Requires Unstructured Local Connectivity},
+  author = {Dahmen, David and Layer, Moritz and Deutz, Lukas and D{\k{a}}browska, Paulina Anna and Voges, Nicole and {von Papen}, Michael and Brochier, Thomas and Riehle, Alexa and Diesmann, Markus and Gr{\"u}n, Sonja and Helias, Moritz},
+  editor = {Palmer, Stephanie E and Behrens, Timothy E},
+  year = {2022},
+  month = jan,
+  journal = {eLife},
+  volume = {11},
+  pages = {e68422},
+  publisher = {{eLife Sciences Publications, Ltd}},
+  issn = {2050-084X},
+  doi = {10.7554/eLife.68422},
+  keywords = {balanced state,beyond-mean-field theory,correlated activity,long-range coordination,motor cortex,reach-to-grasp task},
+
+}
+
+@book{Flury1988_,
+  title = {Common Principal Components \& Related Multivariate Models},
+  author = {Flury, Bernhard},
+  year = {1988},
+  publisher = {{John Wiley \& Sons, Inc}},
+  address = {{New York}},
+  isbn = {MINN:31951000451116V},
+  langid = {english}
+}
+
+@article{Girko1985_694,
+  title = {Circular {{Law}}},
+  author = {Girko, V. L.},
+  year = {1985},
+  month = jan,
+  journal = {Theory of Probability \& Its Applications},
+  volume = {29},
+  number = {4},
+  pages = {694--706},
+  publisher = {{Society for Industrial and Applied Mathematics}},
+  issn = {0040-585X},
+  doi = {10.1137/1129095}
+}
+
+@article{Guhr1998_189,
+  title = {Random-Matrix Theories in Quantum Physics: Common Concepts},
+  shorttitle = {Random-Matrix Theories in Quantum Physics},
+  author = {Guhr, Thomas and {M{\"u}ller{\textendash}Groeling}, Axel and Weidenm{\"u}ller, Hans A.},
+  year = {1998},
+  month = jun,
+  journal = {Physics Reports},
+  volume = {299},
+  number = {4},
+  pages = {189--425},
+  issn = {0370-1573},
+  doi = {10.1016/S0370-1573(97)00088-4},
+  langid = {english},
+  keywords = {Chaos,Disordered solids,Random matrix theory,Statistical many-body theory},
+
+}
+
+@article{Gutzen2018_90,
+  title = {Reproducible {{Neural Network Simulations}}: {{Statistical Methods}} for {{Model Validation}} on the {{Level}} of {{Network Activity Data}}},
+  shorttitle = {Reproducible {{Neural Network Simulations}}},
+  author = {Gutzen, Robin and {von Papen}, Michael and Trensch, Guido and Quaglio, Pietro and Gr{\"u}n, Sonja and Denker, Michael},
+  year = {2018},
+  journal = {Frontiers in Neuroinformatics},
+  volume = {12},
+  pages = {90},
+  issn = {1662-5196},
+  doi = {10.3389/fninf.2018.00090},
+  langid = {english},
+  keywords = {reproducibility,simulation,Spiking Neural network,SpiNNaker,statistical analysis,Validation},
+
+}
+
+@article{Haber2020_2020.04.27.057752,
+  title = {Learning the Architectural Features That Predict Functional Similarity of Neural Networks},
+  author = {Haber, Adam and Schneidman, Elad},
+  year = {2020},
+  month = apr,
+  journal = {bioRxiv},
+  pages = {2020.04.27.057752},
+  doi = {10.1101/2020.04.27.057752},
+  copyright = {\textcopyright{} 2020, Posted by Cold Spring Harbor Laboratory. The copyright holder for this pre-print is the author. All rights reserved. The material may not be redistributed, re-used or adapted without the author's permission.},
+  langid = {english},
+
+}
+
+@article{Harris2005_399,
+  ids = {Harris2005_399a},
+  title = {Neural Signatures of Cell Assembly Organization},
+  author = {Harris, Kenneth D},
+  year = {2005},
+  journal = {Nature Reviews Neuroscience},
+  volume = {6},
+  number = {5},
+  pages = {399--407},
+  publisher = {{Nature Publishing Group}},
+  issn = {1471-003X},
+  doi = {10.1038/nrn1669},
+  pmid = {15861182},
+  keywords = {Animal Genetics and Genomics,Behavioral Sciences,Biological Techniques,Biomedicine,general,Neurobiology,Neurosciences},
+
+}
+
+@article{Hodges1958_469,
+  title = {The Significance Probability of the Smirnov Two-Sample Test},
+  author = {Hodges, J. L.},
+  year = {1958},
+  month = jan,
+  journal = {Arkiv f\"or Matematik},
+  volume = {3},
+  number = {5},
+  pages = {469--486},
+  issn = {0004-2080},
+  doi = {10.1007/BF02589501},
+  langid = {english},
+
+}
+
+@article{Holmes1991_239,
+  title = {On Random Correlation Matrices},
+  author = {Holmes, Richard B},
+  year = {1991},
+  journal = {SIAM journal on matrix analysis and applications},
+  volume = {12},
+  number = {2},
+  pages = {239--272},
+  issn = {08954798},
+  doi = {10.1137/0612019},
+
+}
+
+@article{Izhikevich2006_245,
+  title = {Polychronization: {{Computation}} with {{Spikes}}},
+  author = {Izhikevich, Eugene M.},
+  year = {2006},
+  month = feb,
+  journal = {Neural Computation},
+  volume = {18},
+  number = {2},
+  pages = {245--282},
+  issn = {0899-7667},
+  doi = {10.1162/089976606775093882},
+  pmid = {16378515},
+
+}
+
+@article{Koltchinskii2000_113,
+  title = {Random {{Matrix Approximation}} of {{Spectra}} of {{Integral Operators}}},
+  author = {Koltchinskii, Vladimir and Gin{\'e}, Evarist},
+  year = {2000},
+  journal = {Bernoulli},
+  volume = {6},
+  number = {1},
+  pages = {113--167},
+  publisher = {{International Statistical Institute (ISI) and Bernoulli Society for Mathematical Statistics and Probability}},
+  issn = {1350-7265},
+  doi = {10.2307/3318636},
+  abstract = {Let \$H\textbackslash colon L\_\{2\}(S,\textbackslash scr\{I\},P)\textbackslash mapsto L\_\{2\}(S,\textbackslash scr\{I\},P)\$ be a compact integral operator with a symmetric kernel h. Let Xi, i{$\in$} N, be independent S-valued random variables with common probability law P. Consider the n \texttimes{} n matrix {\~H}n with entries n-1h(Xi,Xj), 1 {$\leq$} i, j {$\leq$} n (this is the matrix of an empirical version of the operator H with P replaced by the empirical measure Pn), and let Hn denote the modification of {\~H}n, obtained by deleting its diagonal. It is proved that the l2 distance between the ordered spectrum of Hn and the ordered spectrum of H tends to zero a.s. if and only if H is Hilbert-Schmidt. Rates of convergence and distributional limit theorems for the difference between the ordered spectra of the operators Hn (or {\~H}n) and H are also obtained under somewhat stronger conditions. These results apply in particular to the kernels of certain functions H = {$\varphi$}(L) of partial differential operators L (heat kernels, Green functions).},
+
+}
+
+@article{Krzanowski1979_703a,
+  title = {Between-{{Groups Comparison}} of {{Principal Components}}},
+  author = {Krzanowski, W. J.},
+  year = {1979},
+  month = sep,
+  journal = {Journal of the American Statistical Association},
+  volume = {74},
+  number = {367},
+  pages = {703--707},
+  publisher = {{Taylor \& Francis}},
+  issn = {0162-1459},
+  doi = {10.1080/01621459.1979.10481674},
+  abstract = {A method is given for comparing principal component analyses conducted on the same variables in two different groups of individuals, and an extension to the case of more than two groups is outlined. The technique leads to a latent root and vector problem, which has also arisen in the comparison of factor patterns in separate factor analyses. Emphasis in the present article is on the underlying geometry and interpretation of the results. An illustrative example is provided.},
+  keywords = {Analytical rotation,Congruence coefficient,Latent roots and vectors,Principal component analysis},
+  annotation = {\_eprint: https://www.tandfonline.com/doi/pdf/10.1080/01621459.1979.10481674},
+
+}
+
+@article{Krzanowski1990_81,
+  title = {Between-Group Analysis with Heterogeneous Covariance Matrices: {{The}} Common Principal Component Model},
+  shorttitle = {Between-Group Analysis with Heterogeneous Covariance Matrices},
+  author = {Krzanowski, W. J.},
+  year = {1990},
+  month = mar,
+  journal = {Journal of Classification},
+  volume = {7},
+  number = {1},
+  pages = {81--98},
+  issn = {1432-1343},
+  doi = {10.1007/BF01889705},
+  langid = {english},
+  keywords = {Between-group analysis,Canonical variate analysis,Common principal component model,Eigenvalues and eigenvectors,Matusita distance between populations,Metric scaling,Principal component analysis}
+}
+
+@article{Kuczala2016_050101,
+  title = {Eigenvalue Spectra of Large Correlated Random Matrices},
+  author = {Kuczala, Alexander and Sharpee, Tatyana O.},
+  year = {2016},
+  month = nov,
+  journal = {Physical Review E},
+  volume = {94},
+  number = {5},
+  pages = {050101},
+  doi = {10.1103/PhysRevE.94.050101},
+
+}
+
+@article{Litwin-Kumar2012_1498,
+  title = {Slow Dynamics and High Variability in Balanced Cortical Networks with Clustered Connections},
+  author = {{Litwin-Kumar}, Ashok and Doiron, Brent},
+  year = {2012},
+  month = nov,
+  journal = {Nature neuroscience},
+  volume = {15},
+  number = {11},
+  pages = {1498--1505},
+  issn = {1097-6256},
+  doi = {10.1038/nn.3220},
+  pmcid = {PMC4106684},
+  pmid = {23001062},
+
+}
+
+@article{Marcenko1967_457,
+  title = {Distribution of {{Eigenvalues}} for Some Sets of Random Matrices},
+  author = {Mar{\v c}enko, V A and Pastur, L A},
+  year = {1967},
+  month = apr,
+  journal = {Mathematics of the USSR-Sbornik},
+  volume = {1},
+  number = {4},
+  pages = {457--483},
+  issn = {0025-5734},
+  doi = {10.1070/SM1967v001n04ABEH001994},
+  langid = {english},
+
+}
+
+@article{Mongillo2018_1463,
+  title = {Inhibitory Connectivity Defines the Realm of Excitatory Plasticity},
+  author = {Mongillo, Gianluigi and Rumpel, Simon and Loewenstein, Yonatan},
+  year = {2018},
+  month = oct,
+  journal = {Nature Neuroscience},
+  volume = {21},
+  number = {10},
+  pages = {1463},
+  issn = {1546-1726},
+  doi = {10.1038/s41593-018-0226-x},
+  copyright = {2018 The Author(s), under exclusive licence to Springer Nature America, Inc.},
+  langid = {english},
+
+}
+
+@article{Nakagawa2007_591a,
+  title = {Effect Size, Confidence Interval and Statistical Significance: A Practical Guide for Biologists},
+  shorttitle = {Effect Size, Confidence Interval and Statistical Significance},
+  author = {Nakagawa, Shinichi and Cuthill, Innes C.},
+  year = {2007},
+  journal = {Biological Reviews},
+  volume = {82},
+  number = {4},
+  pages = {591--605},
+  issn = {1469-185X},
+  doi = {10.1111/j.1469-185X.2007.00027.x},
+  langid = {english},
+  keywords = {Bonferroni correction,confidence interval,effect size,effect statistic,meta-analysis,null hypothesis significance testing,p value,power analysis,statistical significance},
+  annotation = {\_eprint: https://onlinelibrary.wiley.com/doi/pdf/10.1111/j.1469-185X.2007.00027.x},
+
+}
+
+@misc{Nest3.1,
+  title = {{{NEST}} 3.1},
+  author = {Deepu, Rajalekshmi and Spreizer, Sebastian and Trensch, Guido and Terhorst, Dennis and Vennemo, Stine Brekke and Mitchell, Jessica and Linssen, Charl and M{\o}rk, H{\aa}kon and Morrison, Abigail and Eppler, Jochen Martin and Kamiji, Nilton Liuji and {de Schepper}, Robin and Kitayama, Itaru and Kurth, Anno and {Morales-Gregorio}, Aitor and Nagendra Babu, Pooja and Plesser, Hans Ekkehard},
+  year = {2021},
+  month = sep,
+  doi = {10.5281/zenodo.5508805},
+  howpublished = {Zenodo},
+
+}
+
+@misc{Nest3.2,
+  title = {{{NEST}} 3.2},
+  author = {{de Schepper}, Robin and Eppler, Jochen Martin and Kurth, Anno and Nagendra Babu, Pooja and Deepu, Rajalekshmi and Spreizer, Sebastian and Trensch, Guido and Pronold, Jari and Vennemo, Stine Brekke and Graber, Steffen and {Morales-Gregorio}, Aitor and Linssen, Charl and Benelhedi, Mohamed Ayssar and M{\o}rk, H{\aa}kon and Morrison, Abigail and Terhorst, Dennis and Mitchell, Jessica and Diaz, Sandra and Kitayama, Itaru and Enan, Mahdi and Kamiji, Nilton Liuji and Plesser, Hans Ekkehard},
+  year = {2022},
+  month = jan,
+  doi = {10.5281/zenodo.5886894},
+  howpublished = {Zenodo},
+
+}
+
+@article{Newman2003_167,
+  title = {The {{Structure}} and {{Function}} of {{Complex Networks}}},
+  author = {Newman, M. E. J.},
+  year = {2003},
+  month = jan,
+  journal = {SIAM Review},
+  volume = {45},
+  number = {2},
+  pages = {167--256},
+  issn = {0036-1445, 1095-7200},
+  doi = {10.1137/S003614450342480},
+  langid = {english},
+
+}
+
+@article{Pernice2011_e1002059,
+  title = {How {{Structure Determines Correlations}} in {{Neuronal Networks}}},
+  author = {Pernice, Volker and Staude, Benjamin and Cardanobile, Stefano and Rotter, Stefan},
+  year = {2011},
+  month = may,
+  journal = {PLOS Computational Biology},
+  volume = {7},
+  number = {5},
+  pages = {e1002059},
+  issn = {1553-7358},
+  doi = {10.1371/journal.pcbi.1002059},
+  langid = {english},
+  keywords = {Action potentials,Covariance,Eigenvalues,Network analysis,Network motifs,Neural networks,Neurons,Probability distribution},
+
+}
+
+@article{Rajan_5,
+  title = {What Do Random Matrices Tell Us about the Brain?},
+  author = {Rajan, Kanaka},
+  pages = {5},
+  langid = {english},
+
+}
+
+@article{Rajan2006_188104,
+  title = {Eigenvalue {{Spectra}} of {{Random Matrices}} for {{Neural Networks}}},
+  author = {Rajan, Kanaka and Abbott, L. F.},
+  year = {2006},
+  month = nov,
+  journal = {Physical Review Letters},
+  volume = {97},
+  number = {18},
+  pages = {188104},
+  issn = {0031-9007, 1079-7114},
+  doi = {10.1103/PhysRevLett.97.188104},
+  langid = {english},
+
+}
+
+@article{Schlesinger1979_103,
+  title = {Terminology for Model Credibility},
+  author = {Schlesinger, S},
+  year = {1979},
+  journal = {Simulation},
+  volume = {32},
+  number = {3},
+  pages = {103--104},
+  issn = {00375497},
+  doi = {10.1177/003754977903200304},
+  abstract = {The standard set of terminology herein described was compiled by the SCS Technical Committee on Model Credibility as a report to the general membership.},
+  keywords = {Validation},
+
+}
+
+@article{Schuessler2020_013111,
+  title = {Dynamics of Random Recurrent Networks with Correlated Low-Rank Structure},
+  author = {Schuessler, Friedrich and Dubreuil, Alexis and Mastrogiuseppe, Francesca and Ostojic, Srdjan and Barak, Omri},
+  year = {2020},
+  month = feb,
+  journal = {Physical Review Research},
+  volume = {2},
+  number = {1},
+  pages = {013111},
+  issn = {2643-1564},
+  doi = {10.1103/PhysRevResearch.2.013111},
+  langid = {english},
+
+}
+
+@article{Sommers1988_1895,
+  title = {Spectrum of {{Large Random Asymmetric Matrices}}},
+  author = {Sommers, H. J. and Crisanti, A. and Sompolinsky, H. and Stein, Y.},
+  year = {1988},
+  month = may,
+  journal = {Physical Review Letters},
+  volume = {60},
+  number = {19},
+  pages = {1895--1898},
+  doi = {10.1103/PhysRevLett.60.1895},
+
+}
+
+@article{Staude2010_327,
+  title = {{{CuBIC}}: Cumulant Based Inference of Higher-Order Correlations in Massively Parallel Spike Trains},
+  author = {Staude, Benjamin and Rotter, Stefan and Gr{\"u}n, Sonja},
+  year = {2010},
+  month = aug,
+  journal = {Journal of Computational Neuroscience},
+  volume = {29},
+  number = {1-2},
+  pages = {327--350},
+  issn = {0929-5313},
+  doi = {10.1007/s10827-009-0195-x},
+
+}
+
+@article{Szucs2017_,
+  title = {When {{Null Hypothesis Significance Testing Is Unsuitable}} for {{Research}}: {{A Reassessment}}},
+  shorttitle = {When {{Null Hypothesis Significance Testing Is Unsuitable}} for {{Research}}},
+  author = {Szucs, Denes and Ioannidis, John P. A.},
+  year = {2017},
+  journal = {Frontiers in Human Neuroscience},
+  volume = {11},
+  issn = {1662-5161},
+
+}
+
+@article{Trensch2018_81,
+  title = {Rigorous {{Neural Network Simulations}}: {{A Model Substantiation Methodology}} for {{Increasing}} the {{Correctness}} of {{Simulation Results}} in the {{Absence}} of {{Experimental Validation Data}}},
+  shorttitle = {Rigorous {{Neural Network Simulations}}},
+  author = {Trensch, Guido and Gutzen, Robin and Blundell, Inga and Denker, Michael and Morrison, Abigail},
+  year = {2018},
+  journal = {Frontiers in Neuroinformatics},
+  volume = {12},
+  pages = {81},
+  issn = {1662-5196},
+  doi = {10.3389/fninf.2018.00081},
+  langid = {english},
+  keywords = {Fixed-Point Numeric,model validation,reproducibility,Spiking network models,SpiNNaker,verification and validation},
+
+}
+
+@article{vanAlbada2018_291,
+  title = {Performance {{Comparison}} of the {{Digital Neuromorphic Hardware SpiNNaker}} and the {{Neural Network Simulation Software NEST}} for a {{Full-Scale Cortical Microcircuit Model}}.},
+  author = {{van Albada}, Sacha J and Rowley, Andrew G and Senk, Johanna and Hopkins, Michael and Schmidt, Maximilian and Stokes, Alan B and Lester, David R and Diesmann, Markus and Furber, Steve B},
+  year = {2018},
+  journal = {Frontiers in neuroscience},
+  volume = {12},
+  pages = {291},
+  issn = {1662-4548},
+  doi = {10.3389/fnins.2018.00291},
+  pmid = {29875620},
+
+}
+
+@article{Venkatesh2019_116398,
+  title = {Comparing Functional Connectivity Matrices: {{A}} Geometry-Aware Approach Applied to Participant Identification},
+  shorttitle = {Comparing Functional Connectivity Matrices},
+  author = {Venkatesh, Manasij and Jaja, Joseph and Pessoa, Luiz},
+  year = {2019},
+  month = nov,
+  journal = {NeuroImage},
+  pages = {116398},
+  issn = {1053-8119},
+  doi = {10.1016/j.neuroimage.2019.116398},
+  langid = {english},
+
+}
+
+@article{Vlachos2012_e1002311,
+  title = {Beyond {{Statistical Significance}}: {{Implications}} of {{Network Structure}} on {{Neuronal Activity}}},
+  shorttitle = {Beyond {{Statistical Significance}}},
+  author = {Vlachos, Ioannis and Aertsen, Ad and Kumar, Arvind},
+  year = {2012},
+  month = jan,
+  journal = {PLOS Computational Biology},
+  volume = {8},
+  number = {1},
+  pages = {e1002311},
+  issn = {1553-7358},
+  doi = {10.1371/journal.pcbi.1002311},
+  langid = {english},
+  keywords = {Action potentials,Infectious disease control,Motor neurons,Network analysis,Neural networks,Neurons,Neuroscience,Single neuron function},
+
+}
+
+@article{Zalesky2015_466,
+  ids = {Zalesky2015_466a,Zalesky2015_466b},
+  title = {Towards a Statistical Test for Functional Connectivity Dynamics},
+  author = {Zalesky, Andrew and Breakspear, Michael},
+  year = {2015},
+  month = jul,
+  journal = {NeuroImage},
+  volume = {114},
+  pages = {466--470},
+  issn = {1053-8119},
+  doi = {10.1016/j.neuroimage.2015.03.047},
+  langid = {english},
+  keywords = {Dynamic connectivity,Functional connectivity,Non-stationarity,Sliding window,Time-resolved networks},
+
+}
+
+@article{Zhou2009_2931,
+  title = {Correlation {{Between Eigenvalue Spectra}} and {{Dynamics}} of {{Neural Networks}}},
+  author = {Zhou, Qingguo and Jin, Tao and Zhao, Hong},
+  year = {2009},
+  month = jul,
+  journal = {Neural Computation},
+  volume = {21},
+  number = {10},
+  pages = {2931--2941},
+  issn = {0899-7667},
+  doi = {10.1162/neco.2009.12-07-671},
+
+}

+ 0 - 18
environment.yaml

@@ -1,18 +0,0 @@
-name: eigenangle
-channels:
-    - defaults
-    - conda-forge
-dependencies:
-  - python >= 3.10
-  - pip
-  - pip:
-    - snakemake>=6.15.2
-    - numpy>=1.22.2
-    - scipy>=1.8.0
-    - elephant>=0.10.0
-    - neo>=0.10.0 #+nestio fix
-    - git+git://github.com/INM-6/NetworkUnit.git@v0.2
-    - viziphant>=0.2.0
-    - pandas>=1.4.0
-    - seaborn>=0.11.2
-    - jupyterlab

+ 20 - 0
environment.yml

@@ -0,0 +1,20 @@
+name: eigenangles
+channels:
+    - defaults
+    - conda-forge
+dependencies:
+  - python~=3.10
+  - pip
+  - pip:
+    - snakemake~=6.15.2
+    - numpy~=1.22.2
+    - scipy~=1.8.0
+    - elephant~=0.10.0
+    - neo~=0.10.0 # +nestio fix (PR #1097)
+    # - git+git://github.com/INM-6/NetworkUnit.git@v0.2
+    - viziphant~=0.2.0
+    - pandas~=1.4.0
+    - seaborn~=0.11.2
+    - ipympl~=0.8.8
+    - jupyterlab
+    # - nest==3.1.

BIN
paper_figures/CPP-pairwise_comparison.png


BIN
paper_figures/C_SpiNNaker_comparison.png


BIN
paper_figures/N1000_f0.8_mu0.1_p0.1_eta0.9_sex0.12_sin0.1_lognormal_original.png


BIN
paper_figures/figure_1/angle_distributions.png


Файловите разлики са ограничени, защото са твърде много
+ 254 - 0
paper_figures/figure_1/figure_1.ipynb


Файловите разлики са ограничени, защото са твърде много
+ 428 - 0
paper_figures/figure_2/figure_2.ipynb


BIN
paper_figures/figure_2/test_construction.png


BIN
paper_figures/rewiring_comparisons_absolute_synapse_number_median.png


BIN
paper_figures/rewiring_comparisons_relative_synapse_number_median.png


BIN
paper_figures/spikes_55000-60000ms.png


BIN
paper_figures/stochastic_activity_similarity.png


+ 87 - 0
polychrony_network/Snakefile

@@ -0,0 +1,87 @@
+import config
+
+rule create_correlation_matrix_from_spikes:
+    input:
+        script = 'scripts/correlation_matrix_from_spikes.py',
+        spikes = 'simulation_output/{simulator}/out_firings_after{t}h.dat',
+    output:
+        correlation = 'simulation_output/{simulator}/correlations_after{t}h.npy'
+    params:
+        t_start = config.t_start,
+        t_stop = config.t_stop,
+        bin_size = config.bin_size
+    shell:
+        """
+        python {input.script} --spikes "{input.spikes}" \
+                              --output "{output.correlation}" \
+                              --t_stop {params.t_stop} \
+                              --t_start {params.t_start} \
+                              --bin_size {params.bin_size}
+        """
+
+rule compare_polychrony_networks:
+    input:
+        script = "../scripts/{test}.py",
+        matrix_a = 'simulation_output/C/correlations_after{t}h.npy',
+        matrix_b = 'simulation_output/SpiNNaker/correlations_after{t}h.npy'
+    output:
+        temp('results/{test}_after{t}h.json')
+    params:
+        N = config.N,
+        bin_num = config.bin_num
+    shell:
+        """
+        echo {params.is_connectivity}
+        python {input.script} --matrix_a {input.matrix_a} \
+                              --matrix_b {input.matrix_b} \
+                              --output {output} \
+                              --bin_num {params.bin_num} \
+                              --N {params.N} \
+        """
+
+rule score_to_dataframe:
+    input:
+        script = '../scripts/score_to_dataframe.py',
+        data = 'results/{test}_after{t}h.json'
+    output:
+        'results/{test}_after{t}h.csv'
+    params:
+        N = config.N,
+        t_start = config.t_start,
+        t_stop = config.t_stop,
+        bin_size = config.bin_size,
+        bin_num = config.bin_num,
+        simulator_a = 'C',
+        simulator_b = 'SpiNNaker'
+    shell:
+        """
+        python {input.script} --output "{output}" \
+                              --input "{input.data}" \
+                              --recording_window {wildcards.t} \
+                              --N {params.N} \
+                              --t_start {params.t_start} \
+                              --t_stop {params.t_stop} \
+                              --bin_size {params.bin_size} \
+                              --bin_num {params.bin_num} \
+                              --simulator_a {params.simulator_a} \
+                              --simulator_b {params.simulator_b} \
+                              --test {wildcards.test}
+        """
+
+rule merge_comparison_results:
+    input:
+        script = '../scripts/merge_dataframes.py',
+        paths_file = 'results/'
+    output:
+        'results/simulator_comparison.csv'
+    shell:
+        """
+        python {input.script} --input "{input.paths_file}" \
+                              --output "{output}"
+        """
+
+rule scan:
+    input:
+        expand('results/{test}_after{t}h.csv',
+                            t=config.recording_window,
+                            test=config.test)

+ 7 - 0
polychrony_network/config.py

@@ -0,0 +1,7 @@
+N = 1000
+t_start = 0
+t_stop = 60000
+bin_size = 2
+bin_num = int((t_stop - t_start) / bin_size)
+recording_window = [1,2,3,4,5]
+test = ['eigenangle_test', 'ks_test']

+ 2 - 0
polychrony_network/results/eigenangle_test_after1h.csv

@@ -0,0 +1,2 @@
+,recording_window,N,t_start,t_stop,bin_size,bin_num,simulator_a,simulator_b,test,score,pvalue
+0,1,1000,0,60000,2,30000,C,SpiNNaker,eigenangle_test,0.008822958717024909,1.9347204414285954e-62

+ 2 - 0
polychrony_network/results/eigenangle_test_after2h.csv

@@ -0,0 +1,2 @@
+,recording_window,N,t_start,t_stop,bin_size,bin_num,simulator_a,simulator_b,test,score,pvalue
+0,2,1000,0,60000,2,30000,C,SpiNNaker,eigenangle_test,0.009956287522133983,5.608250029121226e-76

+ 2 - 0
polychrony_network/results/eigenangle_test_after3h.csv

@@ -0,0 +1,2 @@
+,recording_window,N,t_start,t_stop,bin_size,bin_num,simulator_a,simulator_b,test,score,pvalue
+0,3,1000,0,60000,2,30000,C,SpiNNaker,eigenangle_test,0.010308087866713873,1.8874894738569133e-80

+ 2 - 0
polychrony_network/results/eigenangle_test_after4h.csv

@@ -0,0 +1,2 @@
+,recording_window,N,t_start,t_stop,bin_size,bin_num,simulator_a,simulator_b,test,score,pvalue
+0,4,1000,0,60000,2,30000,C,SpiNNaker,eigenangle_test,0.009358707304554549,1.1294114540441562e-68

+ 2 - 0
polychrony_network/results/eigenangle_test_after5h.csv

@@ -0,0 +1,2 @@
+,recording_window,N,t_start,t_stop,bin_size,bin_num,simulator_a,simulator_b,test,score,pvalue
+0,5,1000,0,60000,2,30000,C,SpiNNaker,eigenangle_test,0.009785150481069755,7.557558319187672e-74

+ 2 - 0
polychrony_network/results/ks_test_after1h.csv

@@ -0,0 +1,2 @@
+,recording_window,N,t_start,t_stop,bin_size,bin_num,simulator_a,simulator_b,test,score,pvalue
+0,1,1000,0,60000,2,30000,C,SpiNNaker,ks_test,0.037750000000000006,0.0

+ 2 - 0
polychrony_network/results/ks_test_after2h.csv

@@ -0,0 +1,2 @@
+,recording_window,N,t_start,t_stop,bin_size,bin_num,simulator_a,simulator_b,test,score,pvalue
+0,2,1000,0,60000,2,30000,C,SpiNNaker,ks_test,0.057136000000000076,0.0

+ 2 - 0
polychrony_network/results/ks_test_after3h.csv

@@ -0,0 +1,2 @@
+,recording_window,N,t_start,t_stop,bin_size,bin_num,simulator_a,simulator_b,test,score,pvalue
+0,3,1000,0,60000,2,30000,C,SpiNNaker,ks_test,0.052464000000000066,0.0

+ 2 - 0
polychrony_network/results/ks_test_after4h.csv

@@ -0,0 +1,2 @@
+,recording_window,N,t_start,t_stop,bin_size,bin_num,simulator_a,simulator_b,test,score,pvalue
+0,4,1000,0,60000,2,30000,C,SpiNNaker,ks_test,0.04849000000000003,0.0

+ 2 - 0
polychrony_network/results/ks_test_after5h.csv

@@ -0,0 +1,2 @@
+,recording_window,N,t_start,t_stop,bin_size,bin_num,simulator_a,simulator_b,test,score,pvalue
+0,5,1000,0,60000,2,30000,C,SpiNNaker,ks_test,0.048911999999999956,0.0

+ 11 - 0
polychrony_network/results/simulator_comparison.csv

@@ -0,0 +1,11 @@
+,recording_window,N,t_start,t_stop,bin_size,bin_num,simulator_a,simulator_b,test,score,pvalue
+0,2,1000,0,60000,2,30000,C,SpiNNaker,ks_test,0.057136,0.0
+1,2,1000,0,60000,2,30000,C,SpiNNaker,eigenangle_test,0.0099562875221339,5.608250029121225e-76
+2,3,1000,0,60000,2,30000,C,SpiNNaker,ks_test,0.052464,0.0
+3,5,1000,0,60000,2,30000,C,SpiNNaker,ks_test,0.0489119999999999,0.0
+4,1,1000,0,60000,2,30000,C,SpiNNaker,eigenangle_test,0.0088229587170249,1.9347204414285956e-62
+5,5,1000,0,60000,2,30000,C,SpiNNaker,eigenangle_test,0.0097851504810697,7.557558319187672e-74
+6,4,1000,0,60000,2,30000,C,SpiNNaker,eigenangle_test,0.0093587073045545,1.1294114540441562e-68
+7,3,1000,0,60000,2,30000,C,SpiNNaker,eigenangle_test,0.0103080878667138,1.887489473856913e-80
+8,1,1000,0,60000,2,30000,C,SpiNNaker,ks_test,0.03775,0.0
+9,4,1000,0,60000,2,30000,C,SpiNNaker,ks_test,0.04849,0.0

+ 74 - 0
polychrony_network/scripts/correlation_matrix_from_spikes.py

@@ -0,0 +1,74 @@
+from networkunit import models, tests, scores
+import neo
+import quantities as pq
+import numpy as np
+import matplotlib.pyplot as plt
+import argparse
+from scipy.linalg import eigh
+
+class polychrony_data(models.loaded_spiketrains):
+
+    default_params = {'align_to_0': True,
+                      'filter_inh': False,
+                      'N': 1000,
+                      't_start':0*pq.ms,
+                      't_stop':60000*pq.ms,
+                      'file_path': ''
+                     }
+
+    def load(self):
+        f = open(self.params['file_path'], 'r')
+        lines = f.readlines()
+
+        # Read Spike Times
+        spike_times = [[]] * self.params['N']
+        for line in lines:
+            sec, msec, n = line.split(' ')[:3]
+            t = float(sec)*1000. + float(msec)
+            n = int(n)
+            if t > self.params['t_stop']:
+                break
+            spike_times[n] = spike_times[n] + [t]
+
+        # Fill Spike Trains
+        nbr_neurons = self.params['N']
+        if self.params['filter_inh']:
+            nbr_neurons = 800
+
+        spiketrains = [[]] * nbr_neurons
+
+        for n, st in enumerate(spike_times):
+            if n < 800:
+                n_type = 'exc'
+            else:
+                n_type = 'inh'
+            if not self.params['filter_inh'] or n_type == 'exc':
+                spiketrains[n] = neo.SpikeTrain(np.sort(st), units='ms',
+                                                t_start=self.params['t_start'],
+                                                t_stop=self.params['t_stop'],
+                                                n_type=n_type, unitID=n)
+        return spiketrains
+
+class correlation_matrix_test(tests.correlation_matrix_test):
+    score_type = scores.effect_size
+    params = {'cluster_matrix':False,
+              'remove_autocorr':False,
+              'nan_to_num':True}
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--spikes", nargs='?', type=str)
+    CLI.add_argument("--output", nargs='?', type=str)
+    CLI.add_argument("--t_start", nargs='?', type=float, default=0)
+    CLI.add_argument("--t_stop", "--T", nargs='?', type=float, default=60000)
+    args, unknown = CLI.parse_known_args()
+
+    spikes_model = polychrony_data(file_path=args.spikes,
+                                    t_start=args.t_start*pq.ms,
+                                    t_stop=args.t_stop*pq.ms,
+                                    align_to_0=True)
+
+    corr_test = correlation_matrix_test()
+    cc_matrix = corr_test.generate_prediction(spikes_model)
+
+    np.save(args.output, cc_matrix)

Файловите разлики са ограничени, защото са твърде много
+ 381 - 0
polychrony_network/scripts/plot_C-SpiNNaker_comparison.ipynb


+ 0 - 0
scripts/__init__.py


+ 271 - 0
scripts/eigenangle_test.py

@@ -0,0 +1,271 @@
+import numpy as np
+import scipy as sc
+from scipy.stats import norm
+from scipy.linalg import eigh, eig
+from scipy.integrate import quad
+from scipy.special import erf
+import math
+import json
+from pathlib import Path
+import argparse
+import matplotlib.pyplot as plt
+
+class EigenangleTest():
+    """
+    Class to create the null hypothesis for the eigenangle test comparison of
+    correlation matrices or connectivity matrices (for networks as described by
+    Rajan and Abbott 2006), and conduct the comparison for two given matrices.
+    """
+    def __init__(self, is_connectivity=False, **params):
+
+        for key, value in params.items():
+            setattr(self, key, value)
+
+        if 'N' not in params:
+            raise AttributeError('Number of neurons "N" must be given!')
+
+        self.is_connectivity = is_connectivity
+        if is_connectivity: # compare connectivity matrices
+            for param in ['f', 'mu', 'epsilon', 'sigma_ex', 'sigma_in']:
+                if not hasattr(self, param) and getattr(self, param) is not None:
+                    raise AttributeError(f'{param} not given!')
+            self.mu_ex = self.mu
+            self.mu_in = -self.f * self.mu_ex / (1-self.f)
+            self.var_J_ex = self.var_J(self.mu_ex, self.sigma_ex, self.epsilon)
+            self.var_J_in = self.var_J(self.mu_in, self.sigma_in, self.epsilon)
+            self.beta = self.var_J_in / self.var_J_ex
+            self.chi = self.var_J_in * self.N
+            self.weight_dist = self.rajan_abbott
+            self.critical_radius = np.sqrt(1 - self.f + self.f/self.beta) \
+                                 * np.sqrt(self.chi)
+
+        else: # compare correlation matrices
+            if not hasattr(self, 'bin_num') and getattr(self, 'bin_num') is not None:
+                raise AttributeError('"bin_num" not given!')
+            self.alpha = self.bin_num / self.N
+            if self.alpha < 1:
+                raise ValueError('There need to be more bins than neurons!')
+            self.weight_dist = self.marchenko_pastur
+
+
+    def compare(self, matrix_a, matrix_b):
+        if self.N != len(matrix_a) or self.N != len(matrix_b):
+            raise ValueError(f'Matrices are of wrong size (!={self.N})')
+
+        if self.is_connectivity:
+            eval_a, evec_a = eig(matrix_a)
+            eval_b, evec_b = eig(matrix_b)
+            eval_a, eval_b = np.real(eval_a), np.real(eval_b)
+            eval_a += self.critical_radius
+            eval_b += self.critical_radius
+            eval_a[eval_a<0], eval_b[eval_b<0] = 0, 0
+        else:
+            eval_a, evec_a = eigh(matrix_a)
+            eval_b, evec_b = eigh(matrix_b)
+
+        # sort eigenvalues and -vector in ascending order
+        sort_idx_a, sort_idx_b = np.argsort(eval_a), np.argsort(eval_b)
+        sort_idx_a, sort_idx_b = sort_idx_a[::-1], sort_idx_b[::-1]
+        eval_a, eval_b = eval_a[sort_idx_a], eval_b[sort_idx_b]
+        evec_a, evec_b = evec_a.T[sort_idx_a], evec_b.T[sort_idx_b]
+
+        for i, (eva, evb) in enumerate(zip(evec_a, evec_b)):
+            evec_a[i] = eva * np.sign(eva[np.argmax(np.absolute(eva))])
+            evec_b[i] = evb * np.sign(evb[np.argmax(np.absolute(evb))])
+            evec_a[i] /= np.linalg.norm(eva)
+            evec_b[i] /= np.linalg.norm(evb)
+
+        M = np.dot(evec_a, np.conjugate(evec_b).T)
+        M = np.real(M)
+        M[np.argwhere(M > 1)] = 1.
+
+        if len(M) == 1:
+            angles = np.arccos(M[0])
+        else:
+            angles = np.arccos(np.diag(M))
+
+        weights = np.sqrt((eval_a**2 + eval_b**2) / 2.)
+        smallness = 1 - angles / (np.pi/2.)
+        weighted_smallness = smallness * weights
+        similarity_score = np.mean(weighted_smallness)
+
+        self.init_null_distribution()
+        pvalue = self.pvalue(similarity_score)
+
+        return similarity_score, pvalue
+
+    def init_null_distribution(self):
+        # init min/max eigenvalues
+        if self.is_connectivity:
+            self.eigenvalue_min = 0
+            self.eigenvalue_max = 2*self.critical_radius
+        else:
+            self.eigenvalue_min = (1 - np.sqrt(1. / self.alpha)) ** 2
+            self.eigenvalue_max = (1 + np.sqrt(1. / self.alpha)) ** 2
+
+        # init angle distribution norm
+        N = 2*self.N if self.is_connectivity else self.N
+        if N <= 170:
+            self.angle_dist_norm = math.gamma(N/2.) / (np.sqrt(np.pi) \
+                                 * math.gamma((N-1)/2))
+        else:
+            angle_dist = lambda x: np.sin(x)**(N-2)
+            self.angle_dist_norm = 1 / quad(angle_dist, 0, np.pi)[0]
+
+        # calc norm for rajan_abbott eigenvalue dist
+        if self.is_connectivity:
+            self.eigenvalue_dist_norm = quad(self.eigenvalue_real_dist,
+                                             -self.critical_radius,
+                                             self.critical_radius)[0]
+
+        # init variance of similarity score distribution
+        integrand = lambda x: x**2 * self.weighted_smallness_dist(x)
+        var = quad(integrand, -np.infty, np.infty)[0]
+        self.similarity_score_sigma = np.sqrt(var/self.N)
+        return None
+
+    def angle_smallness_dist(self, D):
+        if D < -1 or D > 1:
+            return 0
+        N = 2*self.N if self.is_connectivity else self.N
+        return self.angle_dist_norm * np.pi/2 * np.cos(D*np.pi/2)**(N-2)
+
+    def angle_dist(self, phi):
+        N = 2*self.N if self.is_connectivity else self.N
+        if phi < 0 or phi > np.pi:
+            return 0
+        func = lambda p: np.sin(p)**(N-2)
+        if N < 170:
+            norm = sc.special.gamma(N/2.) / (np.sqrt(np.pi) \
+                 * sc.special.gamma((N-1)/2))
+        else:
+            norm = 1/sc.integrate.quad(func, 0, np.pi)[0]
+        return norm * func(phi)
+
+    def weighted_smallness_dist(self, D):
+        integrand = lambda x: self.angle_smallness_dist(D/float(x)) \
+                                * self.weight_dist(x) * 1. / np.abs(x)
+        return quad(integrand, self.eigenvalue_min, self.eigenvalue_max)[0]
+
+    def similarity_score_distribution(self, eta):
+        return sc.stats.norm.pdf(eta, 0, self.similarity_score_sigma)
+
+    def pvalue(self, eta):
+        sigma = self.similarity_score_sigma
+        # equal to integration of similarity_score_distribution from eta to inf
+        return .5 * (1 + erf(-eta / (sigma * np.sqrt(2))))
+
+    def marchenko_pastur(self, x):
+        x_min, x_max = self.eigenvalue_min, self.eigenvalue_max
+        y = self.alpha / (2 * np.pi * x) * np.sqrt((x_max - x) * (x - x_min))
+        if np.isnan(y):
+            return 0
+        else:
+            return y
+
+    def rajan_abbott(self, w):
+        w_shift = w - self.critical_radius
+        return 1/self.eigenvalue_dist_norm * self.eigenvalue_real_dist(w_shift)
+
+    def eigenvalue_real_dist(self, x):
+        # transform dist for abs(ev) to dist for Re(ev)
+        def transform_func(d):
+            if d**2-x**2 <= 0:
+                return 0
+            return self.eigenvalue_radius_dist(d) * d/np.sqrt(d**2-x**2)
+        return quad(transform_func, np.abs(x), self.critical_radius)[0]
+
+    def eigenvalue_radius_dist(self, w):
+        w = w / np.sqrt(self.chi)
+        r = w**2
+        critical_value = 1 - self.f + self.f/self.beta
+        if r > critical_value:
+            return 0
+        else:
+            phi_p  = self.phi(r, self.beta, self.f, dev=1)
+            phi_pp = self.phi(r, self.beta, self.f, dev=2)
+            return 1/np.pi * (r*phi_pp + phi_p) / np.sqrt(self.chi)
+
+    def q_func(self, r, a, f, dev=0):
+        ma = 1-a
+        mf = 2*(1-f)
+        A  = ma*r + 2*f - 1
+        B  = np.sqrt((ma*r - 1)**2 + 4*f*ma*r)
+        if dev == 0:
+            return (A+B)/mf
+        elif dev == 1:
+            return ma/mf * (1 + A/B)
+        elif dev == 2:
+            return ma**2 / (mf*B) * (1 - A**2/B**2)
+        else:
+            return np.nan
+
+    def phi(self, r, a, f, dev=1):
+        q   = self.q_func(r, a, f, dev=0)
+        qp  = self.q_func(r, a, f, dev=1)
+        qpp = self.q_func(r, a, f, dev=2)
+        mq  = q + 1
+        maq = (a*q + 1) / mq
+        A = 1/mq - f/q + a*r/mq - r*(a*q+1)/mq**2
+        if dev == 1:
+            return qp*A + maq
+        elif dev == 2:
+            return qpp*A \
+                 + 2*qp*(a/mq - maq/mq) \
+                 + qp**2*(-1/mq**2 + f/q**2 - 2*a*r/mq**2 + 2*r*maq/mq**2)
+        else:
+            return np.nan
+
+    def var_J(self, mu, sigma, epsilon):
+        return epsilon*sigma**2 + epsilon*(1-epsilon)*mu**2
+
+
+def none_or_X(value, dtype):
+    if value is None or not bool(value) or value == 'None':
+        return None
+    try:
+        return dtype(value)
+    except ValueError:
+        return None
+
+none_or_int = lambda v: none_or_X(v, int)
+none_or_float = lambda v: none_or_X(v, float)
+bool_arg = lambda s: False if s == 'False' else True
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--matrix_a", nargs='?', type=Path, required=True)
+    CLI.add_argument("--matrix_b", nargs='?', type=Path, required=True)
+    CLI.add_argument("--output", nargs='?', type=Path, required=True)
+    CLI.add_argument("--N", nargs='?', type=int, required=True)
+    CLI.add_argument("--bin_num", nargs='?', type=none_or_int, default=None)
+    CLI.add_argument("--f", nargs='?', type=none_or_float, default=None)
+    CLI.add_argument("--mu", "--mu_ex", nargs='?', type=none_or_float, default=None)
+    CLI.add_argument("--epsilon", nargs='?', type=none_or_float, default=None)
+    CLI.add_argument("--sigma_ex", nargs='?', type=none_or_float, default=None)
+    CLI.add_argument("--sigma_in", nargs='?', type=none_or_float, default=None)
+    CLI.add_argument("--is_connectivity", nargs='?', type=bool_arg, default=False)
+    CLI.add_argument("--shuffle_neuron_ids", nargs='?', type=bool_arg, default=False)
+    args, unknown = CLI.parse_known_args()
+
+    params = dict([(k,v) for k,v in vars(args).items()
+                    if k not in ['matrix_a', 'matrix_b', 'output']])
+
+    matrix_a = np.nan_to_num(np.load(args.matrix_a))
+    matrix_b = np.nan_to_num(np.load(args.matrix_b))
+
+    if args.shuffle_neuron_ids:
+        neuron_ids = np.arange(args.N)
+        np.random.shuffle(neuron_ids)
+        matrix_b = matrix_b[neuron_ids, :][:, neuron_ids]
+
+    eigenangle_test = EigenangleTest(**params)
+
+    score, pvalue = eigenangle_test.compare(matrix_a, matrix_b)
+
+    # print(score, pvalue)
+
+    result = {'score':score, 'pvalue':pvalue}
+
+    args.output.parent.mkdir(exist_ok=True, parents=True)
+    json.dump(result, open(args.output, 'w'))

+ 61 - 0
scripts/generate_poisson_correlation_matrix.py

@@ -0,0 +1,61 @@
+from networkunit import models, tests, scores
+import numpy as np
+from quantities import ms, Hz
+import argparse
+
+class activity_model(models.stochastic_activity):
+    params = {**models.stochastic_activity.default_params}
+
+class corr_test(tests.correlation_matrix_test):
+    score_type = scores.effect_size
+    params = {'cluster_matrix':False,
+              'remove_autocorr':False}
+
+def generate_matrix(N, t_start, t_stop, binsize, rate, assembly_sizes,
+                    correlations, bkgr_correlation, corr_method):
+
+    params = {'size': N,
+              't_start': t_start * ms,
+              't_stop': t_stop * ms,
+              'rate': rate * Hz,
+              'statistic': 'poisson',
+              'correlation_method': corr_method,
+              'expected_bin_size': binsize * ms,
+              'correlations': correlations,
+              'assembly_sizes': assembly_sizes,
+              'bkgr_correlation': bkgr_correlation,
+              'max_pattern_length':100 * ms,
+              'shuffle': False,
+              'shuffle_seed': None}
+
+    activity_model_inst = activity_model(**params)
+
+    test = corr_test()
+    return test.generate_prediction(activity_model_inst)
+
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--N", nargs='?', type=int)
+    CLI.add_argument("--t_start", nargs='?', type=float)
+    CLI.add_argument("--t_stop", nargs='?', type=float)
+    CLI.add_argument("--binsize", nargs='?', type=float)
+    CLI.add_argument("--rate", nargs='?', type=float)
+    CLI.add_argument("--assembly_sizes", nargs='?', type=lambda s: [int(i) for i in s.split(',')])
+    CLI.add_argument("--correlations", nargs='?', type=lambda s: [float(i) for i in s.split(',')])
+    CLI.add_argument("--bkgr_correlation", nargs='?', type=float)
+    CLI.add_argument("--corr_method", nargs='?', type=str)
+    CLI.add_argument("--output", nargs='?', type=str)
+    args, unknown = CLI.parse_known_args()
+
+    M = generate_matrix(N=args.N,
+                        t_start=args.t_start,
+                        t_stop=args.t_stop,
+                        binsize=args.binsize,
+                        rate=args.rate,
+                        assembly_sizes=args.assembly_sizes,
+                        correlations=args.correlations,
+                        bkgr_correlation=args.bkgr_correlation,
+                        corr_method=args.corr_method)
+
+    np.save(args.output, M)

+ 24 - 0
scripts/ks_test.py

@@ -0,0 +1,24 @@
+import numpy as np
+import scipy as sc
+from networkunit.scores import ks_distance
+import json
+from pathlib import Path
+import argparse
+
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--matrix_a", nargs='?', type=Path, required=True)
+    CLI.add_argument("--matrix_b", nargs='?', type=Path, required=True)
+    CLI.add_argument("--output", nargs='?', type=Path, required=True)
+    args, unknown = CLI.parse_known_args()
+
+    matrix_1 = np.nan_to_num(np.load(args.matrix_a))
+    matrix_2 = np.nan_to_num(np.load(args.matrix_b))
+
+    score = ks_distance.compute(matrix_1.flatten(), matrix_2.flatten())
+    print(score.score, score.pvalue)
+    result = {'score': score.score, 'pvalue': score.pvalue}
+
+    args.output.parent.mkdir(exist_ok=True, parents=True)
+    json.dump(result, open(args.output, 'w'))

+ 35 - 0
scripts/merge_dataframes.py

@@ -0,0 +1,35 @@
+import argparse
+import pandas as pd
+import numpy as np
+from pathlib import Path
+from utils import load_df
+
+def use_file(file, include=[], exclude=[]):
+    is_df = Path(file).suffix == '.csv'
+    excluded = np.array([excl in file.name for excl in exclude]).any()
+    included = np.array([incl in file.name for incl in include]).all()
+    return is_df and included and not excluded
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--input", nargs='?', type=Path, default=None)
+    CLI.add_argument("--output", nargs='?', type=Path)
+    CLI.add_argument("--exclude", nargs='?', type=lambda s: s.split(' '),
+                     default=['rewiring_results'])
+    args, unknown = CLI.parse_known_args()
+
+    dfs = []
+    if args.input is None:
+        args.input = args.output.parent
+
+    if args.input.is_file():
+        with open(args.input, "r") as file:
+            for path in file.readlines():
+                dfs.append(load_df(path))
+    elif args.input.is_dir():
+        for file in args.input.rglob("*"):
+            if use_file(file, exclude=args.exclude):
+                dfs.append(load_df(file))
+
+    full_df = pd.concat(dfs, ignore_index=True)
+    full_df.to_csv(args.output)

+ 31 - 0
scripts/plot_matrix.py

@@ -0,0 +1,31 @@
+import neo
+import quantities as pq
+import numpy as np
+import matplotlib.pyplot as plt
+import matplotlib as mpl
+import seaborn as sns
+import argparse
+from pathlib import Path
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--input", nargs='?', type=Path)
+    CLI.add_argument("--output", nargs='?', type=Path)
+    args, unknown = CLI.parse_known_args()
+
+    matrix = np.load(args.input)
+    np.fill_diagonal(matrix, np.nan)
+
+    cmap = sns.color_palette("vlag", as_cmap=True).copy()
+    cmap.set_bad(color='white')
+
+    fig, ax = plt.subplots(ncols=2, figsize=(10,10),
+                           gridspec_kw={'width_ratios':[1,0.02]})
+    sns.heatmap(matrix, cmap=cmap, center=0, square=True, ax=ax[0],
+                cbar=True, cbar_ax=ax[1])
+    ax[0].set_axis_off()
+
+    measure = args.input.name.split('.')[0]
+    ax[1].set_ylabel(measure)
+
+    plt.savefig(args.output, bbox_inches='tight')

+ 40 - 0
scripts/plot_spiketrains.py

@@ -0,0 +1,40 @@
+import neo
+import quantities as pq
+import numpy as np
+import matplotlib.pyplot as plt
+import seaborn as sns
+from viziphant.rasterplot import rasterplot_rates
+from utils import colormap
+import argparse
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--spikes", nargs='?', type=str)
+    CLI.add_argument("--output", nargs='?', type=str)
+    CLI.add_argument("--t_stop", "--T", nargs='?', type=float)
+    CLI.add_argument("--t_start", nargs='?', type=float, default=0)
+    args, unknown = CLI.parse_known_args()
+
+    io = neo.io.get_io(args.spikes)
+    spiketrains = io.read_block().segments[0].spiketrains
+    spiketrains = [st.time_slice(args.t_start*pq.ms, args.t_stop*pq.ms)
+                   for st in spiketrains]
+
+    sns.set(style='ticks', context='poster')
+    fig, ax = plt.subplots(figsize=(25,13))
+    ax, axx, axy = rasterplot_rates(spiketrains,
+                                    ax=ax,
+                                    key_list=['neuron_type'],
+                                    labelkey='neuron_type',
+                                    groupingdepth=1,
+                                    colorkey='neuron_type',
+                                    palette=[colormap['exc'], colormap['inh']],
+                                    markerargs={'markersize':1, 'marker':'.'},
+                                    pophistbins=100)
+
+    ax.set_yticklabels(['E','I'])
+    ax.set_xlabel('time [ms]')
+    axy.set_xlabel('rate [Hz]')
+    axy.set_xticklabels([float(axy.get_xticklabels()[0].get_text())*1000])
+
+    plt.savefig(args.output, bbox_inches='tight')

Файловите разлики са ограничени, защото са твърде много
+ 684 - 0
scripts/plot_stochastic_activity_similarity.ipynb


+ 33 - 0
scripts/score_to_dataframe.py

@@ -0,0 +1,33 @@
+import argparse
+import pandas as pd
+import numpy as np
+import json
+from pathlib import Path
+
+if __name__ == '__main__':
+    CLI = argparse.ArgumentParser()
+    CLI.add_argument("--output", nargs='?', type=str)
+    CLI.add_argument("--input", nargs='?', type=str)
+    CLI.add_argument("--params", nargs='?', type=str, default='')
+    args, unknown = CLI.parse_known_args()
+    if len(args.params):
+        params = dict([param.split('=') for param in args.params.split(',')])
+    else:
+        params = {}
+
+    add_params = dict([(k.strip('-'),v) for k,v in zip(unknown[:-1:2],unknown[1::2])])
+    params.update(add_params)
+
+    ext = Path(args.input).suffix
+    if ext == '.npy':
+        input = np.load(args.input, allow_pickle=True).item()
+    elif ext == '.json':
+        input = json.load(open(args.input))
+    else:
+        raise ValueError(f"Can't handle file type {ext}")
+
+    params['score'], params['pvalue'] = input['score'], input['pvalue']
+
+    df = pd.Series(params).to_frame().T
+
+    df.to_csv(args.output)

+ 76 - 0
scripts/utils.py

@@ -0,0 +1,76 @@
+import pandas as pd
+from matplotlib.offsetbox import AnchoredOffsetbox, TextArea, HPacker, VPacker
+
+
+int_types = ['N', 'binsize', 'bin_num', 'seed_a', 'seed_b', 'seed']
+float_types = ['t_start', 't_stop', 'rate', 'bkgr_correlation',
+                'score', 'pvalue', 'epsilon', 'sigma_ex', 'sigma_in', 'simtime',
+                'f', 'mu']
+dtypes = dict.fromkeys(int_types, 'Int64') | dict.fromkeys(float_types, float)
+
+colormap = {'weights': "#290d67",
+            'correlations': "#146014",
+            # 'ratio': "#c08e00",
+            'ratio': "#1A9791",
+            'rate_correlation': "#c08e00",
+            'rate_correlation_exc': "#5a88dc",
+            'exc': "#5a88dc",
+            'rate_correlation_inh': "#e8685b",
+            'inh': "#e8685b",
+           }
+
+def load_df(path):
+    df = pd.read_csv(path, dtype=dtypes)
+    df.drop(df.columns[df.columns.str.contains('unnamed', case=False)],
+            axis=1, inplace=True)
+    return df
+
+
+def compact_column(df, compact_column='matrix', expand_column=['score', 'pvalue']):
+    compact_values = df[compact_column].unique()
+    if len(compact_values) <= 1:
+        return df
+    elif len(compact_values) > 2:
+        raise ValueError('Can not compact on column with more than 2 values')
+
+    df_left, df_right = [df[df[compact_column] == compact_value].copy()
+                         for compact_value in compact_values]
+    df_left.drop(compact_column, axis=1, inplace=True)
+    df_right.drop(compact_column, axis=1, inplace=True)
+
+    out = expand_column if type(expand_column) == list else [expand_column]
+    out += [compact_column]
+    on = [col for col in df_left.columns.to_list() if col not in out]
+
+    df_compact = df_left.merge(df_right, how='left', on=on,
+                               suffixes=(f'_{compact_values[0]}',
+                                         f'_{compact_values[1]}'))
+    return df_compact
+
+
+def stack_columns(df, prefixes=['pvalue'], suffixes=['weights', 'correlations'],
+                  new_column='matrix'):
+    dfs = []
+    for suffix in suffixes:
+        data = df.copy()
+        data[new_column] = suffix
+        for prefix in prefixes:
+            data[prefix] = data[f'{prefix}_{suffix}']
+            for suf in suffixes:
+                data.drop(f'{prefix}_{suf}', axis=1, inplace=True)
+        dfs += [data]
+    return pd.concat(dfs, axis=0, ignore_index=True)
+
+
+def multicolor_ylabel(ax, list_of_strings, list_of_colors, anchorpad=0,
+                      bbox_to_anchor=(-0.05, 0.5), **kw):
+    ax.set_ylabel('')
+    textprops=dict(ha='left', va='bottom', rotation=90, **kw)
+    boxes = [TextArea(text, textprops=textprops | dict(color=color))
+             for text, color in zip(list_of_strings[::-1], list_of_colors[::-1])]
+    ybox = VPacker(children=boxes, align="center", pad=0, sep=5)
+    anchored_ybox = AnchoredOffsetbox(loc='center', child=ybox, pad=anchorpad,
+                                      frameon=False, bbox_to_anchor=bbox_to_anchor,
+                                      bbox_transform=ax.transAxes, borderpad=0.)
+    ax.add_artist(anchored_ybox)
+    return None

+ 109 - 0
stochastic_activity/Snakefile

@@ -0,0 +1,109 @@
+import config
+
+wildcard_constraints:
+    bkgr_correlation = '[\d\.]+',
+    seed = '\d+',
+    seed_a = '\d+',
+    seed_b = '\d+',
+
+rule generate_poisson_correlation_matrix:
+    input:
+        script = "scripts/generate_poisson_correlation_matrix.py"
+    output:
+        "correlation_matrices/N{N}_t{t_start}-{t_stop}ms_bin{binsize}ms_rate{rate}Hz_hub{assembly_sizes}_corr{correlations}_bkgr{bkgr_correlation}_{corr_method}/{seed}.npy"
+    conda:
+        "environment.yaml"
+    shell:
+        """
+        python {input.script} --N {wildcards.N} \
+                              --t_start {wildcards.t_start} \
+                              --t_stop {wildcards.t_stop} \
+                              --binsize {wildcards.binsize} \
+                              --rate {wildcards.rate} \
+                              --assembly_sizes {wildcards.assembly_sizes} \
+                              --correlations {wildcards.correlations} \
+                              --bkgr_correlation  {wildcards.bkgr_correlation} \
+                              --corr_method {wildcards.corr_method} \
+                              --output {output}
+        """
+
+rule compare_correlation_matrices:
+    input:
+        script = "../scripts/{test}.py",
+        matrix_a = "correlation_matrices/N{N}_t{t_start}-{t_stop}ms_bin{binsize}ms_rate{rate}Hz_hub{assembly_sizes}_corr{correlations}_bkgr{bkgr_correlation}_{corr_method_a}/{seed_a}.npy",
+        matrix_b = "correlation_matrices/N{N}_t{t_start}-{t_stop}ms_bin{binsize}ms_rate{rate}Hz_hub{assembly_sizes}_corr{correlations}_bkgr{bkgr_correlation}_{corr_method_b}/{seed_b}.npy",
+    params:
+        bin_num = config.bin_num
+    conda:
+        "environment.yaml"
+    output:
+        temp("results/{corr_method_a}-{corr_method_b}_N{N}_t{t_start}-{t_stop}ms_bin{binsize}ms_rate{rate}Hz_hub{assembly_sizes}_corr{correlations}_bkgr{bkgr_correlation}/{test}_{seed_a}-{seed_b}.json")
+    shell:
+        """
+        python {input.script} --matrix_a {input.matrix_a} \
+                              --matrix_b {input.matrix_b} \
+                              --output {output} \
+                              --bin_num {params.bin_num} \
+                              --N {wildcards.N}
+        """
+
+rule score_to_dataframe:
+    input:
+        script = '../scripts/score_to_dataframe.py',
+        data = 'results/{corr_method_a}-{corr_method_b}_N{N}_t{t_start}-{t_stop}ms_bin{binsize}ms_rate{rate}Hz_hub{assembly_sizes}_corr{correlations}_bkgr{bkgr_correlation}/{test}_{seed_a}-{seed_b}.json'
+    output:
+        'results/{corr_method_a}-{corr_method_b}_N{N}_t{t_start}-{t_stop}ms_bin{binsize}ms_rate{rate}Hz_hub{assembly_sizes}_corr{correlations}_bkgr{bkgr_correlation}/{test}_{seed_a}-{seed_b}.csv'
+    shell:
+        """
+        python {input.script} --output "{output}" \
+                              --input "{input.data}" \
+                              --corr_method_a {wildcards.corr_method_a} \
+                              --corr_method_b {wildcards.corr_method_b} \
+                              --N {wildcards.N} \
+                              --t_start {wildcards.t_start} \
+                              --t_stop {wildcards.t_stop} \
+                              --binsize {wildcards.binsize} \
+                              --rate {wildcards.rate} \
+                              --assembly_sizes {wildcards.assembly_sizes} \
+                              --correlations {wildcards.correlations} \
+                              --bkgr_correlation {wildcards.bkgr_correlation} \
+                              --test {wildcards.test} \
+                              --seed_a {wildcards.seed_a} \
+                              --seed_b {wildcards.seed_b}
+        """
+
+rule collect_result_paths:
+    input:
+        config = 'config.py',
+        data = expand("results/{corr_method_a}-{corr_method_b}_N{N}_t{t_start}-{t_stop}ms_bin{binsize}ms_rate{rate}Hz_hub{assembly_sizes}_corr{correlations}_bkgr{bkgr_correlation}/{test}_{seed_pair}.csv",
+                        corr_method_a=config.corr_method[0],
+                        corr_method_b=config.corr_method[1],
+                        N=config.N,
+                        t_start=config.t_start,
+                        t_stop=config.t_stop,
+                        binsize=config.binsize,
+                        rate=config.rate,
+                        assembly_sizes=config.assembly_sizes,
+                        correlations=config.correlations,
+                        bkgr_correlation=config.bkgr_correlation,
+                        test=config.test,
+                        seed_pair=config.seed_pairs)
+    output:
+        temp('results/result_paths.txt')
+    shell:
+        """
+        printf '%s\n' "{input.data}" | xargs printf '%s\n' > {output}
+        """
+
+
+rule merge_comparison_results:
+    input:
+        script = '../scripts/merge_dataframes.py',
+        paths_file = 'results/result_paths.txt'
+    output:
+        'results/stochastic_activity_comparison.csv'
+    shell:
+        """
+        python {input.script} --input "{input.paths_file}" \
+                              --output "{output}"
+        """

+ 17 - 0
stochastic_activity/config.py

@@ -0,0 +1,17 @@
+import itertools
+
+N=100
+t_start=0 #ms
+t_stop=30000 #ms
+rate=10 #Hz
+binsize=2 #ms
+assembly_sizes=[1,2,3,4,5,6]
+# assembly_sizes='6,8'
+correlations=[0.,0.05,0.1,0.15,0.2,0.3,0.4]
+# correlations='0.3,0.1'
+bkgr_correlation=0.
+corr_method=['CPP', 'CPP'] #'pairwise_equivalent']
+test=['ks_test']
+seed=[0,1,2,3,4,5] #,6,7,8,9,10,11,12,13,14]
+seed_pairs = [f'{i[0]}-{i[1]}' for i in itertools.combinations(seed,2)]
+bin_num = int((t_stop-t_start) / binsize)

+ 2 - 0
stochastic_activity/results/CPP-pairwise_equivalent_N100_t0-30000ms_bin2ms_rate10Hz_hub6,8_corr0.3,0.1_bkgr0.0/eigenangle_test_0-1.csv

@@ -0,0 +1,2 @@
+,corr_method_a,corr_method_b,N,t_start,t_stop,binsize,rate,assembly_sizes,correlations,bkgr_correlation,test,seed_a,seed_b,score,pvalue
+0,CPP,pairwise_equivalent,100,0,30000,2,10,"6,8","0.3,0.1",0.0,eigenangle_test,0,1,0.00728161102028534,0.12833351152271097

+ 2 - 0
stochastic_activity/results/CPP-pairwise_equivalent_N100_t0-30000ms_bin2ms_rate10Hz_hub6,8_corr0.3,0.1_bkgr0.0/eigenangle_test_0-10.csv

@@ -0,0 +1,2 @@
+,corr_method_a,corr_method_b,N,t_start,t_stop,binsize,rate,assembly_sizes,correlations,bkgr_correlation,test,seed_a,seed_b,score,pvalue
+0,CPP,pairwise_equivalent,100,0,30000,2,10,"6,8","0.3,0.1",0.0,eigenangle_test,0,10,-0.00984027483095445,0.9373477594711721

+ 2 - 0
stochastic_activity/results/CPP-pairwise_equivalent_N100_t0-30000ms_bin2ms_rate10Hz_hub6,8_corr0.3,0.1_bkgr0.0/eigenangle_test_0-11.csv

@@ -0,0 +1,2 @@
+,corr_method_a,corr_method_b,N,t_start,t_stop,binsize,rate,assembly_sizes,correlations,bkgr_correlation,test,seed_a,seed_b,score,pvalue
+0,CPP,pairwise_equivalent,100,0,30000,2,10,"6,8","0.3,0.1",0.0,eigenangle_test,0,11,0.007630956875248813,0.11727415594943033

+ 2 - 0
stochastic_activity/results/CPP-pairwise_equivalent_N100_t0-30000ms_bin2ms_rate10Hz_hub6,8_corr0.3,0.1_bkgr0.0/eigenangle_test_0-12.csv

@@ -0,0 +1,2 @@
+,corr_method_a,corr_method_b,N,t_start,t_stop,binsize,rate,assembly_sizes,correlations,bkgr_correlation,test,seed_a,seed_b,score,pvalue
+0,CPP,pairwise_equivalent,100,0,30000,2,10,"6,8","0.3,0.1",0.0,eigenangle_test,0,12,0.004806215613446307,0.22702035666520928

+ 0 - 0
stochastic_activity/results/CPP-pairwise_equivalent_N100_t0-30000ms_bin2ms_rate10Hz_hub6,8_corr0.3,0.1_bkgr0.0/eigenangle_test_0-13.csv


Някои файлове не бяха показани, защото твърде много файлове са промени