miv_simulator.synapses#

Functions

apply_syn_mech_rules(cell, env, syn_name, ...)

Provided a synaptic mechanism, a parameter, a node, a list of syn_ids, and a dict of rules.

config_biophys_cell_syns(env, gid, postsyn_name)

Configures the given syn_ids, and call config_syn with mechanism and netcon parameters (which must not be empty).

config_hoc_cell_syns(env, gid, postsyn_name)

Configures the given syn_ids, and call config_syn with mechanism and netcon parameters (which must not be empty).

config_syn(syn_name, rules[, mech_names, ...])

Initializes synaptic and connection mechanisms with parameters specified in the synapse attribute dictionaries.

distribute_poisson_synapses(density_seed, ...)

Computes synapse locations distributed according to a Poisson distribution.

distribute_uniform_synapses(density_seed, ...)

Computes uniformly-spaced synapse locations.

get_node_attribute(name, content, sec, secnodes)

type name:

get_syn_filter_dict(env, rules[, convert, ...])

Used by modify_syn_param.

get_syn_mech_param(syn_name, rules, param_name)

type syn_name:

init_syn_mech_attrs(cell[, env, ...])

Consults a dictionary specifying parameters of NEURON synaptic mechanisms (point processes) for each type of section in a BiophysCell.

insert_biophys_cell_syns(env, gid, ...[, ...])

  1. make syns (if not unique, keep track of syn_in_seg for shared synapses)

insert_hoc_cell_syns(env, gid, cell, ...[, ...])

TODO: Only config the point process object if it has not already been configured.

make_shared_synapse_mech(syn_name, seg, ...)

If a synaptic mechanism of the specified type already exists in the specified segment, it is returned.

make_syn_mech(mech_name, seg)

TODO: Why was the hasattr(h, mech_name) check removed? :type mech_name: str :param mech_name: str (name of the point_process, specified by Env.synapse_attributes.syn_mech_names) :type seg: Segment :param seg: hoc segment :rtype: HocObject :return: hoc point process

make_unique_synapse_mech(syn_name, seg[, ...])

Creates a new synapse in the provided segment, and returns it.

modify_syn_param(cell, env, sec_type, syn_name)

Modifies a cell's mechanism dictionary to specify attributes of a synaptic mechanism by sec_type.

set_syn_mech_param(cell, env, node, syn_ids, ...)

Provided a synaptic mechanism, a parameter, a node, a list of syn_ids, and a dict of rules.

syn_in_seg(syn_name, seg, syns_dict)

If a synaptic mechanism of the specified type already exists in the specified segment, it is returned.

synapse_seg_counts(syn_type_dict, ...[, ...])

Computes per-segment relative counts of synapse placement.

synapse_seg_density(syn_type_dict, ...[, ...])

Computes per-segment density of synapse placement.

update_syn_mech_by_sec_type(cell, env, ...)

For the provided sec_type and synaptic mechanism, this method loops through the parameters specified in the mechanism dictionary, interprets the rules, and sets placeholder values in the syn_mech_attr_dict of a SynapseAttributes object.

update_syn_mech_param_by_sec_type(cell, env, ...)

For the provided synaptic mechanism and parameter, this method loops through nodes of the provided sec_type, interprets the provided rules, and sets placeholder values in the syn_mech_attr_dict of a SynapseAttributes object.

validate_syn_mech_param(env, syn_name, ...)

type env:

AbstractEnv

write_syn_spike_count(env, pop_name, output_path)

Writes spike counts per presynaptic source for each cell in the given population to a NeuroH5 file.

Classes

SynapseAttributes(env, syn_mech_names, ...)

This class provides an interface to store, retrieve, and modify attributes of synaptic mechanisms.

SynapseSource()

This class provides information about the presynaptic (source) cell connected to a synapse.

miv_simulator.synapses.get_node_attribute(name, content, sec, secnodes, x=None)[source]#
Parameters:
  • name

  • content

  • sec

  • secnodes

  • x

Returns:

miv_simulator.synapses.synapse_seg_density(syn_type_dict, layer_dict, layer_density_dicts, seg_dict, ran, neurotree_dict=None)[source]#

