emodelrunner.load

Functions mainly for loading params for run.py.

Functions

get_release_params(config[, precell])

Return the final parameters.

get_rin_exp_voltage_base(features_path)

Get experimental rin voltage base from feature file when having MainProtocol.

get_syn_setup_params(syn_extra_params_path, ...)

Load json files and return syn_setup_params dict.

load_config(config_path)

Returns the validated configuration file.

load_emodel_params(emodel, params_path)

Get optimized parameters.

load_mechanisms(mechs_path)

Define mechanisms.

load_syn_mechs(seed, rng_settings_mode, ...)

Load synapse mechanisms.

load_synapse_configuration_data(synconf_path)

Load synapse configuration data into dict[command]=list(ids).

load_synapses_tsv_data(tsv_path)

Load synapse data from tsv.

load_unoptimized_parameters(params_path, ...)

Load unoptimized parameters as BluePyOpt parameters.

emodelrunner.load.get_release_params(config, precell=False)[source]

Return the final parameters.

Parameters:
  • config (configparser.ConfigParser) – configuration

  • precell (bool) – True to load precell optimized parameters. False to get usual parameters.

Returns:

optimized parameters

Return type:

dict

emodelrunner.load.get_rin_exp_voltage_base(features_path)[source]

Get experimental rin voltage base from feature file when having MainProtocol.

emodelrunner.load.get_syn_setup_params(syn_extra_params_path, cpre_cpost_path, fit_params_path, gid, invivo)[source]

Load json files and return syn_setup_params dict.

Parameters:
  • syn_extra_params_path (str) – path to the glusynapses related extra parameters file

  • cpre_cpost_path (str) – path to the c_pre and c_post related file c_pre (resp. c_post) is the calcium amplitude during isolated presynaptic (resp. postsynaptic) activation

  • fit_params_path (str) – path to the file containing the glusynapse fitted parameters The fitted parameters are time constant of calcium integrator, depression rate, potentiation rate, and factors used in plasticity threshold computation.

  • gid (int) – ID of the postsynaptic cell

  • invivo (bool) – whether to run the simulation in ‘in vivo’ conditions

Returns:

glusynapse setup related parameters

Return type:

dict

emodelrunner.load.load_config(config_path)[source]

Returns the validated configuration file.

Parameters:

config_path (str or Path) – path to the configuration file.

Returns:

loaded config object

Return type:

configparser.ConfigParser

emodelrunner.load.load_emodel_params(emodel, params_path)[source]

Get optimized parameters.

Parameters:
  • emodel (str) – name of the emodel

  • params_path (str) – path to the optimized parameters json file

Returns:

optimized parameters for the given emodel

Return type:

dict

emodelrunner.load.load_mechanisms(mechs_path)[source]

Define mechanisms.

Parameters:

mechs_path (str) – path to the unoptimized parameters json file

Returns:

list of ephys.mechanisms.NrnMODMechanism from file

emodelrunner.load.load_syn_mechs(seed, rng_settings_mode, syn_data_path, syn_conf_path, pre_mtypes=None, stim_params=None, use_glu_synapse=False, syn_setup_params=None)[source]

Load synapse mechanisms.

Parameters:
  • seed (int) – random number generator seed number

  • rng_settings_mode (str) – mode of the random number generator Can be “Random123” or “Compatibility”

  • syn_data_path (str) – path to the (tsv) synapses data file

  • syn_conf_path (str) – path to the synapse configuration data file

  • pre_mtypes (list of ints) – activate only synapses whose pre_mtype is in this list. if None, all synapses are activated

  • stim_params (dict or None) – dict with pre_mtype as key, and netstim params list as item. netstim params list is [start, interval, number, noise]

  • use_glu_synapse (bool) – if True, instantiate synapses to use GluSynapse

  • syn_setup_params (dict) – contains extra parameters to setup synapses when using GluSynapseCustom

Returns:

the synapses mechanisms

Return type:

NrnMODPointProcessMechanismCustom

emodelrunner.load.load_synapse_configuration_data(synconf_path)[source]

Load synapse configuration data into dict[command]=list(ids).

Parameters:

synconf_path (str) – path to the synapse configuration data file

Returns:

configuration data

each key contains a command to execute using hoc, and each value contains a list of synapse id on which to execute the command

Return type:

dict

emodelrunner.load.load_synapses_tsv_data(tsv_path)[source]

Load synapse data from tsv.

Parameters:

tsv_path (str) – path to the tsv synapses data file

Returns:

list of dicts containing each data for one synapse

emodelrunner.load.load_unoptimized_parameters(params_path, v_init, celsius)[source]

Load unoptimized parameters as BluePyOpt parameters.

Parameters:
  • params_path (str) – path to the json file containing the non-optimised parameters

  • v_init (int) – initial voltage (mV). Will override v_init value from parameter file

  • celsius (int) – cell temperature in celsius. Will override celsius value from parameter file

Returns:

list of parameters