e_model_packager.sscx2020.workflow

Workflow to build SSCX e-model packages.

Classes

CollectMEModels(*args, **kwargs)

Submits the model package preparation tasks.

CreateFactsheets(*args, **kwargs)

Task to create a me-type factsheet json file.

CreateHoc(*args, **kwargs)

Task to create the hoc file of an emodel.

CreateNWB(*args, **kwargs)

Applies the protocols and saves the results in an NWB.

DoRecordings(*args, **kwargs)

Launch both RunHoc and RunPyScript.

MemodelParameters(*args, **kwargs)

Parameter class to contain common MeModel parameters across various tasks.

PrepareMEModelDirectory(*args, **kwargs)

Task to prepare the e-model directory.

RunHoc(*args, **kwargs)

Task to run the hoc files for an emodel.

RunPyScript(*args, **kwargs)

Task to run the python script for an emodel.

RunScriptMixin()

Class with a function to easily get the output targets from runs.

SSCX2020(*args, **kwargs)

The skeleton task to perform the workflow.

class CollectMEModels(*args, **kwargs)

Bases: WrapperTask

Submits the model package preparation tasks.

requires()

The required Tasks.

class CreateFactsheets(*args, **kwargs)

Bases: MemodelParameters

Task to create a me-type factsheet json file.

output()

The JSON output.

requires()

Requires the script to have been copied in the main output directory.

run()

Creates the me-type json file.

class CreateHoc(*args, **kwargs)

Bases: MemodelParameters

Task to create the hoc file of an emodel.

configfile

name of config file in /config to use when creating hoc

output()

Produces the hoc file.

property output_folder

Returns the path to the outputs directory.

requires()

Requires the output paths to be made.

run()

Creates the hoc script.

class CreateNWB(*args, **kwargs)

Bases: MemodelParameters

Applies the protocols and saves the results in an NWB.

configfile

name of emodel config file containing protocol info.

property emodel_name

Emodel name in cells standard.

property memodel_dir

Directory containing the memodel.

output()

NWB output.

requires()

Requires the output paths to be made.

run()

Creates and saves the nwb containing protocol responses.

class DoRecordings(*args, **kwargs)

Bases: MemodelParameters

Launch both RunHoc and RunPyScript.

configfile

name of config file in /config to use when running script / creating hoc

requires()

Launch both RunHoc and RunPyScript.

class MemodelParameters(*args, **kwargs)

Bases: SmartTask

Parameter class to contain common MeModel parameters across various tasks.

Luigi design pattern to address the parameter explosion problem. Reference https://luigi.readthedocs.io/en/stable/api/luigi.util.html

mtype

morphological type

etype

electrophysiological type

region

circuit region

gid

id of cell in the circuit

gidx

index of cell

class PrepareMEModelDirectory(*args, **kwargs)

Bases: MemodelParameters

Task to prepare the e-model directory.

static add_recipe_data_to_config(output_config_dir, params_path, features_path, protocol_path, mtype_from_recipe)

Add params, features and protocol paths and mtype to config files.

copy_config(output_dir, emodel)

Copy config files into output directory.

static copy_config_data(input_dir, output_dir, emodel, params_path, features_path, protocol_path)

Copy params, features and recipes from config.

static copy_config_files(input_dir, output_config_dir)

Copy the .ini config files into output config directory.

copy_mechanisms()

Copy mechanisms into output directory.

static copy_morph(morph_fname, circ_morph_dir, memodel_morph_dir)

Copy morphology.

static copy_protocol_files(input_dir, output_config_dir)

Copy the protocol files into output config protocol directory.

copy_scripts()

Copy scripts.

static copy_templates(output_dir)

Copy mechanisms into output directory.

static fill_in_config_default_values(config_dict)

Fill in config dict with default values.

Parameters:

config_dict (dict) – the configuration dictionary

fill_in_emodel_config(emodel, morph_fname, apical_point_isec)

Fill in emodel config.

Args: emodel(str): emodel name. morph_fname(str): morphology filename. apical_point_isec(int): section index of the apical point.

fill_in_step_protocols(threshold, holding)

Fill in emodel config.

Args: threshold(float): threshold current. holding(float): holding current.

static get_apical_point_isec(apical_dir, morphology_fname)

Return the index of the section of the apical point.

makedirs(memodel_morph_dir, synapses_dir)

Make directories.

output()

Produces an empty file after all steps are done.

property output_folder

The directory containing the output files.

run()

Create me-model directories.

write_cell_info(morphology, layer, output_dir)

Create cell_info.json file and write it.

class RunHoc(*args, **kwargs)

Bases: MemodelParameters, RunScriptMixin

Task to run the hoc files for an emodel.

configfile

name of config file in /config to use when creating hoc

output()

Produces the hoc recordings.

property output_path

Directory containing the output.

requires()

Requires the hoc file to have been created.

run()

Executes the hoc script.

class RunPyScript(*args, **kwargs)

Bases: MemodelParameters, RunScriptMixin

Task to run the python script for an emodel.

configfile

name of config file in /config to use when running script

output()

Produces the python recordings.

property output_path

Directory containing the output.

requires()

Requires the output paths to be made.

run()

Executes the python script.

class RunScriptMixin

Bases: object

Class with a function to easily get the output targets from runs.

get_output_targets_from_run()

Get output targets for a python or hoc run.

class SSCX2020(*args, **kwargs)

Bases: WrapperTask

The skeleton task to perform the workflow.

requires()

The required Tasks.