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
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 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
|
make(key)
¶
Populate the SortedSpikesIndicator table.
Fetches the spike times from the CuratedSpikeSorting table and bins them into regular intervals given by the sampling rate. The spike indicator is stored in an AnalysisNwbfile.
Source code in src/spyglass/decoding/v0/sorted_spikes.py
fetch1_dataframe()
¶
fetch_dataframe()
¶
Return all spike indicators as a list of dataframes.
Source code in src/spyglass/decoding/v0/sorted_spikes.py
SortedSpikesClassifierParameters
¶
Bases: SpyglassMixin
, Manual
Stores parameters for decoding with sorted spikes
Parameters:
Name | Type | Description | Default |
---|---|---|---|
classifier_param_name
|
A name for this set of parameters |
required | |
classifier_params
|
Initialization parameters, including ... environments: list observation_models continuous_transition_types discrete_transition_type: DiagonalDiscrete initial_conditions_type: UniformInitialConditions infer_track_interior: bool clusterless_algorithm: str, optional clusterless_algorithm_params: dict, optional sorted_spikes_algorithm: str, optional sorted_spikes_algorithm_params: dict, optional For more information, see replay_trajectory_classification documentation |
required | |
fit_params
|
|
required | |
predict_params
|
Prediction parameters, including ... is_compute_acausal: bool use_gpu: bool state_names: List[str] |
required |
Source code in src/spyglass/decoding/v0/sorted_spikes.py
get_spike_indicator(key, time_range, sampling_rate=500.0)
¶
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
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 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 |
|
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 |