bmtk.simulator.bionet package

Submodules

bmtk.simulator.bionet.biocell module

class bmtk.simulator.bionet.biocell.BioCell(node, population_name, bionetwork)[source]

Bases: bmtk.simulator.bionet.cell.Cell

Implemntation of a morphologically and biophysically detailed type cell.

calc_seg_coords(morph_seg_coords)[source]

Update the segment coordinates (after rotations) for individual cells

connections()[source]
get_connection_info()[source]
get_im()[source]

Gather membrane currents from PtrVector into imVec (does not need a loop!)

get_section(sec_id)[source]
get_sections()[source]
get_sections_id()[source]
get_seg_coords()[source]
get_segments()[source]
init_connections()[source]
morphology
morphology_file
print_synapses()[source]
set_e_extracellular(vext)[source]
set_im_ptr()[source]

Set PtrVector to point to the _ref_i_membrane_ parameter

set_morphology(morphology_obj)[source]
set_nseg(dL)[source]

Define number of segments in a cell

set_ptr2e_extracellular()[source]
set_sec_array()[source]

Arrange sections in an array to be access by index

set_spike_detector(spike_threshold)[source]
set_syn_connection(edge_prop, src_node, stim=None, gj_ids=None)[source]
setup_ecp()[source]
setup_xstim(set_nrn_mechanism=True)[source]
store_segments()[source]
class bmtk.simulator.bionet.biocell.BioCellSpontSyn(node, population_name, bionetwork)[source]

Bases: bmtk.simulator.bionet.biocell.BioCell

Special class that allows certain synapses to spontaneously fire (without spiking) at a specific time.

class bmtk.simulator.bionet.biocell.ConnectionStruct(edge_prop, src_node, syn, connector, is_virtual=False, is_gap_junc=False)[source]

Bases: object

is_gap_junc
is_virtual
source_node
syn_weight

bmtk.simulator.bionet.bionetwork module

class bmtk.simulator.bionet.bionetwork.BioNetwork[source]

Bases: bmtk.simulator.core.simulator_network.SimNetwork

add_nodes(node_population)[source]
add_spike_trains(spike_trains, node_set)[source]
build_disconnected_inputs(spike_trains, edges_path, edge_types_path, source_node_set, target_node_set)[source]
build_nodes()[source]
build_recurrent_edges()[source]
calc_seg_coords()[source]

Needed for the ECP calculations

cell_type_maps(model_type)[source]
find_edges(source_nodes=None, target_nodes=None)[source]
get_cell_gid(gid)[source]
get_cell_node_id(population, node_id)[source]
get_disconnected_cell(population, node_id, spike_trains)[source]
get_gj_id(network, src_nid, trg_nid, source_gap)[source]

Returns the gap junction id for the given nodes on a given network.

Parameters:source_gap – whether to return the id of the gap junction on the source node or the target node.
get_local_cells()[source]
get_node_id(population, node_id)[source]
get_virtual_cells(population, node_id, spike_trains)[source]
gid_pool
local_gids
make_morphologies()[source]

Creating a Morphology object for each biophysical model

model_type_col = 'model_type'
py_function_caches
set_seg_props()[source]

Set morphological properties for biophysically (morphologically) detailed cells

set_spont_syn_activity(precell_filter, timestamps)[source]

bmtk.simulator.bionet.biosimulator module

class bmtk.simulator.bionet.biosimulator.BioSimulator(network, dt, tstop, v_init, celsius, nsteps_block, start_from_state=False)[source]

Bases: bmtk.simulator.core.simulator.Simulator

Includes methods to run and control the simulation

add_mod(module)[source]
attach_current_clamp(amplitude, delay, duration, gids=None, section_name='soma', section_index=0, section_dist=0.5)[source]
attach_file_current_clamp(input_file)[source]
attach_se_voltage_clamp(amplitudes, durations, gids, rs)[source]
biophysical_gids
cell_var_output
cell_variables
celsius
dt
classmethod from_config(config, network, set_recordings=True)[source]
h
local_gids
n_steps
nsteps_block
post_fadvance()[source]

Runs after every execution of fadvance (see advance.hoc) Called after every time step to perform computation and save data to memory block or to disk. The initial condition tstep=0 is not being saved

report_load_balance()[source]
run()[source]

Run the simulation: if beginning from a blank state, then will use h.run(), if continuing from the saved state, then will use h.continuerun()

set_spikes_recording()[source]
simulation_time(units='ms')[source]
spikes_table
tstop
v_init

bmtk.simulator.bionet.cell module

class bmtk.simulator.bionet.cell.Cell(node, population_name, network=None)[source]

Bases: object

A abstract base class for any cell object.

A base class for implementation of a cell-type objects like biophysical cells, LIF cells, etc. Do not instantiate a Cell object directly. Cell classes act as wrapper around HOC cell object with extra functionality for setting positions, synapses, and other parameters depending on the desired cell class.

get_connection_info()[source]
gid
group_id
hobj
init_connections()[source]
netcons
network_name
node
node_id
scale_weights(factor)[source]
set_soma_position()[source]
set_syn_connections(edge_prop, src_node, stim=None)[source]
soma_position

