clusterless.py
Pipeline for decoding the animal's mental position and some category of interest from unclustered spikes and spike waveform features. See [1] for details.
References
[1] Denovellis, E. L. et al. Hippocampal replay of experience at real-world speeds. eLife 10, e64505 (2021).
MarkParameters
¶
Bases: SpyglassMixin
, Manual
Defines the type of waveform feature computed for a given spike time.
Source code in src/spyglass/decoding/v0/clusterless.py
insert_default()
¶
Insert the default parameter set
Examples:
{'peak_sign': 'neg', 'threshold' : 100} corresponds to negative going waveforms of at least 100 uV size
Source code in src/spyglass/decoding/v0/clusterless.py
supported_mark_type(mark_type)
staticmethod
¶
Checks whether the requested mark type is supported.
Currently only 'amplitude" is supported.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mark_type |
str
|
|
required |
Source code in src/spyglass/decoding/v0/clusterless.py
UnitMarks
¶
Bases: SpyglassMixin
, Computed
Compute spike waveform features for each spike time.
For each spike time, compute a spike waveform feature associated with that spike. Used for clusterless decoding.
Source code in src/spyglass/decoding/v0/clusterless.py
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 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 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 |
|
fetch1_dataframe()
¶
UnitMarksIndicatorSelection
¶
Bases: SpyglassMixin
, Lookup
Pairing of a UnitMarksIndicator with a time interval and sampling rate
Bins the spike times and associated spike waveform features for a given time interval into regular time bins determined by the sampling rate.
Source code in src/spyglass/decoding/v0/clusterless.py
UnitMarksIndicator
¶
Bases: SpyglassMixin
, Computed
Bins spike times and waveforms into regular time bins.
Bins the spike times and associated spike waveform features into regular time bins according to the sampling rate. Features that fall into the same time bin are averaged.
Source code in src/spyglass/decoding/v0/clusterless.py
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 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 |
|
get_time_bins_from_interval(interval_times, sampling_rate)
staticmethod
¶
Picks the superset of the interval
Source code in src/spyglass/decoding/v0/clusterless.py
plot_all_marks(marks_indicators, plot_size=5, marker_size=10, plot_limit=None)
staticmethod
¶
Plot all marks for all electrodes.
Plots 2D slices of each of the spike features against each other for all electrodes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
marks_indicators |
(DataArray, shape(n_time, n_electrodes, n_features))
|
Spike times and associated spike waveform features binned into |
required |
plot_size |
int
|
Default 5. Matplotlib figure size for each mark. |
5
|
marker_size |
int
|
Default 10. Marker size |
10
|
plot_limit |
int
|
Default None. Limits to first N electrodes. |
None
|
Source code in src/spyglass/decoding/v0/clusterless.py
fetch1_dataframe()
¶
fetch_dataframe()
¶
Fetches the marks indicators as a list of pandas dataframes
fetch_xarray()
¶
Fetches the marks indicators as an xarray DataArray
Source code in src/spyglass/decoding/v0/clusterless.py
make_default_decoding_parameters_cpu()
¶
Default parameters for decoding on CPU
Returns:
Name | Type | Description |
---|---|---|
classifier_parameters |
dict
|
|
fit_parameters |
dict
|
|
predict_parameters |
dict
|
|
Source code in src/spyglass/decoding/v0/clusterless.py
make_default_decoding_parameters_gpu()
¶
Default parameters for decoding on GPU
Returns:
Name | Type | Description |
---|---|---|
classifier_parameters |
dict
|
|
fit_parameters |
dict
|
|
predict_parameters |
dict
|
|
Source code in src/spyglass/decoding/v0/clusterless.py
ClusterlessClassifierParameters
¶
Bases: SpyglassMixin
, Manual
Decodes animal's mental position.
Decodes the animal's mental position and some category of interest from unclustered spikes and spike waveform features
Source code in src/spyglass/decoding/v0/clusterless.py
insert_default()
¶
Insert the default parameter set
Source code in src/spyglass/decoding/v0/clusterless.py
insert1(key, **kwargs)
¶
MultiunitFiringRate
¶
Bases: SpyglassMixin
, Computed
Computes the population multiunit firing rate from the spikes in MarksIndicator.
Source code in src/spyglass/decoding/v0/clusterless.py
MultiunitHighSynchronyEventsParameters
¶
Bases: SpyglassMixin
, Manual
Params to extract times of high mulitunit activity during immobility.
Source code in src/spyglass/decoding/v0/clusterless.py
insert_default()
¶
Insert the default parameter set
Source code in src/spyglass/decoding/v0/clusterless.py
get_decoding_data_for_epoch(nwb_file_name, interval_list_name, position_info_param_name='default_decoding', additional_mark_keys={})
¶
Collects necessary data for decoding.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nwb_file_name |
str
|
|
required |
interval_list_name |
str
|
|
required |
position_info_param_name |
str
|
|
'default_decoding'
|
additional_mark_keys |
dict
|
|
{}
|
Returns:
Name | Type | Description |
---|---|---|
position_info |
(DataFrame, shape(n_time, n_columns))
|
|
marks |
(DataArray, shape(n_time, n_marks, n_electrodes))
|
|
valid_slices |
list[slice]
|
|
Source code in src/spyglass/decoding/v0/clusterless.py
get_data_for_multiple_epochs(nwb_file_name, epoch_names, position_info_param_name='default_decoding', additional_mark_keys={})
¶
Collects necessary data for decoding multiple environments
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nwb_file_name |
str
|
|
required |
epoch_names |
list[str]
|
|
required |
position_info_param_name |
str
|
|
'default_decoding'
|
additional_mark_keys |
dict
|
|
{}
|
Returns:
Name | Type | Description |
---|---|---|
position_info |
(DataFrame, shape(n_time, n_columns))
|
|
marks |
(DataArray, shape(n_time, n_marks, n_electrodes))
|
|
valid_slices |
dict[str, list[slice]]
|
|
environment_labels |
(ndarray, shape(n_time))
|
|
Source code in src/spyglass/decoding/v0/clusterless.py
populate_mark_indicators(spikesorting_selection_keys, mark_param_name='default', position_info_param_name='default_decoding')
¶
Populate mark indicators
Populates for all units in a given spike sorting selection.
This function is a way to do several pipeline steps at once. It will: 1. Populate the SpikeSortingSelection table 2. Populate the SpikeSorting table 3. Populate the Curation table 4. Populate the CuratedSpikeSortingSelection table 5. Populate UnitMarks 6. Compute UnitMarksIndicator for each position epoch
Parameters:
Name | Type | Description | Default |
---|---|---|---|
spikesorting_selection_keys |
dict
|
|
required |
mark_param_name |
str
|
|
'default'
|
position_info_param_name |
str
|
|
'default_decoding'
|