bluepyemodel.evaluation.protocols

Module with protocol classes.

Classes

BPEMProtocol([name, stimulus, recordings, ...])

Base protocol

NoHoldingCurrent(name[, output_key])

Empty class returning a holding current of zero.

ProtocolRunner(protocols[, name])

Meta-protocol in charge of running the other protocols in the correct order

ProtocolWithDependencies([dependencies, ...])

To add to a protocol to specify that it depends on the responses of other protocols

RMPProtocol(name, location, target_voltage)

Protocol consisting of a step of amplitude zero

ResponseDependencies([dependencies])

To add to a protocol to specify that it depends on the responses of other protocols

RinProtocol(name, location, target_rin[, ...])

Protocol used to find the input resistance of a model

SearchHoldingCurrent(name, location[, ...])

Protocol used to find the holding current of a model

SearchThresholdCurrent(name, location[, ...])

Protocol used to find the threshold current (rheobase) of a model

ThresholdBasedProtocol([name, stimulus, ...])

Protocol having rheobase-rescaling capabilities.

class BPEMProtocol(name=None, stimulus=None, recordings=None, cvode_active=None, stochasticity=False)

Bases: SweepProtocol

Base protocol

Constructor

Parameters:
  • name (str) – name of this object

  • stimulus (Stimulus) – stimulus objects

  • recordings (list of Recordings) – Recording objects used in the protocol

  • cvode_active (bool) – whether to use variable time step

  • stochasticity (bool) – turns on or off the channels that can be stochastic

instantiate(sim=None, cell_model=None)

Check recordings, then instantiate.

run(cell_model, param_values=None, sim=None, isolate=None, timeout=None, responses=None)

Run protocol

stim_start()

Time stimulus starts

class NoHoldingCurrent(name, output_key='bpo_holding_current')

Bases: Protocol

Empty class returning a holding current of zero.

Constructor.

class ProtocolRunner(protocols, name='ProtocolRunner')

Bases: Protocol

Meta-protocol in charge of running the other protocols in the correct order

Initialize the protocol runner

Parameters:
  • protocols (dict) – Dictionary of protocols to run

  • name (str) – Name of the current protocol runner

compute_execution_order()

Compute the execution order of the protocols by taking into account their dependencies

run(cell_model, param_values, sim=None, isolate=None, timeout=None)

Run protocol

class ProtocolWithDependencies(dependencies=None, name=None, stimulus=None, recordings=None, cvode_active=None, stochasticity=False)

Bases: BPEMProtocol, ResponseDependencies

To add to a protocol to specify that it depends on the responses of other protocols

Constructor

Parameters:

dependencies (dict) – dictionary of dependencies of the form {self_attribute_name: [protocol_name, response_name]}.

class RMPProtocol(name, location, target_voltage, stimulus_duration=500.0, output_key='bpo_rmp')

Bases: BPEMProtocol

Protocol consisting of a step of amplitude zero

Constructor

run(cell_model, param_values=None, sim=None, isolate=None, timeout=None, responses=None)

Compute the RMP

class ResponseDependencies(dependencies=None)

Bases: object

To add to a protocol to specify that it depends on the responses of other protocols

Constructor

Parameters:

dependencies (dict) – dictionary of dependencies of the form {self_attribute_name: [protocol_name, response_name]}.

run(cell_model, param_values=None, sim=None, isolate=None, timeout=None, responses=None)

Run protocol

set_attribute(attribute, value)

Set an attribute of the class based on the name of the attribute. Also handles the case where the name is of the form: attribute.sub_attribute

class RinProtocol(name, location, target_rin, amp=-0.02, stimulus_delay=500.0, stimulus_duration=500.0, totduration=1000.0, output_key='bpo_rin', hold_key='bpo_holding_current', hold_prot_name='SearchHoldingCurrent')

Bases: ProtocolWithDependencies

Protocol used to find the input resistance of a model

Constructor

run(cell_model, param_values=None, sim=None, isolate=None, timeout=None, responses=None)

