This sub-package contains modules that are related to analysis.
- mozaik.analysis.analysis - contains definition of the analysis interface and implementations of several analysis algorithms
- mozaik.analysis.data_structures - contains definitions of data stractures that the analysis algorithms produce
- mozaik.analysis.helper_functions - some utility functions that are used in the analysis package
- mozaik.analysis.technical - some technical analysis functions that are related to the mozaik architecture
The mozaik.analysis.analysis.Analysis interface assumes that the input to the analysis is retrieved from mozaik.storage.datastore, in the form of recorded data or analysis data structures (see mozaik.analysis.data_structures) produced by other analysis algorithms that were run previously. The analysis itself should be able to filter out from the datastore the recordings/data_structures that it can handle and should be as encompassing and general as possible. This way it will be possible to significantly ‘configure’ the analysis process by merely filtering the data given to the Analysis classes via the mozaik.storage.queries mechanisms. The analysis function is responsible for packaging its results into one or a set of the data structures defined in mozaik.analysis.data_structures and send them to the datastorage. Thus when creating new analysis one should always check which data structures are already defined, and define a new one only in case it is not possible to map the new results data structure on any of the existing ones.
The goal of the AnalysisDataStructure class is to offer a common interface/format for data generated by analysis, so they can be consumed by other analysis or visualization code in a standard way. For example many analyses can generate 2D tuning curves of several kinds but they all share a common data structure and can be plotted in a common way.
An analysis class can generate several AnalysisDataStructures (ADSs) and one ADS can be generated by several Analysis classes.
One important aspect of the ADS design is the notion of parameters as opposed to inputs. Each ADS should define a number of Parameters (see the documentation on Parameters). The importance of parameters is that they will offer a way to identify the ADS in the data store (see param_filter_query in queries). Furthermore the constructor of the AnalysisDataStructure can accept inputs, which are standard variables that should correspond to the data that is actually stored in the ADS.
The five parameters that are common to each ADS and are defined in the top mozaik.analysis.data_structures.AnalysisDataStructure class are:
In complicated workflows it might become difficult to design a filter to extract the right set of recordings or analysis data structures for a given analysis or visualization. We do not want users to define multiple AnalysisDataStructures that hold the same kind of data only to be able to tell them apart.
Therefore, we also allow all analysis data structures to contain a list of tags (which are strings) that one can add during their creation (or later) and use them to later for their identification in a DataStore. Queries are written that support filtering of ADSs based on tags.
However, in general, we encourage users to use filter methods rather than tags to perform their plotting/analysis whenever possible!
For more details see the mozaik.analysis.data_structures and mozaik.analysis.analysis module and specifically the two most important API classes: mozaik.analysis.data_structures.AnalysisDataStructure and mozaik.analysis.analysis.Analysis
This module contains the Mozaik analysis interface and implementation of various analysis algorithms
For more documentation refer to `mozaik.analysis`_
Bases: mozaik.core.ParametrizedObject
The analysis interface.
Each mozaik analysis is a subclass of this class and is required to implementat the perform_analysis function which should contain the analysis code. This function should retrieve data from the DataStoreView that is supplied in the datastore parameter. Further, it should include tags as the tags for all AnalysisDataStructure objects that it creates. (See the description of the analysis.AnalysisDataStructure.tags attribute.
Parameters : | datastore : DataStoreView
parameters : ParameterSet
tags : list(str), optional
|
---|
This is the function calls to perform the analysis.
This is an abstract function that each analysis class has to implement. It contains the code performing the analysis.
Bases: mozaik.analysis.analysis.Analysis
This analysis takes each recording in DSV that has been done in response to stimulus type ‘stimulus_type’ and calculates the average (over trials) number of spikes. For each set of equal recordings (except trial) it creates one PerNeuronValue AnalysisDataStructure instance containing the trial averaged firing rate per each recorded neuron.
Bases: mozaik.analysis.analysis.Analysis
Calculates a preference and selectvitiy tuning of a periodic variable via vector average method.
This analysis takes from the DSV all PerNeuronValues. All PerNeuronValues have to belong to stimuli of the same type and contain the same type of values (i.e. have the same value_name).
For each combination of parameters of the stimuli other than parameter_name PeriodicTuningCurvePreferenceAndSelectivity_VectorAverage creates a PerNeuronValue which corresponsd to the vector average through the periodic domain of parameter_name.
Other Parameters: | |
---|---|
parameter_name : str
|
Bases: mozaik.analysis.analysis.Analysis
Computes conductance spike triggered average.
Other Parameters: | |
---|---|
length : float (ms)
neurons : list
|
Notes
GSTA does not assume that spikes are aligned with the conductance sampling rate and will pick the bin in which the given spike falls (within the conductance sampling rate binning) as the center of the conductance vector that is included in the STA.
Bases: mozaik.analysis.analysis.Analysis
Computes the precision as the autocorrelation between the PSTH of different trials.
Takes all the responses in the datastore, and for each recording group that is identical except the trial number it will compute the autocorrelation between the PSTH of different trials. For each such group it will create add a AnalogSignalList instance into the datastore containing the calculated autocorrelation vector for each neuron in required_parameters.neurons.
Other Parameters: | |
---|---|
bin_length : float (ms)
neurons: list :
|
Bases: mozaik.analysis.analysis.Analysis
For each stimulus and neuron it calculates the trial-to-trial variability of Vm or conductance (depending on parameters). It creates a AnalogSignalList list for each recording (except trials).
Other Parameters: | |
---|---|
vm : bool
cond_exc : bool
cond_inh : bool
|
Bases: mozaik.analysis.analysis.Analysis
Fits each tuning curve with a gaussian.
It takes a dsv containing some PerNeuronValues. All PerNeuronValues have to belong to stimuli of the same type and contain the same type of values (i.e. have the same value_name).
For each combination of parameters of the stimuli other than parameter_name GaussianTuningCurveFit fits a gaussian tuning curve to the values in the PerNeuronValues that span the parameter values of the parameter_name stimulus parameter.
It stores the parameters of the fitted Gaussian in a PerNeuronValue - for each combination of parameters of the stimulus associated with the supplied PerNeuronValue with the exception of the stimulus parameter parameter_name. For each combination it stored 5 PerNeuronValue data structures, containing the calculated selectivity, preference, half-width at half-height (HWHH), maximum (‘scale’ of the gaussian) and baseline (the constant offset).
Other Parameters: | |
---|---|
parameter_name : str
|
Bases: mozaik.analysis.analysis.Analysis
For each recording in the datastore view it creates an AnalogSignalList containing the PSTH of the neuron using the bin length required_parameters.bin_length.
Other Parameters: | |
---|---|
bin_length : float
|
Bases: mozaik.analysis.analysis.Analysis
For each recording or AnalogSingalList ADS with x_axis_name`=’time’ in the datastore `TemporalBinAverage creates a new AnalogSingalList, containing a down-sampled version of the signal (vm, conductances or the AnalogSingalList), such that it will bin the time axis with bin length required_parameters.bin_length and make average for each bin.
Other Parameters: | |
---|---|
bin_length : float
vm : bool
cond_exc : bool
cond_inh : bool
|
Bases: mozaik.analysis.analysis.Analysis
For each recording in the datastore view it creates an AnalogSignalList containing the VMs with the spikes removed and sends it to the datastore.
Other Parameters: | |
---|---|
window_length : float (ms)
|
Notes
Vm, in the window starting at each spike time, and lasting the window_length is removed and replaced by linear interpolation between the values of Vm at the extrems of the cutout window.
Bases: mozaik.analysis.analysis.Analysis
Irregularity as defined in: Kumar, A., Schrader, S., Aertsen, A., & Rotter, S. (2008). The high-conductance state of cortical networks. Neural computation, 20(1), 1-43. It is the square of inter spike interval coefficient of variation.
It creates on PerNeuronValue ADS per each recording in the DSV.
Notes
It is not possible to compute CV for neurons with no spikes. Therefore we exclude such neurons from the analysis. This means that the resulting PerNeuronValue ADS might not contain all ids of neurons as the source recording.
Bases: mozaik.analysis.analysis.Analysis
Calculates the pairwise correlation of AnalogSignal object for each pair of neurons. It creates one PerNeuronPairValue for each AnalogSignalList ADS present in the DSV.
Parameters : | convert_nan_to_zero : bool,
|
---|
Bases: mozaik.analysis.analysis.Analysis
Calculates the mean value accross population of a quantity. Currently it can process PerNeuronValues and PerNeuronPairValue ADS. This list might be increased.
This module contains the definition of the AnalysisDataStructure API and implementation of some basic analysis data structures.
For more documentation refer to `mozaik.analysis`_
Bases: mozaik.tools.mozaik_parametrized.MozaikParametrized
Encapsulates data that a certain Analysis class generates.
The four parameters that are common to all AnalysisDataStructure classes are identified, analysis_algorithm, neuron, sheet_name and stimulus_id.
Mozaik parameters: | |
---|---|
|
Bases: mozaik.analysis.data_structures.AnalysisDataStructure
Data structure holding single value. This can be per model, if sheet parameter is None, or per sheet if sheet is specified. In principle it can also be per neuron if the neuron parameter is specified, but in most cases you probably want to use PerNeuronValue instead.
Mozaik parameters: | |
---|---|
|
Bases: mozaik.analysis.data_structures.AnalysisDataStructure
Data structure holding single value per neuron.
Parameters : | values : list
value_units : quantities
ids : list(int)
|
---|---|
Mozaik parameters: | |
|
Parameters : | idd : int or list(int)
|
---|---|
Returns : | ids : AnalogSignal or list(AnalogSignal)
|
Bases: mozaik.analysis.data_structures.AnalysisDataStructure
Data structure holding values for each pair of neurons.
Parameters : | values : numpy.nd_array
value_units : quantities
ids : list(int)
|
---|---|
Mozaik parameters: | |
|
Parameters : | idd : int or list(int)
|
---|---|
Returns : | ids : AnalogSignal or list(AnalogSignal)
|
Bases: mozaik.analysis.data_structures.AnalysisDataStructure
Data structure representing 1D data. All data corresponds to the same axis name and units. Explicitly specifies the axis - their name and units. Note that at this stage we do not assume the structure in which the data is stored. Also the class can hold multiple instances of 1D data.
It uses the quantities package to specify units. If at all possible all data stored in numoy arrays should be quantities arrays with matching units!
Parameters : | y_axis_units : quantities
|
---|---|
Mozaik parameters: | |
|
Bases: mozaik.analysis.data_structures.AnalysisDataStructure1D
This is a simple list of Neo AnalogSignal objects.
Parameters : | asl : list(AnalogSignal)
ids : list(int)
|
---|
Parameters : | idd : int or list(int) |
---|---|
Returns : | ids : AnalogSignal or list(AnalogSignal)
|
Bases: mozaik.analysis.data_structures.AnalysisDataStructure1D
This is a simple list of Neurotools AnalogSignal objects representing the conductances.
The object holds two lists, one for excitatory and one for inhibitory conductances.
Parameters : | e_asl : list(AnalogSignal)
i_asl : list(AnalogSignal)
ids : list(int)
|
---|
Parameters : | idd : int or list(int) |
---|---|
Returns : | ids : AnalogSignal or list(AnalogSignal)
|
Parameters : | idd : int or list(int) |
---|---|
Returns : | ids : AnalogSignal or list(AnalogSignal)
|
Bases: mozaik.analysis.data_structures.AnalysisDataStructure
Data structure holding connections.
Parameters : | weights : list
delays : list
|
---|---|
Mozaik parameters: | |
|
This module contains various utility functions often useb by analysis code.
The function returns the psth of the spiketrains with bin length bin_length.
Parameters : | spike_list : list(SpikeTrain )
bin_length : float (ms)
|
---|---|
Returns : | psth : AnalogSignal
|
It returns PSTH averaged across the spiketrains
Parameters : | spike_trials : list(list(SpikeTrain))
|
---|---|
Returns : | psth : AnalogSignal
|
This module contains special analysis functions that relate to some tehnical mozaik architecture aspects and thus do not represent a standard analysis
Bases: mozaik.analysis.analysis.Analysis
Creates a PerNeuronValues analysis data structure per each neuron annotation that is defined for all neurons in a given sheet.
This analysis is aware of several mozaik specific annotations and adds additional appropriate information to the PerNeuronValue ADS (i.e. setting period to numpy.pi of orientation preference of initial connection fields). Users are expected to modify this class to add additional information for their new annotations if required. It is assumed that in future the handling of parameters around Mozaik might be enhanced and unified further to avoid extension of this class.
Module containing vision specific analysis.
Bases: mozaik.analysis.analysis.Analysis
This analysis calculates the modulation ration (as the F1/F0) for all neurons in the data using all available responses recorded to the FullfieldDriftingSinusoidalGrating stimuli. This method also requires that ‘orientation preference’ has already been calculated for all the neurons.
The ModulationRatio takes all responses recorded to the FullfieldDriftingSinusoidalGrating and calculates their PSTH. Then it collapses this list of PSTHs into groups, each containing PSTH associated with the same FullfieldDriftingSinusoidalGrating stimulus with the exception of the orientation. For each such group it then goes through each recorded neuron and selects the closest presented orientation to the orientation peference of the given neuron, and using the PSTH associated with this selected orientation it calculates the modulation ratio for that neuron. This way for each group it will calculate modulation ratios for all recorded neurons, and will store them in datastore using the PerNeuronValue data structure.
Other Parameters: | |
---|---|
bin_length : float (ms)
|
Bases: mozaik.analysis.analysis.Analysis
Calculates the DC and first harmonic of trial averaged vm and conductances for each neuron measured to FullfieldDriftingSinusoidalGrating. It stores them in PerNeuronValue datastructures (one for exc. one for inh. conductances).
Notes
Only neurons for which the corresponding signals were measured will be included in the PerNeuronValue data structures.
Bases: mozaik.analysis.analysis.Analysis
Calculates Local Homogeneity Index (LHI) for each neuron, of each PerNeuronValue that is present in the datastore, according to: Nauhaus, I., Benucci, A., Carandini, M., & Ringach, D. (2008). Neuronal selectivity and local map structure in visual cortex. Neuron, 57(5), 673–679.