Neurodamus .core Sub-Modules¶
neurodamus.core.cell¶
A module implementing a high-level interface to Neuron cells.
- class neurodamus.core.cell.Cell(*args, **kw)¶
A Cell abstraction. It allows users to instantiate Cells from morphologies or create them from scratch using the Cell.Builder
- class Builder¶
Enables building a cell from soma/axon blocks
- class AxonSection(name, length, n_segments=None, **params)¶
- class DendriteSection(name, length, n_segments=None, apical=False, **params)¶
- class Section(name: str, length: float, n_segments: int = None, sec_type: int = None, **params: dict)¶
- APICAL_DENDRITE = 2¶
- AXON = 3¶
- DENDRITE = 1¶
- SOMA = 0¶
- add(name, length, n_segments, **params)¶
Creates a new section as a child of the current section
- add_axon(name, length, n_segments, **params)¶
Creates the first section of an axon
- add_dendrite(name, length, n_segments, apical=False, **params)¶
Creates the first section of a dendrite
- append(name, length, n_segments, **params)¶
Creates a new section as a child and returns it
- append_axon(name, length, n_segments, **params)¶
Creates the first section of an axon
- append_dendrite(name, length, n_segments, apical=False, **params)¶
Creates the first section of an axon
- attach(*nodes)¶
Adds the given sections as children of the current
- chain(*nodes)¶
Chain given nodes in parent-child relations, and make it child of the current
- create()¶
Builds the cell the current section belongs to. If no root is found (e.g. disconnected branch) an exception is raised
- get_root()¶
Finds the root section by crawling parents up
- set_parent(parent)¶
Sets the parent of the given section
- classmethod add_soma(diam, name='soma', **params)¶
- add_synapse(src_seg: Neuron.nrn.Segment, target_seg: Neuron.nrn.Segment, syn_props_obj: object, **conn_options: dict) object ¶
Adds an incoming synapse from another cell, according to the options.
- add_synaptic_receptor(target_seg, syn_props_obj, **custom)¶
Creates a raw neuron Synapse
- property all¶
- property apical_dendrites¶
- property axons¶
- property builder¶
Returns the Section builder object, to build additional axon/dendrites
- connect_to(synapse_receptor, threshold=None, delay=None, weight=None)¶
Creates a synapse between the current cell soma extremity and a given synapse receptor Notes: This is a relatively low-level f, there is no automatic registration of the netcon
- property dendrites¶
- init_soma(diam, name='soma', **params)¶
Creates a soma and returns the section builder NOTE: you must call create at the end so that the new sections are added to the cell
- load_morphology(morpho_path, export_commands=False)¶
Creates the cell compartments according to the given morphology
- section_info(section)¶
- static show_topology()¶
- property soma¶
neurodamus.core.configuration¶
Runtime configuration
neurodamus.core.configuration¶
- class neurodamus.core.configuration.CircuitConfig(opt_dict=None, **opts)¶
- CellLibraryFile = None¶
- CircuitPath = <neurodamus.utils.pyutils.ConfigT._ConfigFlag object>¶
- CircuitTarget = None¶
- DetailedAxon = False¶
- Engine = None¶
- MEComboInfoFile = None¶
- METypePath = None¶
- MorphologyPath = None¶
- MorphologyType = None¶
- PopulationID = 0¶
- nrnPath = <neurodamus.utils.pyutils.ConfigT._ConfigFlag object>¶
- class neurodamus.core.configuration.CliOptions(opt_dict=None, **opts)¶
- NoRestriction = <neurodamus.core.configuration.CliOptions.NoRestriction object>¶
- build_model = None¶
- dry_run = False¶
- enable_coord_mapping = False¶
- enable_shm = False¶
- experimental_stims = False¶
- keep_build = False¶
- lb_mode = None¶
- model_path = None¶
- model_stats = False¶
- modelbuilding_steps = None¶
- num_target_ranks = None¶
- output_path = None¶
- restore = None¶
- restrict_connectivity = 0¶
- restrict_features = <neurodamus.core.configuration.CliOptions.NoRestriction object>¶
- restrict_node_populations = <neurodamus.core.configuration.CliOptions.NoRestriction object>¶
- restrict_stimulus = <neurodamus.core.configuration.CliOptions.NoRestriction object>¶
- save = False¶
- save_time = None¶
- simulate_model = True¶
- simulator = None¶
- exception neurodamus.core.configuration.ConfigurationError¶
Error due to invalid settings in simulation config ConfigurationError should be raised by all ranks to be caught properly. Otherwise we might end up with deadlocks. For Exceptions that are raised by a single rank Exception should be used. This is due to the way Exceptions are caught from commands.py.
- neurodamus.core.configuration.EXCEPTION_NODE_FILENAME = '.exception_node'¶
A file which controls which rank shows exception
- class neurodamus.core.configuration.Feature(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
- LoadBalance = 5¶
- Replay = 1¶
- SpontMinis = 2¶
- Stimulus = 4¶
- SynConfigure = 3¶
- class neurodamus.core.configuration.GlobalConfig¶
- debug_conn = []¶
- classmethod set_mpi()¶
- verbosity = 1¶
- class neurodamus.core.configuration.LoadBalanceMode(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
An enumeration, inc parser, of the load balance modes.
- AutoBalanceModeParams = <class 'neurodamus.core.configuration.LoadBalanceMode.AutoBalanceModeParams'>¶
- Memory = 3¶
- MultiSplit = 2¶
- RoundRobin = 0¶
- WholeCell = 1¶
- classmethod auto_select(use_neuron, cell_count, duration, auto_params=<class 'neurodamus.core.configuration.LoadBalanceMode.AutoBalanceModeParams'>)¶
Simple heuristics for auto selecting load balance
- classmethod parse(lb_mode)¶
Parses the load balancing mode from a string. Options other than WholeCell or MultiSplit are considered RR
- class neurodamus.core.configuration.NeuronStdrunDefaults¶
Neuron stdrun default (src: share/lib/hoc/stdrun.hoc
- global_ra = 35.4¶
- nstep_steprun = 1¶
- realtime = 0¶
- stdrun_quiet = 0¶
- steps_per_ms = 40.0¶
- stoprun = 0¶
- tstop = 5¶
- using_cvode_ = 0¶
- v_init = -65¶
- class neurodamus.core.configuration.RNGConfig(opt_dict=None, **opts)¶
- IonChannelSeed = None¶
- MinisSeed = None¶
- Modes¶
alias of
Mode
- StimulusSeed = None¶
- SynapseSeed = None¶
- global_seed = None¶
- mode = 1¶
- neurodamus.core.configuration.check_connections_configure(SimConfig, target_manager)¶
Check connection block configuration and raise warnings for: 1. Global variable should be set in the Conditions block, 2. Connection overriding chains (t=0) 3. Connections with Weight=0 not overridden by delayed (not instantiated) 4. Partial Connection overriding -> Error 5. Connections with delay > 0 not overriding anything
- neurodamus.core.configuration.find_input_file(filepath, search_paths=(), alt_filename=None)¶
Determine the full path of input files.
Relative paths are built from Run configuration entries, and never pwd. In case filepath points to a file, alt_filename is disregarded
- Parameters:
filepath – The relative or absolute path of the file to find
path_conf_entries – (tuple) Run configuration entries to build the absolute path
alt_filename – When the filepath is a directory, attempt finding a given filename
- Returns:
The absolute path to the data file
- Raises:
(ConfigurationError) If the file could not be found –
- neurodamus.core.configuration.get_debug_cell_gid(cli_options)¶
neurodamus.core.mechanisms¶
Module defining cell mechanisms
- class neurodamus.core.mechanisms.HH(**opts)¶
- el = None¶
- gkbar = None¶
- gl = None¶
- gnabar = None¶
- h = None¶
- ik = None¶
- ina = None¶
- m = None¶
- n = None¶
neurodamus.core.random¶
Py Wrappers for the HOC RNGs
- class neurodamus.core.random.ACG(size=None, seed=None)¶
- class neurodamus.core.random.MCellRan4(high_i, seed=None, low_i=0)¶
- class neurodamus.core.random.RNG(*ids, **kw)¶
- class neurodamus.core.random.Random123(id1, id2, id3, seed=None)¶
- neurodamus.core.random.gamma(rng, a, b, N=1)¶
Sample N variates from a gamma distribution with parameters shape = a, scale = b using the NEURON random number generator rng. Uses the algorithm by Marsaglia and Tsang 2001.
neurodamus.core.stimuli¶
Stimuli sources. inc current and conductance sources which can be attached to cells
- class neurodamus.core.stimuli.ConductanceSource(reversal=0.0, *, delay=0.0, rng=None)¶
- attach_to(section, position=0.5)¶
- class neurodamus.core.stimuli.CurrentSource(base_amp=0.0, *, delay=0, rng=None)¶
- class Constant(amp, duration, delay=0)¶
Class implementing a minimal IClamp for a Constant current.
- attach_to(section, position=0.5)¶
- attach_to(section, position=0.5)¶
- class neurodamus.core.stimuli.SignalSource(base_amp=0.0, *, delay=0, rng=None)¶
- add_noise(mean, variance, duration, dt=0.5)¶
Adds a noise component to the signal.
- add_ornstein_uhlenbeck(tau, sigma, mean, duration, dt=0.25)¶
Adds an Ornstein-Uhlenbeck process with given correlation time, standard deviation and mean value.
tau: correlation time [ms], white noise if zero sigma: standard deviation [uS] mean: mean value [uS] duration: duration of signal [ms] dt: timestep [ms]
- add_pulse(max_amp, duration, **kw)¶
Adds a pulse.
A pulse is characterized by raising from a base amplitude, for a certain duration.
- add_pulses(pulse_duration, amp, *more_amps, **kw)¶
- Appends a set of pulsed signals without returning to zero
Each pulse is applied ‘dur’ time.
- Parameters:
pulse_duration – The duration of each pulse
amp – The amplitude of the first pulse
*more_amps – 2nd, 3rd, … pulse amplitudes
**kw – Additional params: - base_amp [default: 0]
- add_ramp(amp1, amp2, duration, **kw)¶
Adds a ramp.
A ramp is characterized by a pulse whose peak changes uniformly during its length. Neuron automatically interpolates all values between [t0, t1] as a ramp
- add_segment(amp, duration, amp2=None)¶
Sets a linear signal for a certain duration.
If amp2 is None (default) then we have constant signal
- add_shot_noise(tau_D, tau_R, rate, amp_mean, amp_var, duration, dt=0.25)¶
Adds a Poisson shot noise signal with gamma-distributed amplitudes and bi-exponential impulse response.
tau_D: bi-exponential decay time [ms] tau_R: bi-exponential rise time [ms] rate: Poisson event rate [Hz] amp_mean: mean of gamma-distributed amplitudes [nA] amp_var: variance of gamma-distributed amplitudes [nA^2] duration: duration of signal [ms] dt: timestep [ms]
- add_sin(amp, total_duration, freq, step=0.025, **kw)¶
Builds a sinusoidal signal. :param amp: The max amplitude of the wave :param total_duration: Total duration, in ms :param freq: The wave frequency, in Hz :param step: The step, in ms (default: 0.025)
- add_sinspec(start, dur)¶
- add_train(amp, frequency, pulse_duration, total_duration, **kw)¶
Stimulus with repeated pulse injections at a specified frequency.
- Parameters:
amp – the amplitude of a each pulse
frequency – determines the number of pulses per second (hz)
pulse_duration – the duration of a single pulse (peak time) (ms)
total_duration – duration of the whole train (ms)
base_amp – The base amplitude
- delay(duration)¶
Increments the ref time so that the next created signal is delayed
- classmethod noise(mean, variance, duration, dt=0.5, base_amp=0.0, **kw)¶
- classmethod ornstein_uhlenbeck(tau, sigma, mean, duration, dt=0.25, base_amp=0.0, **kw)¶
- plot(ylims=None)¶
- classmethod pulse(max_amp, duration, base_amp=0.0, **kw)¶
- classmethod ramp(amp1, amp2, duration, base_amp=0.0, **kw)¶
- reset()¶
- classmethod shot_noise(tau_D, tau_R, rate, amp_mean, var, duration, dt=0.25, base_amp=0.0, **kw)¶
- classmethod sin(amp, total_duration, freq, step=0.025, base_amp=0.0, **kw)¶
- classmethod train(amp, frequency, pulse_duration, total_duration, base_amp=0.0, **kw)¶
neurodamus.core.synapses¶
High-Level wrapper to Neuron’s cell synapse mechanisms
Classes
|
|
|
|
|
|
|
Uses Neuron NetStim to create an artificial spike source |
|
- class neurodamus.core.synapses.AlphaSynapse(segment=None, **properties)¶
- gmax = None¶
- onset = None¶
- tau = None¶
- class neurodamus.core.synapses.CellSynapse(segment=None, **properties)¶
- get_netcon_conf()¶
- get_synpase_conf()¶
- neurodamus.core.synapses.NetStim¶
alias of
VirtualSpikeSource
- class neurodamus.core.synapses.VirtualSpikeSource(interval=None, number=None, start=None, noise=None, manage_objs=True)¶
Uses Neuron NetStim to create an artificial spike source
- connect_to(synapse_receptor, weight=None, threshold=None, delay=None)¶
Creates a synapse connection
- interval = None¶
- noise = None¶
- number = None¶
- start = None¶