Utilising the simulator of the Virtual Brain.
Available at:
https://www.thevirtualbrain.org/tvb/zwei
https://github.com/the-virtual-brain/tvb-root
Uses Python 3.
Simulation is performed by the .csh and .py files. Analysis is done by the .ipynb.
For reproducibility purposes, we created "Reproducibility.ipynb" which generates all the figures shown in the paper before editing with imaging software.
The markdown version of the Jupyter notebook is below.
from useful_fns import *
# Suppress warning messages for clarity
blockPrint()
import warnings
warnings.filterwarnings('ignore')
from Reproducibility import *
# Resize height of scrollable output for viewing purposes
from IPython.core.display import display, HTML
display(HTML("<style>div.output_scroll { height: 1000em; }</style>"))
matplotlib.rcParams['figure.figsize'] = (10.0, 5.0)
Subfigure Notes:
B & G - Represent our data input and can be generated by running Show_SCM() and Show_FCM() respectively.
F - Also represents our and can be generated with brainrender_regions.py. Due to compatability issues between TVB and BrainRender, we do not show the output here.
The other figures are for illustration purposes.
Show_SCM()
Show_FCM()
Het_Sample_Figures_Fig1()
A-C: Output of Homog_sweep(Path_to_Regime) with the appropriate folder path to the files pertaining the desired Parameter Regime.
D-F: Output of Bif_Diagram_Generation(). We note that the sample current ranges in the paper were inputted manuualy after analysis of simulations using inkscape.
Homog_sweep(r"do-not-track\\2020_09_23\\LCycle*Scorr*.csv")
Homog_sweep(r"do-not-track\\2020_10_05\\FixedPt*Scorr*.csv")
Homog_sweep(r"do-not-track\\2020_10_06\\Hysteresis*Scorr*.csv")
Bif_Diagram_Generation()
A : See Figure 2.
B & E : See Output of Single_Run_Plots() for Region ii.
C & F : See Output of Single_Run_Plots() for Region iii.
D & G : See Output of Single_Run_Plots() for Region iv.
See Output of Single_Run_Plots for Region iv.
# Region ii
Regime = "LCycle"
G_value = 0.45
B_e_value = 2.8
File_start = r"do-not-track\\2020_09_23\\" + Regime + "_G[[]" + str(G_value) + "[]]_b_e[[]" + str(B_e_value) + "[]]"
Single_Run_Plots(File_start,Regime,G_value,B_e_value)
# Region iii
Regime = "LCycle"
G_value = 0.45
B_e_value = 2
File_start = r"do-not-track\\2020_09_23\\" + Regime + "_G[[]" + str(G_value) + "[]]_b_e[[]" + str(B_e_value)
Single_Run_Plots(File_start,Regime,G_value,B_e_value)
# Region iv
Regime = "LCycle"
G_value = 0.7
B_e_value = 1.5
File_start = r"do-not-track\\2020_09_23\\" + Regime + "_G[[]" + str(G_value) + "[]]_b_e[[]" + str(B_e_value) + "[]]"
Single_Run_Plots(File_start,Regime,G_value,B_e_value)
A - D : Run LCycle_Het_Bif_Diagrams(Regions,Scaling)
Where: Regions = 6, Scaling = 0.1
Scaling is the extent of the perturbation allowed.
LCycle_Het_Bif_Diagrams(6,0.1)
A - D : Run Single_Run_Het_Plots(File_start,Regime,G_value,B_e_value,sig_e,sig_i)
E: Run Show_Sig_sweep()
Regime = "LCycle"
G_value = 0.7
sig_e = 0.2
sig_i = 0.2
B_e_value = 1.5
File_start = r"do-not-track\\2021_01_25\\" + Regime +"*_G[[]" + str(G_value) + "[]]*sig_e" + str(sig_e) + "_sig_i" + str(sig_i)
Single_Run_Het_Plots(File_start,Regime,G_value,B_e_value,sig_e,sig_i)
Show_Sig_sweep()
A : ShuffleValidations()
B : BenchmarkingVsLitereature()
ShuffleValidations()
BenchmarkingVsLitereature()
S2 - Fixed Pt Model : Single_Run_Plots(File_start,Regime,G_value,B_e_value)
S3 - Hysteresis Model : Single_Run_Plots(File_start,Regime,G_value,B_e_value)
S5 -
S6 - Hysteresis Bifurcation Diagrams : Hysteresis_Het_Bif_Diagrams(6,0.5)
Noting that in the paper these were drawn by hand.
S7 - Identifying the border between Region ii and iii : J_e_Border_Check()
Regime = "FixedPt"
G_value = 0.65
B_e_value = 3.3
File_start = r"do-not-track\\2020_10_05\\" + Regime + "_G[[]" + str(G_value) + "[]]_b_e[[]" + str(B_e_value) + "[]]"
Single_Run_Plots(File_start,Regime,G_value,B_e_value)
Regime = "Hysteresis"
G_value = 0.35
B_e_value = 3.7
File_start = r"do-not-track\\2020_10_06\\" + Regime + "_G[[]" + str(G_value) + "[]]_b_e[[]" + str(B_e_value) + "[]]"
Single_Run_Plots(File_start,Regime,G_value,B_e_value)
WARNING File 'average_orientations' not found in ZIP.
WARNING File 'cortical' not found in ZIP.
WARNING File 'hemispheres' not found in ZIP.
WARNING File 'areas' not found in ZIP.
Max 2.023416231837847
Median 0.5974218818401118
Min -0.015410692627944802
[5.42201530e-001 1.16755535e-102 5.07998490e-001 5.55818089e-045]
LCycle_Het_Bif_Diagrams(6,0.5)
Hysteresis_Het_Bif_Diagrams(6,0.5)
J_e_Border_Check()