spikeinterface: Probe missing when using run_sorter()
Hi, I hope this is just a user error on my part. I am trying to spike sort some data, the sorters appear to be working. However, even though a probe appears to be attached to the recording, run_sorter() says there is none. I have this issue for other sorters that require a probe map as well (spykingcircuis, kilosort, etc.), but not for mountainsort5 (I’m assuming due to some inherent difference in computation in MS5 not needing the probe).
import matplotlib.pyplot as plt
from pprint import pprint
import spikeinterface.full as si
from pathlib import Path
from probeinterface import get_probe
from probeinterface.plotting import plot_probe
import numpy as np
camb_64x1 = get_probe('cambridgeneurotech','ASSY-77-H3') #64x1 probe catalog number
camb64x1_tdt_map = np.array([12, 11, 4, 8, 16, 64, 1, 2, 13, 9, 10, 14, 6, 7, 5, 3, 50, 49, 52,
51, 54, 53, 56, 55, 15, 63, 62, 61, 59, 60, 57, 58, 23, 28, 21, 22, 20,
19, 18, 17, 42, 24, 29, 25, 30, 26, 31, 27, 46, 45, 40, 34, 37, 32, 33,
41, 44, 47, 48, 43, 35, 38, 39, 36])
camb64x1_tdt_map = camb64x1_tdt_map - 1 # subtract for python indexing
camb_64x1.set_device_channel_indices(camb64x1_tdt_map)
base_folder = Path('E:/PFC_DREADDS/Record-230306-100339/r392_pfc_spon_bl1/') # so we can save binary files and such to the same data folder
tdt_tank = base_folder / 'Record-230306-100339_r392_pfc_spon_bl1.Tbk'
raw_data = si.read_tdt(tdt_tank,stream_name="b'SPKw'")
raw_data = raw_data.set_probe(camb_64x1)
probe_df = raw_data.get_probe().to_dataframe()
print(probe_df)
The output confirming the probe:
c:\Users\admin\anaconda3\envs\si_env\lib\site-packages\neo\rawio\tdtrawio.py:293: UserWarning: Could not identify sev files for channels [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64]. warnings.warn(f"Could not identify sev files for channels {missing_sev_channels}.") x y contact_shapes width height shank_ids contact_ids 0 0.0 880.0 rect 11.0 15.0 7 1 0.0 700.0 rect 11.0 15.0 8 2 0.0 1160.0 rect 11.0 15.0 16 3 0.0 920.0 rect 11.0 15.0 3 4 0.0 800.0 rect 11.0 15.0 15 … … … … … … … … 59 0.0 1200.0 rect 11.0 15.0 30 60 0.0 980.0 rect 11.0 15.0 28 61 0.0 1100.0 rect 11.0 15.0 27 62 0.0 1020.0 rect 11.0 15.0 26 63 0.0 680.0 rect 11.0 15.0 6
[64 rows x 7 columns]
Probe not showing up for sorting
sorting = si.run_sorter(recording=raw_data, sorter_name='tridesclous2', output_folder= base_folder / 'tdc_map_test')
Output:
c:\Users\admin\anaconda3\envs\si_env\lib\site-packages\neo\rawio\tdtrawio.py:293: UserWarning: Could not identify sev files for channels [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64]. warnings.warn(f"Could not identify sev files for channels {missing_sev_channels}.“) c:\Users\admin\anaconda3\envs\si_env\lib\site-packages\spikeinterface\core\baserecordingsnippets.py:244: UserWarning: There is no Probe attached to this recording. Creating a dummy one with contact positions warn(“There is no Probe attached to this recording. Creating a dummy one with contact positions”) c:\Users\admin\anaconda3\envs\si_env\lib\site-packages\neo\rawio\tdtrawio.py:293: UserWarning: Could not identify sev files for channels [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64]. warnings.warn(f"Could not identify sev files for channels {missing_sev_channels}.”)
Thank you very much for your help and this interface, Walker
About this issue
- Original URL
- State: closed
- Created 5 months ago
- Comments: 20 (9 by maintainers)
Sorry for the delay. I used a different temp directory with the
temporary_base_dirparameter as suggested, and it seems to have fixed the issue. Thanks for the help everyone.This might be worth just opening another issue @jesusdpa1, but I would try two things:
temporary_base_dirmaybe not so nested inside your data folder. This file should get cleaned up so it shouldn’t really matter where it gets put. So I would try putting it in a less nested spot. Also make sure your c drive has enough space to contain the.datfile which depending on your recording could be many gigabyes.Another option is to try a different temp dir with the
temporary_base_dirparameter. It might be an issue due to a limited size of the default tempdir