bluepyemodel.evaluation.protocols¶
Module with protocol classes.
Classes
|
Base protocol |
|
Empty class returning a holding current of zero. |
|
Meta-protocol in charge of running the other protocols in the correct order |
|
To add to a protocol to specify that it depends on the responses of other protocols |
|
Protocol consisting of a step of amplitude zero |
|
To add to a protocol to specify that it depends on the responses of other protocols |
|
Protocol used to find the input resistance of a model |
|
Protocol used to find the holding current of a model |
|
Protocol used to find the threshold current (rheobase) of a model |
|
Protocol having rheobase-rescaling capabilities. |
- class BPEMProtocol(name=None, stimulus=None, recordings=None, cvode_active=None, stochasticity=False)¶
Bases:
SweepProtocolBase protocol
Constructor
- Parameters:
- 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:
ProtocolEmpty class returning a holding current of zero.
Constructor.
- class ProtocolRunner(protocols, name='ProtocolRunner')¶
Bases:
ProtocolMeta-protocol in charge of running the other protocols in the correct order
Initialize the protocol runner
- Parameters:
- 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,ResponseDependenciesTo 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:
BPEMProtocolProtocol 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:
objectTo 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:
ProtocolWithDependenciesProtocol 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:
BPEMProtocolProtocol 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.
- bisection_search(cell_model, param_values, sim, isolate, upper_bound, lower_bound, timeout=None, depth=0)¶
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:
ProtocolWithDependenciesProtocol 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)
- bisection_search(cell_model, param_values, sim, isolate, upper_bound, lower_bound, timeout=None, depth=0)¶
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:
ProtocolWithDependenciesProtocol 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