.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/ms_figures_simulations.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_ms_figures_simulations.py: Simulations for manuscript figures ------------------------------------- This script needs to be executed before `ms_figures_plotting.py`. .. GENERATED FROM PYTHON SOURCE LINES 6-12 .. code-block:: Python import numpy as np from mesocircuit import mesocircuit_framework as mesoframe import parametersets import ms_figures_cross_correlation_function as ccfunc .. GENERATED FROM PYTHON SOURCE LINES 13-24 Decide which model to setup and whether to submit jobs. 1: reference (1mm2 model of macaque V1) 2: upscaled_1mm2 (full upscaled model simulated but only center 1mm2 analyzed) 3: evoked (full upscaled model with evoked activity by thalamocortical stimulation) 4: upscaled_CCs_only (full upscaled model simulated but only analysis for correlation coefficients) To calculate pairwise spike train cross-correlation functions for model 2 (after the respective network simulation and analysis has taken place), select: model = 2, run_jobs = False, run_ccfct = True. .. GENERATED FROM PYTHON SOURCE LINES 24-29 .. code-block:: Python model = 4 run_jobs = True run_ccfunc = False .. GENERATED FROM PYTHON SOURCE LINES 30-33 Configure the parameters of the simulation experiments. The biological model time is in general set to 15 min, but for the evoked model only to 10 s. .. GENERATED FROM PYTHON SOURCE LINES 33-80 .. code-block:: Python t_sim = 15 * 60 * 1000. t_sim_evoked = 10 * 1000. if model == 1: name_reference = 'reference' custom_params_reference = dict( parametersets.ps_dicts['microcircuit_MAMV1']) custom_params_reference.update({'sim_dict': {'t_sim': t_sim}}) custom_params_reference['sys_dict']['hpc']['network'].update( {'wall_clock_time': '05:00:00'}), custom_params_reference['sys_dict']['hpc'].update( {'analysis_and_plotting': {'wall_clock_time': '05:00:00'}}) if model == 2: name_upscaled_1mm2 = 'upscaled_1mm2' custom_params_upscaled_1mm2 = dict( parametersets.ps_dicts['mesocircuit_MAMV1']) custom_params_upscaled_1mm2.update({'ana_dict': {'extract_1mm2': True, 'ccs_time_interval': [2., 50., 200.]}}) custom_params_upscaled_1mm2.update({'sim_dict': {'t_sim': t_sim}}) custom_params_upscaled_1mm2['sys_dict']['hpc']['network'].update( {'wall_clock_time': '05:00:00'}), custom_params_upscaled_1mm2['sys_dict']['hpc'].update( {'analysis_and_plotting': {'wall_clock_time': '05:00:00'}}) if model == 3: name_evoked = 'evoked' custom_params_evoked = dict( parametersets.ps_dicts['mesocircuit_MAMV1_evoked']) custom_params_evoked.update({'sim_dict': {'t_sim': t_sim_evoked}}) custom_params_evoked['sys_dict']['hpc'].update( {'analysis_and_plotting': {'wall_clock_time': '05:00:00'}}) if model == 4: name_upscaled_CCs_only = 'upscaled_CCs_only' custom_params_upscaled_CCs_only = dict( parametersets.ps_dicts['mesocircuit_MAMV1']) custom_params_upscaled_CCs_only.update({ 'ana_dict': {'datatypes_preprocess': np.array(['positions', 'sptrains']), 'datatypes_statistics': np.array(['CCs_distances'])}}) custom_params_upscaled_CCs_only.update({'sim_dict': {'t_sim': t_sim}}) custom_params_upscaled_CCs_only['sys_dict']['hpc']['network'].update( {'wall_clock_time': '05:00:00'}), custom_params_upscaled_CCs_only['sys_dict']['hpc'].update( {'analysis_and_plotting': {'wall_clock_time': '05:00:00'}}) .. GENERATED FROM PYTHON SOURCE LINES 81-83 Initialize MesocircuitExperiments for each parameter combination and inspect the custom parameters in each case. .. GENERATED FROM PYTHON SOURCE LINES 83-104 .. code-block:: Python if model == 1: meso_exp_reference = mesoframe.MesocircuitExperiment( name_reference, custom_params_reference) print(meso_exp_reference.parameterview) if model == 2: meso_exp_upscaled_1mm2 = mesoframe.MesocircuitExperiment( name_upscaled_1mm2, custom_params_upscaled_1mm2) print(meso_exp_upscaled_1mm2.parameterview) if model == 3: meso_exp_evoked = mesoframe.MesocircuitExperiment( name_evoked, custom_params_evoked) print(meso_exp_evoked.parameterview) if model == 4: meso_exp_upscaled_CCs_only = mesoframe.MesocircuitExperiment( name_upscaled_CCs_only, custom_params_upscaled_CCs_only) print(meso_exp_upscaled_CCs_only.parameterview) .. GENERATED FROM PYTHON SOURCE LINES 105-108 Submit jobs. For the long simulation times, we only do the analysis but not the generic plotting routines. .. GENERATED FROM PYTHON SOURCE LINES 108-131 .. code-block:: Python if model == 1: circuit = meso_exp_reference.circuits[0] if model == 2: circuit = meso_exp_upscaled_1mm2.circuits[0] if model == 3: circuit = meso_exp_evoked.circuits[0] if model == 4: circuit = meso_exp_upscaled_CCs_only.circuits[0] if run_jobs: circuit.run_jobs( jobs=[ 'network', 'analysis', # 'plotting', # 'analysis_and_plotting' ], machine='hpc') .. GENERATED FROM PYTHON SOURCE LINES 132-134 Submit job for calculating and plotting pairwise spike train cross-correlation functions. .. GENERATED FROM PYTHON SOURCE LINES 134-138 .. code-block:: Python if model == 2 and run_jobs == False and run_ccfunc == True: ccfunc.write_jobscripts(circuit) ccfunc.run_job(circuit, machine='hpc') .. _sphx_glr_download_auto_examples_ms_figures_simulations.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: ms_figures_simulations.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: ms_figures_simulations.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: ms_figures_simulations.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_