allensdk.model.biophysical.utils module

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

Bases: Utils

generate_morphology(morph_filename)[source]

Load a neurolucida or swc-format cell morphology file.

Parameters:
morph_filenamestring

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: HocUtils

A helper class for NEURON functionality needed for biophysical simulations.

Attributes:
hobject

The NEURON hoc object.

nrnobject

The NEURON python object.

neuronmodule

The NEURON module.

generate_morphology(morph_filename)[source]

Load a swc-format cell morphology file.

Parameters:
morph_filenamestring

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:
vecneuron.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 pathstring

NWB file name

sweepinteger, 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_pathstring

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:
descriptionConfig instance

used to initialize Utils subclass

model_typestring

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

Returns:
Utils instance