Computes per-segment density of synapse placement. :type syn_type_dict: :param syn_type_dict: :type layer_dict: :param layer_dict: :type layer_density_dicts: :param layer_density_dicts: :type seg_dict: :param seg_dict: :type ran: :param ran: :type neurotree_dict: :param neurotree_dict: :return:

miv_simulator.synapses.synapse_seg_counts(syn_type_dict, layer_dict, layer_density_dicts, sec_index_dict, seg_dict, ran, neurotree_dict=None)[source]#

Computes per-segment relative counts of synapse placement. :type syn_type_dict: :param syn_type_dict: :type layer_dict: :param layer_dict: :type layer_density_dicts: :param layer_density_dicts: :type sec_index_dict: :param sec_index_dict: :type seg_dict: :param seg_dict: :param seed: :type neurotree_dict: :param neurotree_dict: :return:

miv_simulator.synapses.distribute_uniform_synapses(density_seed, syn_type_dict, swc_type_dict, layer_dict, sec_layer_density_dict, neurotree_dict, cell_sec_dict, cell_secidx_dict)[source]#

Computes uniformly-spaced synapse locations. :type density_seed: :param density_seed: :type syn_type_dict: :param syn_type_dict: :type swc_type_dict: :param swc_type_dict: :type layer_dict: :param layer_dict: :type sec_layer_density_dict: :param sec_layer_density_dict: :type neurotree_dict: :param neurotree_dict: :param sec_dict: :param secidx_dict: :return:

miv_simulator.synapses.distribute_poisson_synapses(density_seed, syn_type_dict, swc_type_dict, layer_dict, sec_layer_density_dict, neurotree_dict, cell_sec_dict, cell_secidx_dict)[source]#

Computes synapse locations distributed according to a Poisson distribution. :type density_seed: :param density_seed: :type syn_type_dict: :param syn_type_dict: :type swc_type_dict: :param swc_type_dict: :type layer_dict: :param layer_dict: :type sec_layer_density_dict: :param sec_layer_density_dict: :type neurotree_dict: :param neurotree_dict: :type cell_sec_dict: :param cell_sec_dict: :type cell_secidx_dict: :param cell_secidx_dict: :param verbose: :return:

class miv_simulator.synapses.SynapseSource[source]#

Bases: object

This class provides information about the presynaptic (source) cell connected to a synapse.

  • gid - gid of source cell (int)

  • population - population index of source cell (int)

  • delay - connection delay (float)

class miv_simulator.synapses.SynapseAttributes(env, syn_mech_names, syn_param_rules)[source]#

Bases: object

This class provides an interface to store, retrieve, and modify attributes of synaptic mechanisms. Handles instantiation of complex subcellular gradients of synaptic mechanism attributes.

init_syn_id_attrs_from_iter(cell_iter, attr_type='dict', attr_tuple_index=None, debug=False)[source]#

Initializes synaptic attributes given an iterator that returns (gid, attr_dict). See init_syn_id_attrs for details on the format of the input dictionary.

init_syn_id_attrs(gid, syn_ids, syn_layers, syn_types, swc_types, syn_secs, syn_locs)[source]#

Initializes synaptic attributes for the given cell gid. Only the intrinsic properties of a synapse, such as type, layer, location are set.

Connection edge attributes such as source gid, point process parameters, and netcon/vecstim objects are initialized to None or empty dictionaries. :rtype: None

  • syn_ids: synapse ids

  • syn_layers: layer index for each synapse id

  • syn_types: synapse type for each synapse id

  • swc_types: swc type for each synapse id

  • syn_secs: section index for each synapse id

  • syn_locs: section location for each synapse id

init_edge_attrs(gid, presyn_name, presyn_gids, edge_syn_ids, delays=None)[source]#

Sets connection edge attributes for the specified synapse ids.

Parameters:
  • gid (int) – gid for post-synaptic (target) cell (int)

  • presyn_name (str) – name of presynaptic (source) population (string)

  • presyn_ids – gids for presynaptic (source) cells (array of int)

  • edge_syn_ids (ndarray) – synapse ids on target cells to be used for connections (array of int)

  • delays (Optional[List[Union[float64, float]]]) – axon conduction (netcon) delays (array of float)

Return type:

None

