sorted_spikes.py
Pipeline for decoding the animal's mental position and some category of interest from clustered spikes times. See [1] for details.
References
[1] Denovellis, E. L. et al. Hippocampal replay of experience at real-world speeds. eLife 10, e64505 (2021).
SortedSpikesIndicatorSelection
¶
Bases: SpyglassMixin
, Lookup
Bins spike times into regular intervals given by the sampling rate. Start and stop time of the interval are defined by the interval list.
Source code in src/spyglass/decoding/v0/sorted_spikes.py
SortedSpikesIndicator
¶
Bases: SpyglassMixin
, Computed
Bins spike times into regular intervals given by the sampling rate. Useful for GLMs and for decoding.
Source code in src/spyglass/decoding/v0/sorted_spikes.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 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 |
|
get_time_bins_from_interval(interval_times, sampling_rate)
staticmethod
¶
Gets the superset of the interval.
Source code in src/spyglass/decoding/v0/sorted_spikes.py
SortedSpikesClassifierParameters
¶
Bases: SpyglassMixin
, Manual
Stores parameters for decoding with sorted spikes
Source code in src/spyglass/decoding/v0/sorted_spikes.py
get_spike_indicator(key, time_range, sampling_rate=500.0)
¶
For a given key, returns a dataframe with the spike indicator for each unit
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
dict
|
|
required |
time_range |
tuple[float, float]
|
Start and end time of the spike indicator |
required |
sampling_rate |
float
|
|
500.0
|
Returns:
Name | Type | Description |
---|---|---|
spike_indicator |
(DataFrame, shape(n_time, n_units))
|
A dataframe with the spike indicator for each unit |
Source code in src/spyglass/decoding/v0/sorted_spikes.py
get_decoding_data_for_epoch(nwb_file_name, interval_list_name, position_info_param_name='default', additional_spike_keys={})
¶
Collects the data needed for decoding
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nwb_file_name |
str
|
|
required |
interval_list_name |
str
|
|
required |
position_info_param_name |
str
|
|
'default'
|
additional_spike_keys |
dict
|
|
{}
|
Returns:
Name | Type | Description |
---|---|---|
position_info |
(DataFrame, shape(n_time, n_position_features))
|
|
spikes |
(DataFrame, shape(n_time, n_units))
|
|
valid_slices |
list[slice]
|
|
Source code in src/spyglass/decoding/v0/sorted_spikes.py
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 |
|
get_data_for_multiple_epochs(nwb_file_name, epoch_names, position_info_param_name='decoding', additional_spike_keys={})
¶
Collects the data needed for decoding for multiple epochs
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nwb_file_name |
str
|
|
required |
epoch_names |
list
|
|
required |
position_info_param_name |
str
|
|
'decoding'
|
additional_spike_keys |
dict
|
|
{}
|
Returns:
Name | Type | Description |
---|---|---|
position_info |
(DataFrame, shape(n_time, n_position_features))
|
|
spikes |
(DataFrame, shape(n_time, n_units))
|
|
valid_slices |
list[slice]
|
|
environment_labels |
(ndarray, shape(n_time))
|
The environment label for each time point |
sort_group_ids |
(ndarray, shape(n_units))
|
The sort group of each unit |