Core Functionality

These are the files in the L5NeuronSimulation folder that are used throughout the other folders.

biophys_components

Notice that there are two different folders of both mechanisms and templates. When running a simulation, you (or build_network.py if you’re in FullSimulation) will need to remove the prefix (either L2-3 or L5) from the two folders you want to be active, depending on which cell you want. Remove the prefix of the cell you want to be using.

Files

clustering.py

Contains the classes and functions used to build functional groups and synaptic clustering.

run.py

Contains the general function run_network used to run a bmtk simulation.

L5NeuronSimulation.run.run_network(callbacks, v_report_all=False, quit_execution=True, random_seed=42)[source]

Runs the standard bmtk simulation and call the given callbacks right before running the simulation.

Parameters
  • callbacks (list) – list of functions to be called before sim.run(). each function will be called with (graph, sim)

  • v_report_all (bool) – whether the v_report should be set to record every section

  • quit_execution (bool) – whether to call bionet.nrn.quit_execution()

  • return (list) – list of returns of the given callbacks

raster_maker.py

Contains the functions and class (SonataWriter) necessary for generating and saving the input spike rasters.

my_plotting.py

Tool used for plotting various things throughout the project. Helpful for navigating the BMTK h5 structuring.

L5NeuronSimulation.my_plotting.get_key(group, index=0)[source]

From the list of the keys of the given group, returns the key at the given index.

Parameters
  • group (h5py.Group) – the h5py group to get the key from

  • index (int, optional) – index of the key in the list of the group’s keys, by default 0

Returns

desired key for the h5py group

Return type

str

L5NeuronSimulation.my_plotting.load_dataset(fname, groups=2)[source]

Gets a dataset within the given h5 file. Many BMTK h5 files have one dataset within some layers of group, and this is a useful function for getting to that dataset. Assumes that each group just has one key.

Parameters
  • fname (str) – h5 file to load

  • groups (int, optional) – number of groups before the dataset, by default 2

Returns

the desired dataset

Return type

h5py.Dataset

L5NeuronSimulation.my_plotting.plot_all_v(file, ms=False)[source]

Plots each membrane potential in the given BMTK v_report.h5 file.

Parameters
  • file (str) – location of the h5py file

  • ms (bool, optional) – whether to scale x by 0.1 to get ms scale, by default False

L5NeuronSimulation.my_plotting.plot_se(file, show=False)[source]

Used to plot se_clamp_reports from BMTK.

Parameters
  • file (str) – location of the h5py file

  • show (bool, optional) – whether to call plt.show() at the end, by default False

L5NeuronSimulation.my_plotting.plot_v(file, show=False, ms=False)[source]

Plots the membrane potential from the given BMTK v_report.h5 file.

Parameters
  • file (str) – location of the h5py file

  • show (bool, optional) – whether to call plt.show() at the end, by default False

  • ms (bool, optional) – whether to scale x by 0.1 to get ms scale, by default False