init_edge_attrs_from_iter(pop_name, presyn_name, attr_info, edge_iter, set_edge_delays=True)[source]#

Initializes edge attributes for all cell gids returned by iterator.

Parameters:
  • pop_name (str) – name of postsynaptic (target) population (string)

  • source_name – name of presynaptic (source) population (string)

  • attr_info (Dict[str, Dict[str, Dict[str, Dict[str, int]]]]) – dictionary mapping attribute name to indices in iterator tuple

  • edge_iter (List[Tuple[int, Tuple[ndarray, Dict[str, List[ndarray]]]]]) – edge attribute iterator

  • set_edge_delays (bool) – bool

Return type:

None

add_pps(gid, syn_id, syn_name, pps)[source]#

Adds mechanism point process for the specified cell/synapse id/mechanism name.

Parameters:
  • gid (int) – cell id

  • syn_id (uint32) – synapse id

  • syn_name (str) – synapse mechanism name

  • pps (HocObject) – hoc point process

Return type:

HocObject

has_pps(gid, syn_id, syn_name)[source]#

Returns True if the given synapse id already has the named mechanism, False otherwise.

Parameters:
  • gid – cell id

  • syn_id – synapse id

  • syn_name – synapse mechanism name

Returns:

bool

get_pps(gid, syn_id, syn_name, throw_error=True)[source]#

Returns the mechanism for the given synapse id on the given cell.

Parameters:
  • gid (int) – cell id

  • syn_id (uint32) – synapse id

  • syn_name (str) – mechanism name

Return type:

HocObject

Returns:

hoc point process

add_netcon(gid, syn_id, syn_name, nc)[source]#

Adds a NetCon object for the specified cell/synapse id/mechanism name.

Parameters:
  • gid (int) – cell id

  • syn_id (uint32) – synapse id

  • syn_name (str) – synapse mechanism name

  • nc (HocObject) – :class:’h.NetCon’

Return type:

HocObject

has_netcon(gid, syn_id, syn_name)[source]#

Returns True if a netcon exists for the specified cell/synapse id/mechanism name, False otherwise.

Parameters:
  • gid – cell id

  • syn_id – synapse id

  • syn_name – synapse mechanism name

Returns:

bool

get_netcon(gid, syn_id, syn_name, throw_error=True)[source]#

Returns the NetCon object associated with the specified cell/synapse id/mechanism name.

Parameters:
  • gid – cell id

  • syn_id – synapse id

  • syn_name – synapse mechanism name

Returns:

:class:’h.NetCon’

del_netcon(gid, syn_id, syn_name, throw_error=True)[source]#

Removes a NetCon object for the specified cell/synapse id/mechanism name.

Parameters:
  • gid – cell id

  • syn_id – synapse id

  • syn_name – synapse mechanism name

add_vecstim(gid, syn_id, syn_name, vs, nc)[source]#

Adds a VecStim object and associated NetCon for the specified cell/synapse id/mechanism name.

Parameters:
  • gid – cell id

  • syn_id – synapse id

  • syn_name – synapse mechanism name

  • vs – :class:’h.VecStim’

  • nc – :class:’h.NetCon’

has_vecstim(gid, syn_id, syn_name)[source]#

Returns True if a vecstim exists for the specified cell/synapse id/mechanism name, False otherwise.

Parameters:
  • gid – cell id

  • syn_id – synapse id

  • syn_name – synapse mechanism name

Returns:

bool

get_vecstim(gid, syn_id, syn_name, throw_error=True)[source]#

Returns the VecStim and NetCon objects associated with the specified cell/synapse id/mechanism name.

Parameters:
  • gid – cell id

  • syn_id – synapse id

  • syn_name – synapse mechanism name

Returns:

tuple of :class:’h.VecStim’ :class:’h.NetCon’

has_mech_attrs(gid, syn_id, syn_name)[source]#

Returns True if mechanism attributes have been specified for the given cell id/synapse id/mechanism name, False otherwise.

Parameters:
  • gid – cell id

  • syn_id – synapse id

  • syn_name – synapse mechanism name

Returns:

bool

get_mech_attrs(gid, syn_id, syn_name, throw_error=True)[source]#

