.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/run_mesocircuit.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_run_mesocircuit.py: Run mesocircuit ------------------ Main example script to run a simulation of the mesocircuit with NEST and subsequently analyze and plot the results. The simulation of the spiking neuronal network can be followed by an LFP simulation and the corresponding postprocessing and plotting. .. GENERATED FROM PYTHON SOURCE LINES 11-17 The script `mesocircuit_framework` contains the main functionality for parameter evalutation and job execution. The mesocircuit framework allows for the evaluation of parameter spaces, but here we only simulate one individual parameter combination. Several interesting parameter combinations (overwriting default values) are collected in a dictionary in the script `parametersets` for convenience. .. GENERATED FROM PYTHON SOURCE LINES 17-21 .. code-block:: Python from mesocircuit import mesocircuit_framework as mesoframe import parametersets .. GENERATED FROM PYTHON SOURCE LINES 22-30 Here, we choose the parameter set `mesocircuit_MAMV1` which is the default model. It is an upscaled version of the microcircuit representing area V1 of the Multi-Area Model (Schmidt and van Albada, 2018). 'mesocircuit_MAMV1_evoked` applies a thalamic stimulus to the center of the same model. For local testing, `local_microcircuit_PD` and `local_mesocircuit_PD` are good choices. These models base on the original microcircuit (Potjans and Diesmann, 2014) and are downscaled for execution on a laptop. .. GENERATED FROM PYTHON SOURCE LINES 30-36 .. code-block:: Python name = 'mesocircuit_MAMV1' # name = 'local_mesocircuit_PD' params_key = name custom_params = parametersets.ps_dicts[params_key] .. GENERATED FROM PYTHON SOURCE LINES 37-44 Next, we instantiate a `MesocircuitExperiment` with the custom parameters. The argument `name` can be chosen freely; here we just use the name of the parameter set. Upon instantiation, data directories are created, derived parameters calculated, and job scripts written. If an already existing experiment should be loaded, a class can be instantiated with the arguments of the existing `name` and `load=True`. .. GENERATED FROM PYTHON SOURCE LINES 44-47 .. code-block:: Python meso_exp = mesoframe.MesocircuitExperiment(name, custom_params) .. GENERATED FROM PYTHON SOURCE LINES 48-51 A `MesocircuitExperiment` provides an overview over all the parameter combinations it is holding (`parameterview`) and a list of all the individual model instances of class `Mesocircuit`` (`circuits`). .. GENERATED FROM PYTHON SOURCE LINES 51-55 .. code-block:: Python print(meso_exp.parameterview) print(meso_exp.circuits) .. GENERATED FROM PYTHON SOURCE LINES 56-63 For each Mesocircuit jobs can finally be launched. All provided jobs are run one after the other. `analysis_and_plotting` is for convenience combined into one job, but `analysis` and `plotting` can also be handled as individual jobs. For running the full model on an HPC cluster, `machine='hpc'` is required for submitting batch scripts via slurm; for a local test run `machine='local'` should be selected. .. GENERATED FROM PYTHON SOURCE LINES 63-76 .. code-block:: Python circuit = meso_exp.circuits[0] circuit.run_jobs( jobs=[ 'network', 'analysis_and_plotting', # 'lfp_simulation', # 'lfp_postprocess', # 'lfp_plotting', ], machine='hpc', # machine='local' ) .. _sphx_glr_download_auto_examples_run_mesocircuit.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: run_mesocircuit.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: run_mesocircuit.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: run_mesocircuit.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_