allensdk.model.biophysical package

Submodules

allensdk.model.biophysical.run_simulate module

class allensdk.model.biophysical.run_simulate.RunSimulate(input_json, output_json)[source]

Bases: object

load_manifest()[source]
nrnivmodl()[source]
simulate()[source]
allensdk.model.biophysical.run_simulate.main(command, lims_strategy_json, lims_response_json)[source]

Entry point for module. :param command: select behavior, nrnivmodl or simulate :type command: string :param lims_strategy_json: path to json file output from lims. :type lims_strategy_json: string :param lims_response_json: path to json file returned to lims. :type lims_response_json: string

allensdk.model.biophysical.runner module

allensdk.model.biophysical.runner.load_description(manifest_json_path)[source]

Read configuration file.

Parameters:

manifest_json_path : string

File containing the experiment configuration.

Returns:

Config

Object with all information needed to run the experiment.

allensdk.model.biophysical.runner.prepare_nwb_output(nwb_stimulus_path, nwb_result_path)[source]

Copy the stimulus file, zero out the recorded voltages and spike times.

Parameters:

nwb_stimulus_path : string

NWB file name

nwb_result_path : string

NWB file name

allensdk.model.biophysical.runner.run(description, sweeps=None, procs=6)[source]

Main function for simulating sweeps in a biophysical experiment.

Parameters:

description : Config

All information needed to run the experiment.

procs : int

number of sweeps to simulate simultaneously.

sweeps : list

list of experiment sweep numbers to simulate. If None, simulate all sweeps.

allensdk.model.biophysical.runner.run_sync(description, sweeps=None)[source]

Single-process main function for simulating sweeps in a biophysical experiment.

Parameters:

description : Config

All information needed to run the experiment.

sweeps : list

list of experiment sweep numbers to simulate. If None, simulate all sweeps.

allensdk.model.biophysical.runner.save_nwb(output_path, v, sweep, sweeps_by_type)[source]

Save a single voltage output result into an existing sweep in a NWB file. This is intended to overwrite a recorded trace with a simulated voltage.

Parameters:

output_path : string

file name of a pre-existing NWB file.

v : numpy array

voltage

sweep : integer

which entry to overwrite in the file.

allensdk.model.biophysical.utils module

class allensdk.model.biophysical.utils.AllActiveUtils(description)[source]

Bases: allensdk.model.biophysical.utils.Utils

generate_morphology(morph_filename)[source]

Load a neurolucida or swc-format cell morphology file.

Parameters:

morph_filename : string

Path to morphology.

load_cell_parameters()[source]

Configure a neuron after the cell morphology has been loaded.

class allensdk.model.biophysical.utils.Utils(description)[source]

Bases: allensdk.model.biophys_sim.neuron.hoc_utils.HocUtils

A helper class for NEURON functionality needed for biophysical simulations.

Attributes

h (object) The NEURON hoc object.
nrn (object) The NEURON python object.
neuron (module) The NEURON module.
generate_morphology(morph_filename)[source]

Load a swc-format cell morphology file.

Parameters:

morph_filename : string

Path to swc.

get_recorded_data(vec)[source]

Extract recorded voltages and timestamps given the recorded Vector instance. If self.stimulus_sampling_rate is smaller than self.simulation_sampling_rate, resample to self.stimulus_sampling_rate.

Parameters:

vec : neuron.Vector

constructed by self.record_values

Returns:

dict with two keys: ‘v’ = numpy.ndarray with voltages, ‘t’ = numpy.ndarray with timestamps

load_cell_parameters()[source]

Configure a neuron after the cell morphology has been loaded.

static nearest_neuron_sampling_rate(hz, target_hz=40000)[source]
read_stimulus(stimulus_path, sweep=0)[source]

Load current values for a specific experiment sweep and setup simulation and stimulus sampling rates.

NOTE: NEURON only allows simulation timestamps of multiples of 40KHz. To avoid aliasing, we set the simulation sampling rate to the least common multiple of the stimulus sampling rate and 40KHz.

Parameters:

stimulus path : string

NWB file name

sweep : integer, optional

sweep index

record_values()[source]

Set up output voltage recording.

setup_iclamp(stimulus_path, sweep=0)[source]

Assign a current waveform as input stimulus.

Parameters:

stimulus_path : string

NWB file name

update_default_cell_hoc(description, default_cell_hoc='cell.hoc')[source]

replace the default ‘cell.hoc’ path in the manifest with ‘cell.hoc’ packaged within AllenSDK if it does not exist

allensdk.model.biophysical.utils.create_utils(description, model_type=None)[source]

Factory method to create a Utils subclass.

Parameters:

description : Config instance

used to initialize Utils subclass

model_type : string

Must be one of [PERISOMATIC_TYPE, ALL_ACTIVE_TYPE]. If none, defaults to PERISOMATIC_TYPE

Returns:

Utils instance

Module contents