Returns mechanism attribute dictionary associated with the given cell id/synapse id/mechanism name, False otherwise.

Parameters:
  • gid – cell id

  • syn_id – synapse id

  • syn_name – synapse mechanism name

Returns:

dict

add_mech_attrs(gid, syn_id, syn_name, params, append=False)[source]#

Specifies mechanism attribute dictionary for the given cell id/synapse id/mechanism name. Assumes mechanism attributes have not been set yet for this synapse mechanism.

Parameters:
  • gid – cell id

  • syn_id – synapse id

  • syn_name – synapse mechanism name

  • params – dict

  • append – whether to append attribute values with the same attribute name

stash_mech_attrs(pop_name, gid)[source]#

Preserves mechanism attributes for the given cell id.

Parameters:
  • pop_name – population name

  • gid – cell id

  • syn_id – synapse id

  • syn_name – synapse mechanism name

restore_mech_attrs(pop_name, gid, stash_id)[source]#

Restored mechanism attributes for the given cell id.

Parameters:
  • pop_name – population name

  • gid – cell id

  • syn_id – synapse id

  • syn_name – synapse mechanism name

modify_mech_attrs(pop_name, gid, syn_id, syn_name, params, expr_param_check='ignore')[source]#

Modifies mechanism attributes for the given cell id/synapse id/mechanism name.

Parameters:
  • pop_name – population name

  • gid – cell id

  • syn_id – synapse id

  • syn_name – synapse mechanism name

  • params – dict

add_mech_attrs_from_iter(gid, syn_name, params_iter, multiple='error', append=False)[source]#

Adds mechanism attributes for the given cell id/synapse id/synapse mechanism.

Parameters:
  • gid – cell id

  • syn_id – synapse id

  • syn_name – synapse mechanism name

  • params_iter – iterator

  • multiple – behavior when an attribute value is provided for a synapse that already has attributes: - ‘error’ (default): raise an error - ‘skip’: do not update attribute value - ‘overwrite’: overwrite value

  • append – whether to append attribute values with the same attribute name

filter_synapses(gid, syn_sections=None, syn_indexes=None, syn_types=None, layers=None, sources=None, swc_types=None, cache=False)[source]#

Returns a subset of the synapses of the given cell according to the given criteria.

Parameters:
  • gid (int) – int

  • syn_sections (Optional[List[int]]) – array of int

  • syn_indexes (None) – array of int: syn_ids

  • syn_types (Optional[List[int]]) – list of enumerated type: synapse category

  • layers (None) – list of enumerated type: layer

  • sources (None) – list of enumerated type: population names of source projections

  • swc_types (None) – list of enumerated type: swc_type

  • cache (bool) – bool

Return type:

Dict[Any, Any]

Returns:

dictionary { syn_id: { attribute: value } }

partition_synapses_by_source(gid, syn_ids=None)[source]#

Partitions the synapse objects for the given cell based on the presynaptic (source) population index.

Parameters:
  • gid (int) – int

  • syn_ids (Optional[List[uint32]]) – array of int

Return type:

Dict[str, Optional[chain]]

get_filtered_syn_ids(gid, syn_sections=None, syn_indexes=None, syn_types=None, layers=None, sources=None, swc_types=None, cache=False)[source]#

Returns a subset of the synapse ids of the given cell according to the given criteria. :type gid: :param gid: :type syn_sections: :param syn_sections: :type syn_indexes: :param syn_indexes: :type syn_types: :param syn_types: :type layers: :param layers: :type sources: :param sources: :type swc_types: :param swc_types: :type cache: :param cache: :return: sequence

partition_syn_ids_by_source(gid, syn_ids=None)[source]#

Partitions the synapse ids for the given cell based on the presynaptic (source) population index.

Parameters:
  • gid (int) – int

  • syn_ids (Optional[List[uint32]]) – array of int

Return type:

Dict[str, chain]

del_syn_id_attr_dict(gid)[source]#

Removes the synapse attributes associated with the given cell gid.

Return type:

None

miv_simulator.synapses.insert_hoc_cell_syns(env, gid, cell, syn_ids, syn_params, unique=False, insert_netcons=False, insert_vecstims=False)[source]#

TODO: Only config the point process object if it has not already been configured.

