Commit 8f46414
Fix KeyError in ApplyOfficialCuration.make for multi-insertion probes
For SI-processed data, Kilosort's spike_sites contains device_channel_indices
(sequential 0, 1, 2...) which differ from the original channel_idx in
EphysRecording.Channel (e.g., 32-63 for insertion #2 on MBA probes).
The fix:
1. Fetches sorting_analyzer files from external storage (S3) if not local
2. Uses the sorting_analyzer's probe to correctly map channel indices
to electrodes via device_channel_indices and contact_ids
3. Falls back to original behavior for non-SI processed data
Follows the same pattern as CuratedClustering.make() in ephys.py.
Fixes: dj-sciops/nei_nienborg#111 (Issue #1)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 1dd8679 commit 8f46414
1 file changed
Lines changed: 38 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
409 | 413 | | |
410 | 414 | | |
411 | 415 | | |
412 | | - | |
413 | | - | |
414 | | - | |
| 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 | + | |
415 | 450 | | |
416 | 451 | | |
417 | 452 | | |
| |||
0 commit comments