allensdk.model.biophysical.utils module¶
-
class
allensdk.model.biophysical.utils.
AllActiveUtils
(description)[source]¶
-
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
-
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
-
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