Insert mechanisms into given cell according to the synapse objects created in env.synapse_attributes. Configures mechanisms according to parameter values specified in syn_params.

Parameters:
  • env (AbstractEnv) – :class:’Env’

  • gid (int) – cell id (int)

  • cell (HocObject) – hoc cell object

  • syn_ids (Union[List[uint32], chain]) – synapse ids (array of int)

  • syn_params (Dict[str, Union[Dict[str, Dict[str, Union[int, float]]], Dict[str, Union[Dict[str, Union[int, float]], Dict[str, float]]]]]) – dictionary of the form { mech_name: params }

  • unique (bool) – True, if unique mechanisms are to be inserted for each synapse; False, if synapse mechanisms within a compartment will be shared.

  • insert_netcons (bool) – bool; whether to build new netcons for newly constructed synapses

  • insert_vecstims (bool) – bool; whether to build new vecstims for newly constructed netcons

  • verbose – bool

Return type:

Tuple[int, int, int]

Returns:

number of inserted mechanisms

miv_simulator.synapses.insert_biophys_cell_syns(env, gid, postsyn_name, presyn_name, syn_ids, unique=None, insert_netcons=True, insert_vecstims=True, verbose=False)[source]#
  1. make syns (if not unique, keep track of syn_in_seg for shared synapses)

  2. initialize syns with syn_mech_params from config_file

  3. make netcons

  4. initialize netcons with syn_mech_params environment configuration

Parameters:
  • env (AbstractEnv) – :class:’Env’

  • gid (int) – int

  • postsyn_name (str) – str

  • presyn_name (str) – str

  • syn_ids (chain) – array of int

  • unique (None) – bool; whether to insert synapses if none exist at syn_id

  • insert_netcons (bool) – bool; whether to build new netcons for newly constructed synapses

  • insert_vecstims (bool) – bool; whether to build new vecstims for newly constructed netcons

  • verbose (bool) – bool

Return type:

None

miv_simulator.synapses.config_biophys_cell_syns(env, gid, postsyn_name, syn_ids=None, unique=None, insert=False, insert_netcons=False, insert_vecstims=False, verbose=False, throw_error=False)[source]#

Configures the given syn_ids, and call config_syn with mechanism and netcon parameters (which must not be empty). If syn_ids=None, configures all synapses for the cell with the given gid. If insert=True, iterate over sources and call insert_biophys_cell_syns (requires a BiophysCell with the specified gid to be present in the Env).

Parameters:
  • gid (int) – int

  • env (AbstractEnv) – :class:’Env’

  • postsyn_name (str) – str

  • syn_ids (None) – array of int

  • unique (None) – bool; whether newly inserted synapses should be unique or shared per segment

  • insert (bool) – bool; whether to insert a synaptic point process if none exists at syn_id

  • insert_netcons (bool) – bool; whether to build new netcons for newly constructed synapses

  • insert_vecstims (bool) – bool; whether to build new vecstims for newly constructed netcons

  • verbose (bool) – bool

  • throw_error (bool) – bool; whether to require that all encountered syn_ids have inserted synapse

Return type:

Tuple[int, int]

miv_simulator.synapses.config_hoc_cell_syns(env, gid, postsyn_name, cell=None, syn_ids=None, unique=None, insert=False, insert_netcons=False, insert_vecstims=False, verbose=False, throw_error=False)[source]#

Configures the given syn_ids, and call config_syn with mechanism and netcon parameters (which must not be empty). If syn_ids=None, configures all synapses for the cell with the given gid. If insert=True, iterate over sources and call insert_hoc_cell_syns (requires the cell object is given or registered with h.ParallelContext on this rank).

Return type:

Tuple[int, int, int]

miv_simulator.synapses.config_syn(syn_name, rules, mech_names=None, syn=None, nc=None, **params)[source]#

Initializes synaptic and connection mechanisms with parameters specified in the synapse attribute dictionaries.

Parameters:
  • syn_name (str) – str

  • rules (Dict[str, Dict[str, Union[str, List[str], Dict[str, int]]]]) – dict to correctly parse params for specified hoc mechanism

  • mech_names (Optional[Dict[str, str]]) – dict to convert syn_name to hoc mechanism name

  • syn (Optional[HocObject]) – synaptic mechanism object

  • nc (Optional[HocObject]) – :class:’h.NetCon’

  • params – dict