bmtk.simulator.bionet.config module

class bmtk.simulator.bionet.config.Config(*args, **kwargs)[source]

Bases: bmtk.simulator.core.simulation_config.SimulationConfig

build_env()[source]

Creates the folder(s) set in ‘output’ section, sets up logging and copies over the configuration

create_output_dir()[source]
load_nrn_modules()[source]

bmtk.simulator.bionet.gids module

class bmtk.simulator.bionet.gids.GidPool[source]

Bases: object

add_pool(name, n_nodes)[source]
get_gid(name, node_id)[source]
get_pool_id(gid)[source]
class bmtk.simulator.bionet.gids.PopulationID(node_id, population)

Bases: tuple

node_id

Alias for field number 0

population

Alias for field number 1

bmtk.simulator.bionet.iclamp module

class bmtk.simulator.bionet.iclamp.FileIClamp(amplitudes, dt)[source]

Bases: object

attach_current(cell)[source]
class bmtk.simulator.bionet.iclamp.IClamp(amplitude, delay, duration, section_name='soma', section_index=0, section_dist=0.5)[source]

Bases: object

attach_current(cell)[source]

bmtk.simulator.bionet.io_tools module

class bmtk.simulator.bionet.io_tools.NEURONIOUtils[source]

Bases: bmtk.simulator.core.io_tools.IOUtils

barrier()[source]

MPI Barrier call

bmtk.simulator.bionet.morphology module

class bmtk.simulator.bionet.morphology.Morphology(hobj)[source]

Bases: object

Methods for processing morphological data

calc_seg_coords()[source]

Calculate segment coordinates from 3d point coordinates

find_sections(target_sections, distance_range)[source]
get_nseg()[source]
get_soma_pos()[source]
get_target_segments(edge_type)[source]
set_seg_props()[source]

Set segment properties which are invariant for all cell using this morphology

bmtk.simulator.bionet.nml_reader module

class bmtk.simulator.bionet.nml_reader.ChannelDensity(nml_element)[source]

Bases: bmtk.simulator.bionet.nml_reader.NMLElement

static element_tag()[source]
class bmtk.simulator.bionet.nml_reader.ChannelDensityNernst(nml_element)[source]

Bases: bmtk.simulator.bionet.nml_reader.ChannelDensity

static element_tag()[source]
class bmtk.simulator.bionet.nml_reader.ConcentrationModel(nml_element)[source]

Bases: bmtk.simulator.bionet.nml_reader.NMLElement

static element_tag()[source]
class bmtk.simulator.bionet.nml_reader.NMLElement(nml_element)[source]

Bases: object

static element_tag()[source]
class bmtk.simulator.bionet.nml_reader.NMLTree(nml_path)[source]

Bases: object

static common_name(elem)[source]
element_registry = {'{http://www.neuroml.org/schema/neuroml2}channelDensity': <class 'bmtk.simulator.bionet.nml_reader.ChannelDensity'>, '{http://www.neuroml.org/schema/neuroml2}channelDensityNernst': <class 'bmtk.simulator.bionet.nml_reader.ChannelDensityNernst'>, '{http://www.neuroml.org/schema/neuroml2}concentrationModel': <class 'bmtk.simulator.bionet.nml_reader.ConcentrationModel'>, '{http://www.neuroml.org/schema/neuroml2}resistivity': <class 'bmtk.simulator.bionet.nml_reader.Resistivity'>, '{http://www.neuroml.org/schema/neuroml2}specificCapacitance': <class 'bmtk.simulator.bionet.nml_reader.SpecificCapacitance'>}
nml_ns = '{http://www.neuroml.org/schema/neuroml2}'
classmethod ns_name(name)[source]
static parse_value(value)[source]
classmethod register_module(element_cls)[source]
class bmtk.simulator.bionet.nml_reader.Resistivity(nml_element)[source]

Bases: bmtk.simulator.bionet.nml_reader.NMLElement

static element_tag()[source]
class bmtk.simulator.bionet.nml_reader.SpecificCapacitance(nml_element)[source]

Bases: bmtk.simulator.bionet.nml_reader.NMLElement

static element_tag()[source]

bmtk.simulator.bionet.nrn module

bmtk.simulator.bionet.nrn.clear_gids()[source]
bmtk.simulator.bionet.nrn.load_neuron_modules(mechanisms_dir, templates_dir, default_templates=True)[source]
Parameters:
  • mechanisms_dir
  • templates_dir
  • default_templates
bmtk.simulator.bionet.nrn.load_templates(template_dir)[source]

Load all templates to be available in the hoc namespace for instantiating cells

bmtk.simulator.bionet.nrn.quit_execution()[source]
bmtk.simulator.bionet.nrn.reset()[source]

bmtk.simulator.bionet.pointprocesscell module

class bmtk.simulator.bionet.pointprocesscell.ConnectionStruct(edge_prop, src_node, nc, is_virtual=False)[source]

Bases: object

