cibrrig.analysis.singlecell

Functions

get_phase_curve(ts, breaths[, phi_t, phi, nbins])

Computes the firing rate of a neuron for a given respiratory phase.

get_all_phase_curves(spike_times, spike_clusters, ...)

Computes the firing rate of all neurons in cluster_ids for a given respiratory phase.

Module Contents

cibrrig.analysis.singlecell.get_phase_curve(ts, breaths, phi_t=None, phi=None, nbins=100)[source]

Computes the firing rate of a neuron for a given respiratory phase.

The computation is done on a per-breath basis to obtain a distribution.

Parameters:
  • ts (array-like) – Times of spikes for a single neuron.

  • breaths (array-like) – Breath segments.

  • phi_t (array-like) – Time basis of the phase variable phi.

  • phi (array-like) – Respiratory phase at a given time.

  • nbins (int, optional) – Number of bins in the phasic PSTH. Defaults to 100.

Returns:

A dictionary with the following keys:
  • bins (array-like): Bin edges.

  • rate_mean (array-like): Mean firing rate.

  • rate_std (array-like): Standard deviation of the firing rate.

  • rate_sem (array-like): Standard error of the mean firing rate.

Return type:

dict

cibrrig.analysis.singlecell.get_all_phase_curves(spike_times, spike_clusters, cluster_ids, breaths, nbins=100)[source]

Computes the firing rate of all neurons in cluster_ids for a given respiratory phase.

The computation is done on a per-breath basis to obtain a distribution.

Parameters:
  • spike_times (array-like) – Times of spikes for all neurons.

  • spike_clusters (array-like) – Cluster assignment of spikes for all neurons.

  • cluster_ids (array-like) – IDs of clusters to analyze.

  • breaths (array-like) – Breath segments.

  • nbins (int, optional) – Number of bins in the phasic PSTH. Defaults to 100.

Returns:

Bin edges. - rate (array-like): Firing rate, shape [nbins x n_cluster_ids]. - sem (array-like): Standard error of the mean, shape [nbins x n_cluster_ids]. - raster (array-like): Raster data. - rate_sem (array-like): SEM of the raster rate, shape [nbins x n_cluster_ids].

Return type:

  • bins (array-like)