Analysis of Sequences of Synchronous EvenTs (ASSET)

ASSET is a statistical method (Torre et al., 2016) for the detection of repeating sequences of synchronous spiking events in parallel spike trains.

ASSET analysis class object of finding patterns

ASSET(spiketrains_i[, spiketrains_j, ...])

Analysis of Sequences of Synchronous EvenTs class.

Patterns post-exploration

synchronous_events_intersection(sse1, sse2)

Given two sequences of synchronous events (SSEs) sse1 and sse2, each consisting of a pool of positions (iK, jK) of matrix entries and associated synchronous events SK, finds the intersection among them.

synchronous_events_difference(sse1, sse2[, ...])

Given two sequences of synchronous events (SSEs) sse1 and sse2, each consisting of a pool of pixel positions and associated synchronous events (see below), computes the difference between sse1 and sse2.

synchronous_events_identical(sse1, sse2)

Given two sequences of synchronous events (SSEs) sse1 and sse2, each consisting of a pool of pixel positions and associated synchronous events (see below), determines whether sse1 is strictly contained in sse2.

synchronous_events_no_overlap(sse1, sse2)

Given two sequences of synchronous events (SSEs) sse1 and sse2, each consisting of a pool of pixel positions and associated synchronous events (see below), determines whether sse1 and sse2 are disjoint.

synchronous_events_contained_in(sse1, sse2)

Given two sequences of synchronous events (SSEs) sse1 and sse2, each consisting of a pool of pixel positions and associated synchronous events (see below), determines whether sse1 is strictly contained in sse2.

synchronous_events_contains_all(sse1, sse2)

Given two sequences of synchronous events (SSEs) sse1 and sse2, each consisting of a pool of pixel positions and associated synchronous events (see below), determines whether sse1 strictly contains sse2.

synchronous_events_overlap(sse1, sse2)

Given two sequences of synchronous events (SSEs) sse1 and sse2, each consisting of a pool of pixel positions and associated synchronous events (see below), determines whether the two SSEs overlap.

get_neurons_in_sse(sse)

Returns the IDs of all neurons present in the SSE pattern.

get_sse_start_and_end_time_bins(sse)

For each repeated sequence in the SSE pattern, returns the start and end time bin IDs.

Tutorial

View tutorial

Run tutorial interactively:

https://mybinder.org/badge.svg

Examples

In this example we

  • simulate two noisy synfire chains;

  • shuffle the neurons to destroy visual appearance;

  • run ASSET analysis to recover the original neurons’ arrangement.

  1. Simulate two noise synfire chains, shuffle the neurons to destroy the pattern visually, and store shuffled activations in neo.SpikeTrains.

    >>> import neo
    >>> import numpy as np
    >>> import quantities as pq
    >>> from pprint import pprint
    >>> np.random.seed(10)
    >>> spiketrain = np.linspace(0, 50, num=10)
    >>> np.random.shuffle(spiketrain)
    >>> spiketrains = np.c_[spiketrain, spiketrain + 100]
    >>> spiketrains += np.random.random_sample(spiketrains.shape) * 5
    >>> spiketrains = [neo.SpikeTrain(st, units='ms', t_stop=1 * pq.s)
    ...                for st in spiketrains]
    
  2. Create ASSET class object that holds spike trains.

    ASSET requires at least one argument - a list of spike trains. If spiketrains_y is not provided, the same spike trains are used to build an intersection matrix with.

    >>> from elephant import asset
    >>> asset_obj = asset.ASSET(spiketrains, bin_size=3*pq.ms)
    
  3. Build the intersection matrix imat:

    >>> imat = asset_obj.intersection_matrix()
    
  4. Estimate the probability matrix pmat, using the analytical method:

    >>> pmat = asset_obj.probability_matrix_analytical(imat,
    ...                                                kernel_width=50*pq.ms)
    
  5. Compute the joint probability matrix jmat, using a suitable filter:

    >>> jmat = asset_obj.joint_probability_matrix(pmat, filter_shape=(5, 1),
    ...                                           n_largest=3)
    
  6. Create the masked version of the intersection matrix, mmat, from pmat and jmat:

    >>> mmat = asset_obj.mask_matrices([pmat, jmat], thresholds=.9)
    
  7. Cluster significant elements of imat into diagonal structures:

    >>> cmat = asset_obj.cluster_matrix_entries(mmat, max_distance=11,
    ...                                         min_neighbors=3, stretch=5)
    
  1. Extract sequences of synchronous events:

    >>> sses = asset_obj.extract_synchronous_events(cmat)
    

The ASSET found the following sequences of synchronous events:

>>> pprint(sses)
{1: {(36, 2): {5},
     (37, 4): {1},
     (40, 6): {4},
     (41, 7): {8},
     (43, 9): {2},
     (47, 14): {7},
     (48, 15): {0},
     (50, 17): {9}}}

To visualize them, refer to Viziphant documentation and an example plot viziphant.asset.plot_synchronous_events().

References

[Torre, 2016]

E. Torre, C. Canova, M. Denker, G. Gerstein, M. Helias, and S. Grün. Asset: analysis of sequences of synchronous events in massively parallel spike trains. PLoS Comp. Biol., 12(7):e1004939, 2016. doi:10.1371/journal.pcbi.1004939.