miv_simulator.cells#
Functions
|
Provided a membrane density mechanism, a parameter, a node, and a dict of rules, interprets the provided rules, and applies resulting parameter values to mechanisms in the corresponding section. |
|
Converts analog voltage in the specified section to digital spike output. |
|
Connects the given section node to a parent node, and if specified, establishes a connection between their associated hoc sections. |
|
|
|
If not explicitly modeling spine compartments for excitatory synapses, this method scales g_pas in all dendritic sections proportional to the number of excitatory synapses contained in each section. |
|
If not explicitly modeling spine compartments for excitatory synapses, this method scales cm in this dendritic section proportional to the number of excitatory synapses contained in the section. |
|
If not explicitly modeling spine compartments for excitatory synapses, this method scales g_pas in this dendritic section proportional to the number of excitatory synapses contained in the section. |
|
Returns a subset of the nodes of the given cell according to the given criteria. |
|
Returns the distance from the given location on the given node to its connection with a root node. |
|
|
|
|
|
|
|
Imports from a .yaml file a dictionary specifying parameters of NEURON cable properties, density mechanisms, and point processes for each type of section in a BiophysCell. |
|
Append sections from an existing instance of a NEURON cell template to a Python cell wrapper. |
|
Consults a dictionary specifying parameters of NEURON cable properties, density mechanisms, and point processes for each type of section in a BiophysCell. |
|
|
|
|
|
Initializes the spike detector in the given cell according to the given arguments or a spike detector configuration of the mechanism dictionary of the cell, if one exists. |
|
|
|
|
|
Returns True if cell gid has already been registered, False otherwise. |
|
Loads the data necessary to instantiate BiophysCell into the given dictionary. |
|
|
|
|
|
|
|
|
|
|
|
Instantiates an input generator according to the given cell template. |
|
Creates a graph of 3d points that follows the morphological organization of the given neuron. |
|
|
|
Creates a graph of sections that follows the topological organization of the given neuron. |
|
Creates a recording object for the given cell, according to configuration in env.recording_profile. |
|
Registers a cell in a network environment. |
|
Traverse a cell and report topology and number of synapses. |
|
Consults a dictionary specifying parameters of NEURON cable properties such as axial resistance ('Ra'), membrane specific capacitance ('cm'), and a spatial resolution parameter to specify the number of separate segments per section in a BiophysCell :type cell: |
|
|
|
This method loops through all sections of the specified type, and consults the mechanism dictionary to update mechanism properties. |
|
This method loops through all the parameters for a single mechanism specified in the mechanism dictionary and calls apply_mech_rules to interpret the rules and set the values for the given node. |
Classes
|
An implementation of a Booth-Rinzel-Kiehn-type reduced biophysical neuron model for simulation in NEURON. |
|
A Python wrapper for neuronal cell objects specified in the NEURON language hoc. |
|
An implementation of a Pinsky-Rinzel-type reduced biophysical neuron model for simulation in NEURON. |
|
Single-compartment biophysical neuron model for simulation in NEURON. |
|
- miv_simulator.cells.make_neurotree_hoc_cell(template_class, gid=0, neurotree_dict={}, section_content=None)[source]#
- Parameters:
template_class (
HocObject) –local_id –
gid (
int) –dataset_path –
neurotree_dict (
Dict[str,Union[ndarray,Dict[str,Union[int,Dict[int,ndarray],ndarray]]]]) –
- Return type:
Union[HocObject,Tuple[HocObject,Dict[int,Dict[str,ndarray]]]]- Returns:
hoc cell object
- miv_simulator.cells.make_hoc_cell(env, pop_name, gid, neurotree_dict=False)[source]#
- Parameters:
env (
AbstractEnv) –gid (
int) –pop_name (
str) –
- Return type:
HocObject- Returns:
- miv_simulator.cells.make_input_cell(env, gid, pop_id, input_source_dict, spike_train_attr_name='t')[source]#
Instantiates an input generator according to the given cell template.
- Return type:
HocObject
- miv_simulator.cells.make_section_graph(neurotree_dict)[source]#
Creates a graph of sections that follows the topological organization of the given neuron. :type neurotree_dict: :param neurotree_dict: :return: NetworkX.DiGraph
- class miv_simulator.cells.BRKneuron(gid, pop_name, env=None, cell_config=None, mech_dict=None)[source]#
Bases:
objectAn implementation of a Booth-Rinzel-Kiehn-type reduced biophysical neuron model for simulation in NEURON. Conforms to the same API as BiophysCell.
- class miv_simulator.cells.PRneuron(gid, pop_name, env=None, cell_config=None, mech_dict=None)[source]#
Bases:
objectAn implementation of a Pinsky-Rinzel-type reduced biophysical neuron model for simulation in NEURON. Conforms to the same API as BiophysCell.
- class miv_simulator.cells.SCneuron(gid, pop_name, env=None, mech_dict=None, mech_file_path=None)[source]#
Bases:
objectSingle-compartment biophysical neuron model for simulation in NEURON. Conforms to the same API as BiophysCell.
- class miv_simulator.cells.BiophysCell(gid, population_name, hoc_cell=None, neurotree_dict=None, mech_file_path=None, mech_dict=None, env=None)[source]#
Bases:
objectA Python wrapper for neuronal cell objects specified in the NEURON language hoc.
- miv_simulator.cells.get_distance_to_node(cell, node, root=None, loc=None)[source]#
Returns the distance from the given location on the given node to its connection with a root node. :type node:
SectionNode:param node: int :type loc:Optional[float] :param loc: float :rtype:float:return: int or float
- miv_simulator.cells.connect_nodes(tree, parent, child, parent_loc=1.0, child_loc=0.0, connect_hoc_sections=False)[source]#
Connects the given section node to a parent node, and if specified, establishes a connection between their associated hoc sections. :type parent:
SectionNode:param parent: SectionNode :type child:SectionNode:param child: SectionNode :type parent_loc:float:param parent_loc: float in [0,1] : connect to this end of the parent hoc section :type child_loc:float:param child_loc: float in [0,1] : connect this end of the child hoc section :type connect_hoc_sections:bool:param connect_hoc_sections: bool- Return type:
DiGraph
- miv_simulator.cells.import_morphology_from_hoc(cell, hoc_cell, section_content=None)[source]#
Append sections from an existing instance of a NEURON cell template to a Python cell wrapper. :type cell:
BiophysCell:param cell: :class:’BiophysCell’ :type hoc_cell:HocObject:param hoc_cell: :class:’h.hocObject’: instance of a NEURON cell template- Return type:
None
- miv_simulator.cells.import_mech_dict_from_file(cell, mech_file_path=None)[source]#
Imports from a .yaml file a dictionary specifying parameters of NEURON cable properties, density mechanisms, and point processes for each type of section in a BiophysCell. :type cell: :param cell: :class:’BiophysCell’ :type mech_file_path: :param mech_file_path: str (path)
- miv_simulator.cells.reset_cable_by_node(cell, node, verbose=True)[source]#
Consults a dictionary specifying parameters of NEURON cable properties such as axial resistance (‘Ra’), membrane specific capacitance (‘cm’), and a spatial resolution parameter to specify the number of separate segments per section in a BiophysCell :type cell:
Union[BiophysCell,SCneuron] :param cell: :class:’BiophysCell’ :param node_index: int :type verbose:bool:param verbose: bool- Return type:
None
- miv_simulator.cells.connect2target(cell, sec, loc=1.0, param='_ref_v', delay=None, weight=None, threshold=None, target=None)[source]#
Converts analog voltage in the specified section to digital spike output. Initializes and returns an h.NetCon object with voltage as a reference parameter connected to the specified target. :type cell:
Union[BiophysCell,SCneuron] :param cell: :class:’BiophysCell’ :type sec:Section:param sec: :class:’h.Section’ :type loc:float:param loc: float :type param:str:param param: str :type delay:Optional[float] :param delay: float :type weight:None:param weight: float :type threshold:Optional[int] :param threshold: float :type target:None:param target: object that can receive spikes :rtype:HocObject:return: :class:’h.NetCon’
- miv_simulator.cells.init_spike_detector(cell, node=None, distance=100.0, threshold=-30, delay=0.05, onset_delay=0.0, loc=0.5)[source]#
Initializes the spike detector in the given cell according to the given arguments or a spike detector configuration of the mechanism dictionary of the cell, if one exists.
- Parameters:
cell (
Union[BiophysCell,SCneuron]) – :class:’BiophysCell’node (
None) – :class:’SectionNode’distance (
float) – floatthreshold (
int) – floatdelay (
float) – floatonset_delay (
float) – floatloc (
float) – float
- Return type:
HocObject
- miv_simulator.cells.update_biophysics_by_sec_type(cell, sec_type, reset_cable=False, verbose=False)[source]#
This method loops through all sections of the specified type, and consults the mechanism dictionary to update mechanism properties. If the reset_cable flag is True, cable parameters are re-initialized first, then the ion channel mechanisms are updated.
- Parameters:
cell (
BiophysCell) – :class:’BiophysCell’sec_type (
str) – strreset_cable (
bool) – bool
- Return type:
None
- miv_simulator.cells.update_mechanism_by_node(cell, node, mech_name, mech_content=None, verbose=True)[source]#
This method loops through all the parameters for a single mechanism specified in the mechanism dictionary and calls apply_mech_rules to interpret the rules and set the values for the given node. :type cell:
BiophysCell:param cell: :class:’BiophysCell’ :type node:SectionNode:param node: :class:’SectionNode’ :type mech_name:str:param mech_name: str :type mech_content:Optional[Dict[str,Union[Dict[str,float],Dict[str,int]]]] :param mech_content: list of dict :type verbose:bool:param verbose: bool- Return type:
None
- miv_simulator.cells.apply_mech_rules(cell, node, mech_name, param_name, rules, point_process_loc=None, verbose=True)[source]#
Provided a membrane density mechanism, a parameter, a node, and a dict of rules, interprets the provided rules, and applies resulting parameter values to mechanisms in the corresponding section.
- Parameters:
cell (
BiophysCell) – :class:’BiophysCell’node (
SectionNode) – :class:’SectionNode’mech_name (
str) – strparam_name (
str) – strrules (
Dict[str,Union[int,float]]) – dictpoint_process_loc (
Optional[float]) – location in section if mechanism is a point processverbose (
bool) – bool
- Return type:
None
- miv_simulator.cells.set_mech_param(cell, node, mech_name, param_name, baseline, rules, point_process_loc=None)[source]#
- Parameters:
node (
SectionNode) – :class:’SectionNode’mech_name (
str) – strparam_name (
str) – strbaseline (
Union[int,float]) – floatrules (
Dict[str,Union[int,float]]) – dict
- Return type:
None
- miv_simulator.cells.filter_nodes(cell, sections=None, layers=None, swc_types=None)[source]#
Returns a subset of the nodes of the given cell according to the given criteria.
- Parameters:
cell (
BiophysCell) –sections (
None) – sequence of intlayers (
None) – list of enumerated type: layerswc_types (
Optional[List[str]]) – list of enumerated type: swc_type
- Return type:
List[SectionNode]- Returns:
list of nodes
- miv_simulator.cells.report_topology(env, cell, node=None)[source]#
Traverse a cell and report topology and number of synapses. :type cell:
BiophysCell:param cell: :type env:AbstractEnv:param env: :type node:Optional[SectionNode] :param node:- Return type:
None
- miv_simulator.cells.make_morph_graph(biophys_cell, node_filters={})[source]#
Creates a graph of 3d points that follows the morphological organization of the given neuron. :param neurotree_dict: :return: NetworkX.DiGraph
- miv_simulator.cells.load_biophys_cell_dicts(env, pop_name, gid_set, data_file_path=None, load_connections=True, validate_tree=True)[source]#
Loads the data necessary to instantiate BiophysCell into the given dictionary.
- Parameters:
env (
AbstractEnv) – an instance of env.Envpop_name (
str) – population namegid – gid
data_file_path (
None) – str or Noneload_connections (
bool) – boolvalidate_tree (
bool) – bool
- Return type:
Dict[int,Dict[str,Union[Dict[str,Union[ndarray,Dict[str,Union[int,Dict[int,ndarray],ndarray]]]],Dict[str,ndarray],Tuple[Dict[str,Dict[str,List[Tuple[int,Tuple[ndarray,Dict[str,List[ndarray]]]]]]],Dict[str,Dict[str,Dict[str,Dict[str,int]]]]],None]]]
Environment can be instantiated as: env = Env(config_file, template_paths, dataset_prefix) :param template_paths: str; colon-separated list of paths to directories containing hoc cell templates :param dataset_prefix: str; path to directory containing required neuroh5 data files
- miv_simulator.cells.init_biophysics(cell, env=None, reset_cable=True, correct_cm=False, correct_g_pas=False, reset_mech_dict=False, verbose=True)[source]#
Consults a dictionary specifying parameters of NEURON cable properties, density mechanisms, and point processes for each type of section in a BiophysCell. Traverses through the tree of SHocNode nodes following order of inheritance. Sets membrane mechanism parameters, including gradients and inheritance of parameters from nodes along the path from root. Warning! Do not reset cable after inserting synapses! :type cell:
Union[BiophysCell,SCneuron] :param cell: :class:’BiophysCell’ :type env:Optional[AbstractEnv] :param env: :class:’Env’ :type reset_cable:bool:param reset_cable: bool :type correct_cm:bool:param correct_cm: bool :type correct_g_pas:bool:param correct_g_pas: bool :type reset_mech_dict:bool:param reset_mech_dict: bool :type verbose:bool:param verbose: bool- Return type:
None
- miv_simulator.cells.correct_node_for_spines_g_pas(node, env, gid, soma_g_pas, verbose=True)[source]#
If not explicitly modeling spine compartments for excitatory synapses, this method scales g_pas in this dendritic section proportional to the number of excitatory synapses contained in the section. :type node: :param node: :class:’SHocNode’ :type env:
AbstractEnv:param env: :class:’Env’ :type gid: :param gid: int :type soma_g_pas: :param soma_g_pas: float :type verbose: :param verbose: bool
- miv_simulator.cells.correct_node_for_spines_cm(node, env, gid, verbose=True)[source]#
If not explicitly modeling spine compartments for excitatory synapses, this method scales cm in this dendritic section proportional to the number of excitatory synapses contained in the section. :type node: :param node: :class:’SHocNode’ :type env:
AbstractEnv:param env: :class:’Env’ :type gid: :param gid: int :type verbose: :param verbose: bool
- miv_simulator.cells.correct_cell_for_spines_g_pas(cell, env, verbose=False)[source]#
If not explicitly modeling spine compartments for excitatory synapses, this method scales g_pas in all dendritic sections proportional to the number of excitatory synapses contained in each section. :type cell: :param cell: :class:’BiophysCell’ :type env:
AbstractEnv:param env: :class:’Env’ :type verbose: :param verbose: bool
- miv_simulator.cells.correct_cell_for_spines_cm(cell, env, verbose=False)[source]#
- Parameters:
cell – :class:’BiophysCell’
env (
AbstractEnv) – :class:’Env’verbose – bool
- miv_simulator.cells.make_biophys_cell(env, population_name, gid, mech_file_path=None, mech_dict=None, tree_dict=None, load_synapses=False, synapses_dict=None, load_edges=False, connection_graph=None, load_weights=False, weight_dict=None, set_edge_delays=True, bcast_template=True, validate_tree=True, **kwargs)[source]#
- Parameters:
env (
AbstractEnv) – :class:’Env’population_name (
str) – strgid (
int) – inttree_dict (
Optional[Dict[str,Union[ndarray,Dict[str,Union[int,Dict[int,ndarray],ndarray]]]]]) – dictsynapses_dict (
Optional[Dict[str,ndarray]]) – dictweight_dict (
None) – list of dictload_synapses (
bool) – boolload_edges (
bool) – boolload_weights (
bool) – boolset_edge_delays (
bool) – boolmech_file_path (
None) – str (path)
- Return type:
- Returns:
:class:’BiophysCell’
- miv_simulator.cells.make_BRK_cell(env, pop_name, gid, mech_file_path=None, mech_dict=None, tree_dict=None, load_synapses=False, synapses_dict=None, load_edges=False, connection_graph=None, load_weights=False, weight_dict=None, set_edge_delays=True, bcast_template=True, **kwargs)[source]#
- Parameters:
env (
AbstractEnv) – :class:’Env’pop_name – str
gid – int
mech_file_path – str (path)
mech_dict – dict
synapses_dict – dict
weight_dicts – list of dict
load_synapses – bool
load_edges – bool
load_weights – bool
set_edge_delays – bool
- Returns:
:class:’BRKneuron’
- miv_simulator.cells.make_PR_cell(env, pop_name, gid, mech_file_path=None, mech_dict=None, tree_dict=None, load_synapses=False, synapses_dict=None, load_edges=False, connection_graph=None, load_weights=False, weight_dict=None, set_edge_delays=True, bcast_template=True, **kwargs)[source]#
- Parameters:
env (
AbstractEnv) – :class:’Env’pop_name – str
gid – int
mech_file_path – str (path)
mech_dict – dict
synapses_dict – dict
weight_dicts – list of dict
load_synapses – bool
load_edges – bool
load_weights – bool
set_edge_delays – bool
- Returns:
:class:’PRneuron’
- miv_simulator.cells.make_SC_cell(env, pop_name, gid, mech_file_path=None, mech_dict=None, tree_dict=None, load_synapses=False, synapses_dict=None, load_edges=False, connection_graph=None, load_weights=False, weight_dict=None, set_edge_delays=True, bcast_template=True, **kwargs)[source]#
- Parameters:
env (
AbstractEnv) – :class:’Env’pop_name (
str) – strgid (
int) – intmech_file_path (
None) – str (path)mech_dict (
Optional[Dict[str,Dict[str,Dict[str,Union[Dict[str,float],Dict[str,int]]]]]]) – dictsynapses_dict (
None) – dictweight_dicts – list of dict
load_synapses (
bool) – boolload_edges (
bool) – boolload_weights (
bool) – boolset_edge_delays (
bool) – bool
- Return type:
- Returns:
:class:’SCneuron’
- miv_simulator.cells.register_cell(env, pop_name, gid, cell)[source]#
Registers a cell in a network environment.
- Parameters:
env (
AbstractEnv) – an instance of the Env classpop_name (
str) – population namegid (
Union[uint32,int]) – gidcell (
Union[HocObject,BiophysCell,SCneuron]) – cell instance
- Return type:
None