neuronunit.capabilities package

Submodules

neuronunit.capabilities.channel module

NeuronUnit abstract Capabilities for channel models

class neuronunit.capabilities.channel.NML2ChannelAnalysis[source]

Bases: sciunit.capabilities.Capability

Capability for models that can be altered using functions available in pyNeuroML.analsysi.NML2ChannelAnalysis

ca_make_lems_file(**run_params)[source]

Makes a LEMS file using the provided run parameters using the ChannelAnalysis module.

ca_run_lems_file()[source]

Run the LEMS file using ChannelAnalysis module.

compute_iv_curve(results)[source]

Compute an IV Curve from the iv data in results.

plot_iv_curve(v, i, *plt_args, **plt_kwargs)[source]

Plots IV Curve using array-like voltage ‘v’ and array-like current ‘i’

neuronunit.capabilities.morphology module

NeuronUnit abstract Capabilities for multicompartment cell models

class neuronunit.capabilities.morphology.ProducesSWC[source]

Bases: sciunit.capabilities.Capability

The capability to produce a morphology SWC file

produce_swc()[source]

Produces morphology description file in SWC file format

Returns:absolute path to the produced SWC file

neuronunit.capabilities.spike_functions module

Auxiliary helper functions for analysis of spiking.

neuronunit.capabilities.spike_functions.get_spike_train(vm, threshold=array(0.) * mV)[source]
Inputs:

vm: a neo.core.AnalogSignal corresponding to a membrane potential trace. threshold: the value (in mV) above which vm has to cross for there

to be a spike. Scalar float.
Returns:
a neo.core.SpikeTrain containing the times of spikes.
neuronunit.capabilities.spike_functions.get_spike_waveforms(vm, threshold=array(0.) * mV, width=array(10.) * ms)[source]

Membrane potential trace (1D numpy array) to matrix of spike snippets (2D numpy array)

Inputs:

vm: a neo.core.AnalogSignal corresponding to a membrane potential trace. threshold: the value (in mV) above which vm has to cross for there

to be a spike. Scalar float.
width: the length (in ms) of the snippet extracted,
centered at the spike peak.
Returns:
a neo.core.AnalogSignal where each column contains a membrane potential snippets corresponding to one spike.
neuronunit.capabilities.spike_functions.spikes2amplitudes(spike_waveforms)[source]
IN:
spike_waveforms: Spike waveforms, e.g. from get_spike_waveforms().
neo.core.AnalogSignal
OUT:
1D numpy array of spike amplitudes, i.e. the maxima in each waveform.
neuronunit.capabilities.spike_functions.spikes2thresholds(spike_waveforms)[source]
IN:
spike_waveforms: Spike waveforms, e.g. from get_spike_waveforms().
neo.core.AnalogSignal
OUT:
1D numpy array of spike thresholds, specifically the membrane potential at which 1/10 the maximum slope is reached.

If the derivative contains NaNs, probably because vm contains NaNs Return an empty list with the appropriate units

neuronunit.capabilities.spike_functions.spikes2widths(spike_waveforms)[source]
IN:
spike_waveforms: Spike waveforms, e.g. from get_spike_waveforms().
neo.core.AnalogSignal
OUT:
1D numpy array of spike widths, specifically the full width at half the maximum amplitude.

Module contents

NeuronUnit abstract Capabilities.

The goal is to enumerate all possible capabilities of a model that would be tested using NeuronUnit. These capabilities exchange ‘neo’ objects.

class neuronunit.capabilities.ProducesActionPotentials[source]

Bases: neuronunit.capabilities.ProducesSpikes, neuronunit.capabilities.ProducesMembranePotential

Indicate the model produces action potential waveforms.

Waveforms must have a temporal extent.

get_AP_amplitudes()[source]

Get amplitudes of action potentials.

get_AP_thresholds()[source]

Get thresholds of action potentials.

get_AP_widths()[source]

Get widths of action potentials.

get_APs()[source]

Get action potential waveform chunks from the model.

Must return a neo.core.AnalogSignal. Each column of the AnalogSignal should be a spike waveform.

class neuronunit.capabilities.ProducesMembranePotential[source]

Bases: sciunit.capabilities.Capability

Indicates that the model produces a somatic membrane potential.

get_initial_vm(**kwargs)[source]

Return a quantity corresponding to the starting membrane potential.

This will in some cases be the resting potential.

get_iqr_vm(**kwargs)[source]

Get the inter-quartile range of the membrane potential.

get_mean_vm(**kwargs)[source]

Get the mean membrane potential.

get_median_vm(**kwargs)[source]

Get the median membrane potential.

get_membrane_potential(**kwargs)[source]

Must return a neo.core.AnalogSignal.

get_std_vm(**kwargs)[source]

Get the standard deviation of the membrane potential.

plot_membrane_potential(ax=None, ylim=(None, None), **kwargs)[source]

Plot the membrane potential.

class neuronunit.capabilities.ProducesSpikes[source]

Bases: sciunit.capabilities.Capability

Indicate that the model produces spikes.

No duration is required for these spikes.

get_spike_count()[source]

Get the number of spikes.

get_spike_train()[source]

Get computed spike times from the model.

Arguments: None. Returns: a neo.core.SpikeTrain object.

class neuronunit.capabilities.ReceivesCurrent[source]

Bases: neuronunit.capabilities.ReceivesSquareCurrent

Indicate that somatic current can be injected into the model as either an arbitrary waveform or as a square pulse.

inject_current(current)[source]

Inject somatic current into the model.

current : neo.core.AnalogSignal This is a time series of the current to be injected.

class neuronunit.capabilities.ReceivesSquareCurrent[source]

Bases: sciunit.capabilities.Capability

Indicate that somatic current can be injected into the model as a square pulse.

inject_square_current(current)[source]

Injects somatic current into the model.

current : a dictionary like:
{‘amplitude’:-10.0*pq.pA,
‘delay’:100*pq.ms, ‘duration’:500*pq.ms}}

where ‘pq’ is the quantities package

This describes the current to be injected.