is_virtual
source_node
syn_weight
class bmtk.simulator.bionet.pointprocesscell.PointProcessCell(node, population_name, bionetwork)[source]

Bases: bmtk.simulator.bionet.cell.Cell

Implimentation of a Leaky Integrate-and-file neuron type cell.

connections()[source]
get_connection_info()[source]
print_synapses()[source]
set_im_ptr()[source]
set_spike_detector()[source]
set_syn_connection(edge_prop, src_node, stim=None)[source]
class bmtk.simulator.bionet.pointprocesscell.PointProcessCellSpontSyns(node, population_name, bionetwork)[source]

Bases: bmtk.simulator.bionet.pointprocesscell.PointProcessCell

Special class that allows certain synapses to spontaneously fire (without spiking) at a specific time.

set_syn_connection(edge_prop, src_node, stim=None)[source]

bmtk.simulator.bionet.pointsomacell module

class bmtk.simulator.bionet.pointsomacell.PointSomaCell[source]

Bases: bmtk.simulator.bionet.cell.Cell

Used to represent single compartment cells with neural mechanisms

bmtk.simulator.bionet.pyfunction_cache module

bmtk.simulator.bionet.seclamp module

class bmtk.simulator.bionet.seclamp.SEClamp(amplitudes, durations, rs=None)[source]

Bases: object

attach_current(cell)[source]

bmtk.simulator.bionet.sonata_adaptors module

class bmtk.simulator.bionet.sonata_adaptors.BioEdge(sonata_edge, edge_adaptor)[source]

Bases: bmtk.simulator.core.sonata_reader.edge_adaptor.SonataBaseEdge

afferent_section_id
afferent_section_pos
load_synapses(section_x, section_id)[source]
class bmtk.simulator.bionet.sonata_adaptors.BioEdgeAdaptor(network)[source]

Bases: bmtk.simulator.core.sonata_reader.edge_adaptor.EdgeAdaptor

get_edge(sonata_edge)[source]
classmethod patch_adaptor(adaptor, edge_group)[source]
class bmtk.simulator.bionet.sonata_adaptors.BioNode(node, prop_adaptor)[source]

Bases: bmtk.simulator.core.sonata_reader.node_adaptor.SonataBaseNode

load_cell()[source]
morphology_file
position
rotation_angle_xaxis
rotation_angle_yaxis
rotation_angle_zaxis
rotations
rotations_quaternion
class bmtk.simulator.bionet.sonata_adaptors.BioNodeAdaptor(network)[source]

Bases: bmtk.simulator.core.sonata_reader.node_adaptor.NodeAdaptor

get_node(sonata_node)[source]
classmethod patch_adaptor(adaptor, node_group, network)[source]
bmtk.simulator.bionet.sonata_adaptors.aff_sec_id(self, edge)[source]
bmtk.simulator.bionet.sonata_adaptors.aff_sec_id_old(self, edge)[source]
bmtk.simulator.bionet.sonata_adaptors.aff_sec_pos(self, edge)[source]
bmtk.simulator.bionet.sonata_adaptors.aff_sec_pos_old(self, edge)[source]
bmtk.simulator.bionet.sonata_adaptors.position(self, node)[source]
bmtk.simulator.bionet.sonata_adaptors.position_x(self, node)[source]
bmtk.simulator.bionet.sonata_adaptors.position_xy(self, node)[source]
bmtk.simulator.bionet.sonata_adaptors.position_xyz(self, node)[source]
bmtk.simulator.bionet.sonata_adaptors.positions(self, node)[source]
bmtk.simulator.bionet.sonata_adaptors.positions_default(self, node)[source]
bmtk.simulator.bionet.sonata_adaptors.ret_none_function(self, edge)[source]
bmtk.simulator.bionet.sonata_adaptors.rotation_angle_default(self, node)[source]
bmtk.simulator.bionet.sonata_adaptors.rotation_angle_x(self, node)[source]
bmtk.simulator.bionet.sonata_adaptors.rotation_angle_y(self, node)[source]
bmtk.simulator.bionet.sonata_adaptors.rotation_angle_z(self, node)[source]
bmtk.simulator.bionet.sonata_adaptors.rotations(self, node)[source]
bmtk.simulator.bionet.sonata_adaptors.value_none(self, node)[source]

bmtk.simulator.bionet.utils module

bmtk.simulator.bionet.utils.edge_converter_csv(output_dir, csv_file)[source]

urrently being used by BioNetwork.write_connections(), need to refactor

Parameters:
  • output_dir
  • csv_file
Returns:

bmtk.simulator.bionet.utils.rotation_matrix(axis, theta)[source]

Return the rotation matrix associated with counterclockwise rotation about the given axis by theta radians.

bmtk.simulator.bionet.virtualcell module

class bmtk.simulator.bionet.virtualcell.VirtualCell(node, population, spike_train_dataset)[source]

Bases: object

Representation of a Virtual/External node

hobj
node_id
set_stim(stim_prop, spike_train)[source]

Gets the spike trains for each individual cell.

Module contents