python-neo
python-neo copied to clipboard
index error with a spikeglx neuropixels files
When I try to open a set of imec.ap.bin/imec.ap.meta files I get this error (when I pass the folder in which only these two files are present):
>>> from neo import SpikeGLXIO
>>> sg = SpikeGLXIO('/mnt/scrap/catalyst_neuro/sakshamsharda/shenoy/PrimateNeuropixel/P20180323')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/sakshamsharda/miniconda3/envs/giocomo_lab_nwb/lib/python3.7/site-packages/neo/io/spikeglxio.py", line 11, in __init__
BaseFromRaw.__init__(self, dirname)
File "/home/sakshamsharda/miniconda3/envs/giocomo_lab_nwb/lib/python3.7/site-packages/neo/io/basefromrawio.py", line 74, in __init__
self.parse_header()
File "/home/sakshamsharda/miniconda3/envs/giocomo_lab_nwb/lib/python3.7/site-packages/neo/rawio/baserawio.py", line 185, in parse_header
self._parse_header()
File "/home/sakshamsharda/miniconda3/envs/giocomo_lab_nwb/lib/python3.7/site-packages/neo/rawio/spikeglxrawio.py", line 67, in _parse_header
self.signals_info_list = scan_files(self.dirname)
File "/home/sakshamsharda/miniconda3/envs/giocomo_lab_nwb/lib/python3.7/site-packages/neo/rawio/spikeglxrawio.py", line 221, in scan_files
seg_index = int(r[0][0])
The folder contains the files named: P20180613/P20180613.imec.ap.bin P20180613/P20180613.imec.ap.meta
Are the files expected to be in a specific naming format?
if a folder only contains 1 of .ap.bin and .meta file without the tags of '*.g0_t0.imec0*ap.in' in the file name, then would it make sense to assume only 1 segment and stream?
Currently the header pulls the segment and stream from the file name like here .I'm not sure if the above mentioned file naming scheme is an edge case or something that can be incorporated into the api?
Yes of course. We have to change this and add any pattern which is possible. Can you make a PR ?
@Saksham20 Any news on this?
Same issue as https://github.com/NeuralEnsemble/python-neo/issues/1337 conceptually. Can be fixed together.
I think with our newest version of spikeglx we cover many more regex possibilities. Feel free to reopen if the latest version doesn't cover your issue.