Compute the Rin

class SearchHoldingCurrent(name, location, target_voltage=None, voltage_precision=0.1, stimulus_duration=500.0, upper_bound=0.2, lower_bound=-0.2, strict_bounds=True, max_depth=7, no_spikes=True, output_key='bpo_holding_current')

Bases: BPEMProtocol

Protocol used to find the holding current of a model

Constructor

Parameters:
  • name (str) – name of this object

  • location (Location) – location on which to perform the search ( usually the soma).

  • target_voltage (EFeature) – target for the voltage at holding_current

  • voltage_precision (float) – accuracy for holding voltage, in mV, to stop the search

  • stimulus_duration (float) – length of the protocol

  • upper_bound (float) – upper bound for the holding current, in pA

  • lower_bound (float) – lower bound for the holding current, in pA

  • strict_bounds (bool) – to adaptively enlarge bounds if current is outside

  • max_depth (int) – maximum depth for the binary search

  • no_spikes (bool) – if True, the holding current will only be considered valid if there are no spikes at holding.

Do bisection search to find holding current

get_voltage_base(holding_current, cell_model, param_values, sim, isolate, timeout=None)

Calculate voltage base for a certain holding current

run(cell_model, param_values=None, sim=None, isolate=None, timeout=None, responses=None)

Run protocol

class SearchThresholdCurrent(name, location, target_threshold=None, current_precision=0.01, stimulus_delay=500.0, stimulus_duration=2000.0, stimulus_totduration=3000.0, max_threshold_voltage=-30, spikecount_timeout=50, max_depth=10, no_spikes=True, efel_threshold=None, output_key='bpo_threshold_current', hold_key='bpo_holding_current', rmp_key='bpo_rmp', rin_key='bpo_rin', hold_prot_name='SearchHoldingCurrent', rmp_prot_name='RMPProtocol', rin_prot_name='RinProtocol')

Bases: ProtocolWithDependencies

Protocol used to find the threshold current (rheobase) of a model

Constructor.

Parameters:
  • name (str) – name of this object

  • location (Location) – location on which to perform the search ( usually the soma).

  • target_threshold (Efeature) – target for the threshold_current

  • current_precision (float) – size of search interval in current to stop the search

  • stimulus_delay (float) – delay before the beginning of the step used to create the protocol

  • stimulus_duration (float) – duration of the step used to create the protocol

  • stimulus_totduration (float) – total duration of the protocol

  • max_threshold_voltage (float) – maximum voltage used as upper bound in the threshold current search

  • spikecount_timeout (float) – timeout for spikecount computation, if timeout is reached, we set spikecount=2 as if many spikes were present, to speed up bisection search.

  • max_depth (int) – maximum depth for the binary search

  • no_spikes (bool) – if True, will check that the holding current (lower bound) does not trigger spikes.

  • efel_threshold – spike threshold for the efel settings. Set to None to keep the default value (currently -20 mV in efel)

Do bisection search to find threshold current.

define_search_bounds(cell_model, param_values, sim, isolate, responses)

Define the bounds and check their validity

max_threshold_current()

Find the current necessary to get to max_threshold_voltage

run(cell_model, param_values=None, sim=None, isolate=None, timeout=None, responses=None)

Run protocol

class ThresholdBasedProtocol(name=None, stimulus=None, recordings=None, cvode_active=None, stochasticity=False, hold_key='bpo_holding_current', thres_key='bpo_threshold_current', hold_prot_name='SearchHoldingCurrent', thres_prot_name='SearchThresholdCurrent')

Bases: ProtocolWithDependencies

Protocol having rheobase-rescaling capabilities. When using ThresholdBasedProtocol, the holding current amplitude and step amplitude of the stimulus will be ignored and replaced by values obtained from the holding current and rheobase of the cell model respectively.

Constructor

run(cell_model, param_values=None, sim=None, isolate=None, timeout=None, responses=None)

Run protocol