bluecellulab.cell.injector

Contains injection functionality for the cell.

Classes

InjectableMixin()

Mixin responsible of injections to the cell.

class bluecellulab.cell.injector.InjectableMixin[source]

Mixin responsible of injections to the cell.

Important Usage Note: Adds the instantiated Neuron objects to

self.persistent to explicitly destroy them when their lifetime ends.

addSineCurrentInject(start_time, stop_time, freq, amplitude, mid_level, dt=1.0)[source]

Add a sinusoidal current injection.

Returns:

  • (numpy array, numpy array) (time and current data)

add_alpha_synapse(onset, tau, gmax, e, section, segx=0.5)[source]

Add an AlphaSynapse NEURON point process stimulus to the cell.

Parameters:
  • onset (float)

  • tau (float)

  • gmax (float)

  • e (float)

  • section (HocObject)

Return type:

HocObject

add_noise_step(section, segx, mean, variance, delay, duration, seed=None, noisestim_count=0)[source]

Inject a step current with noise on top.

add_ornstein_uhlenbeck(section, segx, stimulus, stim_count=0)[source]

Add an Ornstein-Uhlenbeck process, injected as current or conductance.

Parameters:

stimulus (OrnsteinUhlenbeck)

add_pulse(stimulus, section=None, segx=0.5)[source]

Inject pulse stimulus for replay.

Return type:

HocObject

add_ramp(start_time, stop_time, start_level, stop_level, section=None, segx=0.5)[source]

Add a ramp current injection.

Parameters:
  • start_time (float) – Start time of the ramp injection in seconds.

  • stop_time (float) – Stop time of the ramp injection in seconds.

  • start_level (float) – Current level at the start of the ramp in nanoamperes (nA).

  • stop_level (float) – Current level at the end of the ramp in nanoamperes (nA).

  • section (NeuronSection | None) – The section to inject current into (optional). Defaults to soma.

  • segx (float) – The fractional location within the section to inject (optional).

Return type:

TStim

Returns:

TStim NEURON object responsible of vectoral injection.

add_relative_ornstein_uhlenbeck(section, segx, stimulus, stim_count=0)[source]

Add an Ornstein-Uhlenbeck process, injected as current or conductance, relative to cell threshold current or inverse input resistance.

Parameters:

stimulus (RelativeOrnsteinUhlenbeck)

add_replay_hypamp(stimulus, section=None, segx=0.5)[source]

Inject hypamp for the replay.

Parameters:

stimulus (Hyperpolarizing)

add_replay_linear(stimulus, section=None, segx=0.5)[source]

Add a linear stimulus.

Parameters:

stimulus (Linear)

add_replay_noise(stimulus, noise_seed=None, noisestim_count=0, section=None, segx=0.5)[source]

Add a replay noise stimulus.

Parameters:

stimulus (Noise)

add_replay_relative_shotnoise(section, segx, stimulus, shotnoise_stim_count=0)[source]

Add a replay relative shot noise stimulus.

Parameters:

stimulus (RelativeShotNoise)

add_replay_relativelinear(stimulus, section=None, segx=0.5)[source]

Add a relative linear stimulus.

Parameters:

stimulus (RelativeLinear)

add_replay_shotnoise(section, segx, stimulus, shotnoise_stim_count=0)[source]

Add a replay shot noise stimulus.

Parameters:

stimulus (ShotNoise)

add_replay_subthreshold(stimulus, section=None, segx=0.5)[source]

Inject a current step at some percent below the cell’s threshold.

The injected amplitude is: threshold * (100 - percent_less) / 100 This matches the Neurodamus SubThreshold implementation.

Parameters:

stimulus (SubThreshold)

add_seclamp(stimulus, section=None, segx=0.5)[source]

Add a SEClamp stimulus.

add_sin_current(amp, start_time, duration, frequency, section=None, segx=0.5)[source]

Add a sinusoidal current to the cell.

add_sinusoidal(stimulus)[source]

Inject sinusoidal stimulus for replay.

Return type:

HocObject

add_step(start_time, stop_time, level, section=None, segx=0.5)[source]

Add a step current injection.

Parameters:
  • start_time (float) – Start time of the step injection in seconds.

  • stop_time (float) – Stop time of the step injection in seconds.

  • level (float) – Current level to inject in nanoamperes (nA).

  • section (NeuronSection | None) – The section to inject current into. Defaults to the soma section.

  • segx (float) – The fractional location within the section to inject. Defaults to 0.5 (center of the section).

Return type:

TStim

Returns:

TStim NEURON object responsible of vectoral injection.

add_voltage_clamp(stop_time, level, durations=None, levels=None, rs=None, section=None, segx=0.5, current_record_name=None, current_record_dt=None)[source]

Add a voltage clamp.

Parameters:
  • stop_time (float) – Time at which voltage clamp should stop

  • level (float) – Voltage level of the vc (in mV)

  • durations (list of float) – Durations of each step of the vc (in ms)

  • levels (list of float) – Voltage levels of the vc (in mV)

  • rs (float) – Series resistance of the vc (in MOhm)

  • section (NEURON object) – Object representing the section to place the vc

  • segx (float) – Segment x coordinate to place the vc

  • current_record_name (str) – Name of the recording that will store the current

  • current_record_dt (float) – Timestep to use for the recording of the current

Returns:

  • SEClamp (NEURON) object of the created vc

inject_current_clamp_signal(section, segx, tvec, svec)[source]

Inject any signal via current clamp.

inject_current_waveform(t_content, i_content, section=None, segx=0.5)[source]

Inject a custom current waveform into the cell.

inject_dynamic_clamp_signal(section, segx, tvec, svec, reversal)[source]

Injects any signal via a dynamic conductance clamp.

Parameters:

reversal (float) – reversal potential of conductance (mV)

relativity_proportion(stim_mode)[source]

Relativity proportion used in Relative stimuli e.g. relative shotnoise.

Parameters:

stim_mode (ClampMode)

Return type:

float