emodelrunner.protocols.reader

Protocol reading functions.

Functions

read_netstim_protocol(protocol_name, ...)

Read Netstim protocol from definitions.

read_ramp_protocol(protocol_name, ...)

Read ramp protocol from definition.

read_ramp_threshold_protocol(protocol_name, ...)

Read ramp threshold protocol from definition.

read_step_protocol(protocol_name, ...[, ...])

Read step protocol from definition.

read_step_threshold_protocol(protocol_name, ...)

Read step threshold protocol from definition.

read_vecstim_protocol(protocol_name, ...)

Read Vecstim protocol from definitions.

Classes

ProtocolParser()

Parses the protocol json file.

class emodelrunner.protocols.reader.ProtocolParser[source]

Bases: object

Parses the protocol json file.

static load_protocol_json(protocols_filepath)[source]

Loads the protocol json file.

Parameters

protocols_filepath (str or Path) – path to the protocols file.

Returns

dict containing protocols json input.

Return type

dict

parse_sscx_protocols(protocols_filepath, stochkv_det=None, prefix='', apical_point_isec=-1, syn_locs=None)[source]

Parses the SSCX protocols from the json file input.

Parameters
  • protocols_filename (str) – path to the protocols file

  • stochkv_det (bool) – set if stochastic or deterministic

  • prefix (str) – prefix used in naming responses, features, recordings, etc.

  • apical_point_isec (int) – apical point section index Should be given if there is “somadistanceapic” in “type” of at least one of the extra recordings

  • syn_locs (list of ephys.locations.NrnPointProcessLocation) – locations of the synapses (if any, else None)

Returns

dict containing the protocols

parse_thalamus_protocols(protocols_filepath, stochkv_det=None, prefix='')[source]

Parses the Thalamus protocols from the json file input.

Parameters
  • protocols_filename (str) – path to the protocols file

  • stochkv_det (bool) – set if stochastic or deterministic

  • prefix (str) – prefix used in naming responses, features, recordings, etc.

Returns

dict containing the protocols

emodelrunner.protocols.reader.read_netstim_protocol(protocol_name, protocol_definition, recordings, syn_locs)[source]

Read Netstim protocol from definitions.

Parameters
  • protocol_name (str) – name of the protocol

  • protocol_definition (dict) – dict containing the protocol data

  • recordings (bluepyopt.ephys.recordings.CompRecording) – recordings to use with this protocol

  • syn_locs (list of ephys.locations.NrnPointProcessLocation) – locations of the synapses

Returns

a protocol containing Netstim stimulus activating synapses

Return type

emodelrunner.protocols.SweepProtocolCustom

emodelrunner.protocols.reader.read_ramp_protocol(protocol_name, protocol_definition, recordings)[source]

Read ramp protocol from definition.

Parameters
  • protocol_name (str) – name of the protocol

  • protocol_definition (dict) – contains the protocol configuration data

  • recordings (bluepyopt.ephys.recordings.CompRecording) – recordings to use with this protocol

Returns

Ramp Protocol

Return type

RampProtocol

emodelrunner.protocols.reader.read_ramp_threshold_protocol(protocol_name, protocol_definition, recordings)[source]

Read ramp threshold protocol from definition.

Parameters
  • protocol_name (str) – name of the protocol

  • protocol_definition (dict) – contains the protocol configuration data

  • recordings (bluepyopt.ephys.recordings.CompRecording) – recordings to use with this protocol

Returns

Ramp Protocol depending on cell’s threshold current

Return type

RampThresholdProtocol

emodelrunner.protocols.reader.read_step_protocol(protocol_name, protocol_module, protocol_definition, recordings, stochkv_det=None)[source]

Read step protocol from definition.

Parameters
  • protocol_name (str) – name of the protocol

  • protocol_module (module) – module that contains the protocol

  • protocol_definition (dict) – contains the protocol configuration data

  • recordings (bluepyopt.ephys.recordings.CompRecording) – recordings to use with this protocol

  • protocol_cls (module) – module that contains the protocol

  • stochkv_det (bool) – set if stochastic or deterministic

Returns

Step Protocol

Return type

sscx_protocols.StepProtocol or thalamus_protocols.StepProtocolCustom

emodelrunner.protocols.reader.read_step_threshold_protocol(protocol_name, protocol_module, protocol_definition, recordings, stochkv_det=None)[source]

Read step threshold protocol from definition.

Parameters
  • protocol_name (str) – name of the protocol

  • protocol_module (module) – module that contains the protocol

  • protocol_definition (dict) – contains the protocol configuration data

  • recordings (bluepyopt.ephys.recordings.CompRecording) – recordings to use with this protocol

  • stochkv_det (bool) – set if stochastic or deterministic

Returns

sscx_protocols.StepThresholdProtocol

or thalamus_protocols.StepThresholdProtocol: StepProtocol with cell’s threshold current

emodelrunner.protocols.reader.read_vecstim_protocol(protocol_name, protocol_definition, recordings, syn_locs)[source]

Read Vecstim protocol from definitions.

Parameters
  • protocol_name (str) – name of the protocol

  • protocol_definition (dict) – dict containing the protocol data

  • recordings (bluepyopt.ephys.recordings.CompRecording) – recordings to use with this protocol

  • syn_locs (list of ephys.locations.NrnPointProcessLocation) – locations of the synapses

Returns

a protocol containing Vecstim stimulus activating synapses

Return type

emodelrunner.protocols.SweepProtocolCustom