cibrrig.analysis.singlecell =========================== .. py:module:: cibrrig.analysis.singlecell Functions --------- .. autoapisummary:: cibrrig.analysis.singlecell.get_phase_curve cibrrig.analysis.singlecell.get_all_phase_curves Module Contents --------------- .. py:function:: get_phase_curve(ts, breaths, phi_t=None, phi=None, nbins=100) 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. :param ts: Times of spikes for a single neuron. :type ts: array-like :param breaths: Breath segments. :type breaths: array-like :param phi_t: Time basis of the phase variable `phi`. :type phi_t: array-like :param phi: Respiratory phase at a given time. :type phi: array-like :param nbins: Number of bins in the phasic PSTH. Defaults to 100. :type nbins: int, optional :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. :rtype: dict .. py:function:: get_all_phase_curves(spike_times, spike_clusters, cluster_ids, breaths, nbins=100) 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. :param spike_times: Times of spikes for all neurons. :type spike_times: array-like :param spike_clusters: Cluster assignment of spikes for all neurons. :type spike_clusters: array-like :param cluster_ids: IDs of clusters to analyze. :type cluster_ids: array-like :param breaths: Breath segments. :type breaths: array-like :param nbins: Number of bins in the phasic PSTH. Defaults to 100. :type nbins: int, optional :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]. :rtype: - bins (array-like)