Return type:

Tuple[bool, bool]

miv_simulator.synapses.syn_in_seg(syn_name, seg, syns_dict)[source]#

If a synaptic mechanism of the specified type already exists in the specified segment, it is returned. Otherwise, it returns None. :type syn_name: str :param syn_name: str :type seg: Segment :param seg: hoc segment :type syns_dict: DefaultDict[Section, DefaultDict[float, DefaultDict[str, HocObject]]] :param syns_dict: nested defaultdict :rtype: Optional[HocObject] :return: hoc point process or None

miv_simulator.synapses.make_syn_mech(mech_name, seg)[source]#

TODO: Why was the hasattr(h, mech_name) check removed? :type mech_name: str :param mech_name: str (name of the point_process, specified by Env.synapse_attributes.syn_mech_names) :type seg: Segment :param seg: hoc segment :rtype: HocObject :return: hoc point process

miv_simulator.synapses.make_shared_synapse_mech(syn_name, seg, syns_dict, mech_names=None)[source]#

If a synaptic mechanism of the specified type already exists in the specified segment, it is returned. Otherwise, this method creates one in the provided segment and adds it to the provided syns_dict before it is returned.

Parameters:
  • syn_name (str) – str

  • seg (Segment) – hoc segment

  • syns_dict (DefaultDict[Section, DefaultDict[float, DefaultDict[str, HocObject]]]) – nested defaultdict

  • mech_names (Optional[Dict[str, str]]) – dict to convert syn_name to hoc mechanism name

Return type:

HocObject

Returns:

hoc point process

miv_simulator.synapses.make_unique_synapse_mech(syn_name, seg, syns_dict=None, mech_names=None)[source]#

Creates a new synapse in the provided segment, and returns it.

Parameters:
  • syn_name – str

  • seg – hoc segment

  • syns_dict – nested defaultdict

  • mech_names – map of synapse name to hoc mechanism name

Returns:

hoc point process

miv_simulator.synapses.get_syn_mech_param(syn_name, rules, param_name, mech_names=None, nc=None)[source]#
Parameters:
  • syn_name – str

  • rules – dict to correctly parse params for specified hoc mechanism

  • param_name – str

  • mech_names – dict to convert syn_name to hoc mechanism name

  • nc – :class:’h.NetCon’

miv_simulator.synapses.get_syn_filter_dict(env, rules, convert=False, check_valid=True)[source]#

Used by modify_syn_param. Takes in a series of arguments and constructs a validated rules dictionary that specifies to which sets of synapses a rule applies. Values of filter queries are validated by the provided Env.

Parameters:
  • env (AbstractEnv) – :class:’Env’

  • rules (Dict[str, List[str]]) – dict

  • convert (bool) – bool; whether to convert string values to enumerated type

Return type:

Dict[str, List[int]]

Returns:

dict

miv_simulator.synapses.validate_syn_mech_param(env, syn_name, param_name)[source]#
Parameters:
  • env (AbstractEnv) – :class:’Env’

  • syn_name – str

  • param_name – str

Returns:

bool

miv_simulator.synapses.modify_syn_param(cell, env, sec_type, syn_name, param_name=None, value=None, append=False, filters=None, origin_filters=None, update_targets=False, verbose=False)[source]#

Modifies a cell’s mechanism dictionary to specify attributes of a synaptic mechanism by sec_type. This method is meant to be called manually during initial model specification, or during parameter optimization.

Calls update_syn_mech_by_sec_type to set placeholder values in the syn_mech_attrs_dict of a SynapseAttributes object. If update_targets flag is True, the attributes of any target synaptic point_process and netcon objects that have been inserted will also be updated. Otherwise, they can be updated separately by calling

Parameters:
  • cell – :class:’BiophysCell’

  • env (AbstractEnv) – :class:’Env’

  • sec_type – str

  • syn_name – str

  • param_name – str

  • value – float

  • append – bool

  • filters – dict

  • origin_filters – dict

  • update_targets – bool

  • verbose – bool

