To run the models in cerebmodels the user must be in the root of ``~/cerebmodels/``
Since this notebook is in ~/cerebmodels/docs/notebooks/ the user must move up two directories
[1]:
cd ..
/home/main-dev/cerebmodels/docs
[2]:
cd ..
/home/main-dev/cerebmodels
Model Execution - Case2: stimulation, raw-mode (i.e. without evoking capability)¶
1. Set-up¶
Import ExecutiveControl of cerebmodels¶
[3]:
from executive import ExecutiveControl as ec
2. Search for models and pick a desired model¶
2.1. See available model scales¶
[4]:
ec.list_modelscales()
[4]:
['cells', 'subcell', 'synapses', 'microcircuits', 'layers']
2.2. See available models for a particular scale¶
Below shows the available models at the level of cellular modelling scale.
[5]:
ec.list_models( modelscale = "cells" )
[5]:
['PC1997aHausser',
'PC1997bHausser',
'PC2010Genet',
'GoC2007Solinas',
'GrC1994Gabbiani',
'PC2009Akemann',
'PC2013Marasco',
'PC2006Akemann',
'GoC2010Botta',
'PC2001Miyasho',
'PC2003Khaliq',
'GoC2011Souza',
'GrC2016Dover',
'PC2018Zang',
'PC2015Masoli',
'PC2011Brown',
'PC2015aForrest',
'GrC2011Souza',
'PC2015bForrest',
'GrC2001DAngelo',
'DCN2011Luthman',
'GrC2009Diwakar']
2.3. Pick a desired model¶
Although it is not essential to instantiate ExecutiveControl to launch the model, it is recommended if one were to visualize the response.
[6]:
exc = ec()
[7]:
%%capture
desired_model = exc.choose_model( modelscale = "cells", modelname = "PC2003Khaliq")
3. Launching (executing) the desired model¶
3.1. Setting the parameters¶
For our case of launching the model with stimulation and without CerbUnit’s capability, one is required to define the run-time parameters and the stimulation parameters.
[8]:
runtimeparam = { "dt": 0.025, "celsius": 37, "tstop": 1000, "v_init": -65 }
For the case of current clamp injection,
[9]:
stimparam = { "type": ["current", "IClamp"],
"stimlist": [ {"amp": 0.1, "dur": 300.0, "delay": 200.0},
{"amp": 0.1, "dur": 300.0, "delay": 500.+200.} ],
"tstop": runtimeparam["tstop"] }
In addition, another required parameter is where the user would like to stimulate. For instance if the interested site of injecting the current is the soma of the cell
[10]:
stim_here = desired_model.cell.soma
NOTE: The name “soma” here is not ad-hoc but dependent on how the soma is named in the model template. See 4.1 (below). Here, soma is named as it is but it could easily have been “Soma”, “somas”, etc …
3.2. Executing the model¶
[11]:
desired_model = exc.launch_model( parameters = runtimeparam, stimparameters = stimparam, stimloc = "soma",
onmodel = desired_model )
--- 0.22818700000000014 seconds ---
3.3. Saving the response¶
In CerebUnit the model response are saved in an HDF5 file based on NWB:2.0 scheme. Execution of save_response() returns the filename and its path. Below, this return full path and filename is assigned to the attribute ``fullfilename`` of the model.
[12]:
%%capture
desired_model.fullfilename = exc.save_response()
4. Visualizing the response¶
4.1. List model regions of the chosen model¶
Before one calls the visualization function the user must define the the region of interest (roi) from which the response will be visualized.
[13]:
exc.list_modelregions( chosenmodel = desired_model )
[13]:
['soma v']
4.2. Visualize all events¶
The method visualize_all plots all the events in respective sub-plot. In our particular case with not stimulation the simulation has only one event therefore only one sub-plot is seen below.
[14]:
exc.visualize_all(chosenmodel = desired_model, roi="soma v")
4.3. Visualize all events in one plot¶
[15]:
exc.visualize_aio(chosenmodel = desired_model, roi="soma v")
[ ]: