emodelrunner.factsheets.ion_channel_mechanisms

To extract ion channel mechanisms information from static parameter files.

Functions

append_equation(location_map, section, ...)

Append equation to location map dict.

clean_location_map(location_map)

Remove empty locations.

edit_dist_func(value)

Edit function expression to be latex and plot readable.

get_channel_and_equations(name, ...)

Returns the channel and a dictionary containing equation type (uniform or exp) and value.

get_mechanisms_data(emodel, ...)

Return a dictionary containing channel mechanisms for each section.

emodelrunner.factsheets.ion_channel_mechanisms.append_equation(location_map, section, channel, biophys, equation_dict)[source]

Append equation to location map dict.

Parameters:
  • location_map (dict) – contains the equations for each channel at each location. To be filled by this function

  • section (str) – the section(s) to which the equations should be appended Can be “alldend”, “somadend”, “somaxon”, “allact”, “apical”, “basal”, “axonal” or “somatic”

  • channel (str) – name of the channel (ex: “Ca_HVA2”)

  • biophys (str) – parameter name (ex: “gCa_HVAbar”)

  • equation_dict (dict) – dictionary containing equation values (for plotting and latex display) and type (uniform or exponential)

emodelrunner.factsheets.ion_channel_mechanisms.clean_location_map(location_map)[source]

Remove empty locations.

Parameters:

location_map (dict) – contains the equations for each channel at each location

emodelrunner.factsheets.ion_channel_mechanisms.edit_dist_func(value)[source]

Edit function expression to be latex and plot readable.

Parameters:

value (str) – the distribution function expressed as a string. ex: “(-0.8696 + 2.087*math.exp((x)*0.0031))*3.1236056887012746e-06”

Returns:

a tuple containing

  • latex (str): a latex-compatible version of the distrib. function ex: “(-0.8696 + 2.087*e^{x*0.0031})*3.1236056887012746e-06”

  • value (str): a plottable version of the distrib. function ex: “(-0.8696 + 2.087exp(x*0.0031))*3.1236056887012746e-06”

emodelrunner.factsheets.ion_channel_mechanisms.get_channel_and_equations(name, param_config, full_name, exp_fun, decay_fun, release_params)[source]

Returns the channel and a dictionary containing equation type (uniform or exp) and value.

Parameters:
  • name (str) – the name of the ion channel and its parameter. should have the form parameter_channel (ex: “gCa_HVAbar_Ca_HVA2”)

  • param_config (dict) – parameter dictionary taken from parameter data file. should have a “dist” key if the distribution is exponential.

  • full_name (str) – should have the form name.section

  • exp_fun (str) – the distribution function expressed as a string. ex: “(-0.8696 + 2.087*math.exp((x)*0.0031))*3.1236056887012746e-06”

  • decay_fun (str) – the decay function expressed as a string.

  • release_params (dict) – final parameters of the optimised cell.

Returns:

a tuple containing

  • channel (str): name of the channel (ex: “Ca_HVA2”)

  • biophys (str): parameter name (ex: “gCa_HVAbar”)

  • equation_dict (dict): contains equation values and equation type (uniform or exp)

emodelrunner.factsheets.ion_channel_mechanisms.get_mechanisms_data(emodel, optimized_params_dict, unoptimized_params_dict)[source]

Return a dictionary containing channel mechanisms for each section.

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

  • optimized_params_dict (dict) – contains the optimized parameters

  • unoptimized_params_dict (dict) – contains the unoptimized parameters, and also contains the decay and exponential equations

Returns:

containing the channel mechanisms

Return type:

dict