miv_simulator.synapses.update_syn_mech_by_sec_type(cell, env, sec_type, syn_name, mech_content, update_targets=False, verbose=False)[source]#

For the provided sec_type and synaptic mechanism, this method loops through the parameters specified in the mechanism dictionary, interprets the rules, and sets placeholder values in the syn_mech_attr_dict of a SynapseAttributes object.

Parameters:
  • cell – :class:’BiophysCell’

  • env (AbstractEnv) – :class:’Env’

  • sec_type – str

  • syn_name – str

  • mech_content – dict

  • update_targets – bool

  • verbose – bool

miv_simulator.synapses.update_syn_mech_param_by_sec_type(cell, env, sec_type, syn_name, param_name, rules, update_targets=False, verbose=False)[source]#

For the provided synaptic mechanism and parameter, this method loops through nodes of the provided sec_type, interprets the provided rules, and sets placeholder values in the syn_mech_attr_dict of a SynapseAttributes object. If filter queries are provided, their values are converted to enumerated types.

Parameters:
  • cell – :class:’BiophysCell’

  • env (AbstractEnv) – :class:’Env’

  • sec_type – str

  • syn_name – str

  • param_name – str

  • rules – dict

  • update_targets – bool

  • verbose – bool

miv_simulator.synapses.apply_syn_mech_rules(cell, env, syn_name, param_name, rules, node=None, syn_ids=None, synapse_filters=None, update_targets=False, verbose=False)[source]#

Provided a synaptic mechanism, a parameter, a node, a list of syn_ids, and a dict of rules. Interprets the provided rules and updates synaptic mechanisms. Calls set_syn_mech_param to sets parameter values in the syn_mech_attr_dict of a SynapseAttributes object.

Parameters:
  • cell – :class:’BiophysCell’

  • env (AbstractEnv) – :class:’Env’

  • node – :class:’SectionNode’

  • syn_ids – sequence of int

  • syn_name – str

  • param_name – str

  • rules – dict

  • update_targets – bool

  • verbose – bool

miv_simulator.synapses.set_syn_mech_param(cell, env, node, syn_ids, syn_name, param_name, baseline, rules, update_targets=False, verbose=False)[source]#

Provided a synaptic mechanism, a parameter, a node, a list of syn_ids, and a dict of rules. Sets placeholder values for each provided syn_id in the syn_mech_attr_dict of a SynapseAttributes object. If update_targets flag is True, the attributes of any target synaptic point_process and netcon objects that have been inserted will also be updated. Otherwise, they can be updated separately by calling config_syns.

Parameters:
  • cell – :class:’BiophysCell’

  • env (AbstractEnv) – :class:’Env’

  • node – :class:’SectionNode’

  • syn_ids – array of int

  • syn_name – str

  • param_name – str

  • baseline – float

  • rules – dict

  • update_targets – bool

  • verbose – bool

miv_simulator.synapses.init_syn_mech_attrs(cell, env=None, reset_mech_dict=False, update_targets=False)[source]#

Consults a dictionary specifying parameters of NEURON synaptic mechanisms (point processes) for each type of section in a BiophysCell. Traverses through the tree of SHocNode nodes following order of inheritance. Calls update_syn_mech_by_sec_type to set placeholder values in the syn_mech_attrs_dict of a SynapseAttributes object. If update_targets flag is True, the attributes of any target synaptic point_process and netcon objects that have been inserted will also be updated. Otherwise, they can be updated separately by calling config_syns.

Parameters:
  • cell (Union[SCneuron, BiophysCell]) – :class:’BiophysCell’

  • env (Optional[AbstractEnv]) – :class:’Env’

  • reset_mech_dict (bool) – bool

  • update_targets (bool) – bool

Return type:

None

miv_simulator.synapses.write_syn_spike_count(env, pop_name, output_path, filters=None, syn_names=None, write_kwds={})[source]#

Writes spike counts per presynaptic source for each cell in the given population to a NeuroH5 file. Assumes that attributes have been set via config_syn.

Parameters:
  • env (AbstractEnv) – instance of env.Env

  • pop_name (str) – population name

  • output_path (str) – path to NeuroH5 file

  • filters (Optional[Dict[str, List[str]]]) – optional filter for synapses

Return type:

None