utils_burst.py
validate_pairs(query, pairs)
¶
Validate unit pairs for a given query.
Checks that the passed pairs are valid pairs in the query. May flip the order of the pairs if the reverse pair is found. Query is assumed to have columns unit1, unit2.
Source code in src/spyglass/spikesorting/utils_burst.py
plot_burst_xcorrel(pairs, ccgs_e, bins)
¶
Plot cross-correlograms for a list of unit pairs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pairs
|
list of tuples of int
|
pairs of units to investigate |
required |
ccgs
|
array
|
Correlograms with shape (num_units, num_units, num_bins) The diagonal of ccgs is the auto correlogram. ccgs[A, B, :] is the symetrie of ccgs[B, A, :] ccgs[A, B, :] have to be read as the histogram of spiketimesA - spiketimesB |
required |
bins
|
np.array
|
The bin edges in ms |
required |
Returns:
Type | Description |
---|---|
Figure
|
|
Source code in src/spyglass/spikesorting/utils_burst.py
plot_burst_pair_peaks(pairs, peak_amps)
¶
Plot peak amplitudes and timestamps for a list of unit pairs.
Source code in src/spyglass/spikesorting/utils_burst.py
plot_burst_peak_over_time(peak_v, peak_t, pairs, overlap=True)
¶
Plot peak amplitudes over time for a given key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
peak_v
|
dict of int to np.ndarray
|
peak amplitudes for each unit |
required |
peak_t
|
dict of int to np.ndarray
|
peak timestamps for each unit |
required |
pairs
|
list of tuples of int
|
pairs of units to plot |
required |
overlap
|
bool
|
if True, plot units in pair on the same plot |
True
|
Source code in src/spyglass/spikesorting/utils_burst.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
|
plot_burst_metrics(sg_query)
¶
Parameters are 4 metrics to be plotted against each other.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sg_query
|
Union[List[Dict], QueryExpression]
|
Query result or list of dictionaries with the following keys: wf_similarity : dict waveform similarities isi_violation : dict isi violation xcorrel_asymm : dict spike cross correlogram asymmetry |
required |
Returns:
Type | Description |
---|---|
figure for plotting later
|
|
Source code in src/spyglass/spikesorting/utils_burst.py
calculate_ca(bins, correl)
¶
Calculate Correlogram Asymmetry (CA)
defined as the contrast ratio of the area of the correlogram right and left of coincident activity (zero). http://www.psy.vanderbilt.edu/faculty/roeaw/edgeinduction/Fig-W6.htm
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bins
|
ndarray
|
array of bin edges |
required |
correl
|
ndarray
|
array of correlogram values |
required |
Source code in src/spyglass/spikesorting/utils_burst.py
calculate_isi_violation(peak1, peak2, isi_threshold_s=1.5)
¶
Calculate isi violation between two spike trains