Visualize Variation Statistics of CBGTC spike times

Plot Variation Statistics

Functions

Purpose

plotCV()

plots Coefficient of Variations of all the neurons in a population

plotCV_in_ax()

draws the Coefficient of Variations of all the neurons into a given matplotlib.pyplot.axis

plotCV2()

plots Local Coefficient of Variations of all the neurons in a population

plotCV2_in_ax()

draws the Local Coefficient of Variations of all the neurons into a given matplotlib.pyplot.axis

plotLV()

plots Local Variations of all the neurons in a population

plotLV_in_ax()

draws the Local Variations of all the neurons into a given matplotlib.pyplot.axis

1. Pre-requisites

1.1. Import Modules

from analyseur.cbgtc.loader import LoadSpikeTimes
from analyseur.cbgtc.visual.variation import <desired_method>

1.2. Load file and get spike times

loadST = LoadSpikeTimes("spikes_GPi.csv")
spiketimes_set = loadST.get_spiketimes_superset()

2. Cases

2.1. Standard plot

<desired_method>(spiketimes_set)

2.2. Create the plot for customization

This is for power users who for instance want to insert the plot in their collage of subplots.

import matplotlib.pyplot as plt
from analyseur.cbgtc.visual.variation import plotCV_in_ax

fig, (ax1, ax2) = plt.subplots(1, 2)
fig.suptitle('Horizontally stacked subplots')

ax1 = plotCV_in_ax(ax1, spiketimes_set)
ax2 = plotCV_in_ax(ax2, spiketimes_set)

plt.show()

analyseur.cbgtc.visual.variation.plotCV(spiketimes_set, nucleus=None, mode=None)[source]

Visualize Coefficient of Variation of the given neuron population using plotCV_in_ax()

Parameters:

spiketimes_set – Dictionary returned using get_spiketimes_superset()

or using get_spiketimes_subset()

[OPTIONAL]

Parameters:
  • neurons

    “all” or scalar or range(a, b) or list of neuron ids like [2, 3, 6, 7]

    • ”all” means subset = superset

    • N (a scalar) means subset of first N neurons in the superset

    • range(a, b) or [2, 3, 6, 7] means subset of selected neurons

  • nucleus – string; name of the nucleus

  • mode – “portrait” or None/landscape [default]

Returns:

object ax with Rate Distribution plotting done into it


analyseur.cbgtc.visual.variation.plotCV2(spiketimes_set, nucleus=None, mode=None)[source]

Visualize Local Coefficient of Variation of the given neuron population using plotCV2_in_ax()

Parameters:

spiketimes_set – Dictionary returned using get_spiketimes_superset()

or using get_spiketimes_subset()

[OPTIONAL]

Parameters:
  • neurons

    “all” or scalar or range(a, b) or list of neuron ids like [2, 3, 6, 7]

    • ”all” means subset = superset

    • N (a scalar) means subset of first N neurons in the superset

    • range(a, b) or [2, 3, 6, 7] means subset of selected neurons

  • nucleus – string; name of the nucleus

  • mode – “portrait” or None/landscape [default]

Returns:

object ax with Rate Distribution plotting done into it


analyseur.cbgtc.visual.variation.plotCV2_in_ax(ax, spiketimes_set, nucleus=None, mode=None)[source]
CV2 Distribution of Neurons

CV2
^
|        |  |   | | |  |   |  | | |  |
|      | |  | | | | |  | | |  | | |  |
|    | | |  | | | | |  | | |  | | |  |
|  | | | |  | | | | |  | | |  | | |  |
|
+-------------------------------------------------> Neurons
    0        50        100        150        200

Each vertical bar represents the local coefficient of variation (CV2)
of a single neuron. CV2 measures local variability between successive
interspike intervals.

Draws the Local Coefficient of Variation on the given matplotlib.pyplot.axis

Parameters:

or using get_spiketimes_subset()

[OPTIONAL]

Parameters:
  • neurons

    “all” or scalar or range(a, b) or list of neuron ids like [2, 3, 6, 7]

    • ”all” means subset = superset

    • N (a scalar) means subset of first N neurons in the superset

    • range(a, b) or [2, 3, 6, 7] means subset of selected neurons

  • nucleus – string; name of the nucleus

  • mode – “portrait” or None/landscape [default]

Returns:

object ax with Rate Distribution plotting done into it


analyseur.cbgtc.visual.variation.plotCV_in_ax(ax, spiketimes_set, nucleus=None, mode=None)[source]
CV Distribution

CV
^
|        |  |   | | |  |   |  | | |  |
|      | |  | | | | |  | | |  | | |  |
|    | | |  | | | | |  | | |  | | |  |
|  | | | |  | | | | |  | | |  | | |  |
|
+-------------------------------------------------> Neurons
    0        50        100        150        200

Each vertical bar represents the coefficient of variation (CV)
of a single neuron. The distribution shows variability in firing
regularity across the neuron population.

Draws the Coefficient of Variation on the given matplotlib.pyplot.axis

Parameters:

or using get_spiketimes_subset()

OPTIONAL parameters

Parameters:
  • neurons

    “all” or scalar or range(a, b) or list of neuron ids like [2, 3, 6, 7]

    • ”all” means subset = superset

    • N (a scalar) means subset of first N neurons in the superset

    • range(a, b) or [2, 3, 6, 7] means subset of selected neurons

  • nucleus – string; name of the nucleus

  • mode – “portrait” or None/landscape [default]

Returns:

object ax with Rate Distribution plotting done into it


analyseur.cbgtc.visual.variation.plotLV(spiketimes_set, nucleus=None, mode=None)[source]

Visualize Local Variation of the given neuron population using plotLV_in_ax()

Parameters:

spiketimes_set – Dictionary returned using get_spiketimes_superset()

or using get_spiketimes_subset()

[OPTIONAL]

Parameters:
  • neurons

    “all” or scalar or range(a, b) or list of neuron ids like [2, 3, 6, 7]

    • ”all” means subset = superset

    • N (a scalar) means subset of first N neurons in the superset

    • range(a, b) or [2, 3, 6, 7] means subset of selected neurons

  • nucleus – string; name of the nucleus

  • mode – “portrait” or None/landscape [default]

Returns:

object ax with Rate Distribution plotting done into it


analyseur.cbgtc.visual.variation.plotLV_in_ax(ax, spiketimes_set, nucleus=None, mode=None)[source]
LV Distribution

LV
^
|        |  |   | | |  |   |  | | |  |
|      | |  | | | | |  | | |  | | |  |
|    | | |  | | | | |  | | |  | | |  |
|  | | | |  | | | | |  | | |  | | |  |
|
+-------------------------------------------------> Neurons
    0        50        100        150        200

Each vertical bar represents the local variation (LV)
of a single neuron. LV quantifies the variability in
firing patterns across the neuron population.

Draws the Local Variation on the given matplotlib.pyplot.axis

Parameters:

or using get_spiketimes_subset()

[OPTIONAL]

Parameters:
  • neurons

    “all” or scalar or range(a, b) or list of neuron ids like [2, 3, 6, 7]

    • ”all” means subset = superset

    • N (a scalar) means subset of first N neurons in the superset

    • range(a, b) or [2, 3, 6, 7] means subset of selected neurons

  • nucleus – string; name of the nucleus

  • mode – “portrait” or None/landscape [default]

Returns:

object ax with Rate Distribution plotting done into it