Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Error when opening SpikeGLX output, "key already in signals_info_dict" #1145

Open
2 tasks done
kailasas-um opened this issue Nov 17, 2024 · 3 comments
Open
2 tasks done
Labels

Comments

@kailasas-um
Copy link

What happened?

Hi, I'm attempting to convert SpikeGLX ap.bin and lf.bin outputs into NWB format. When attempting to create a DataInterface object, I receive the error below. Any help in figuring out what's gone wrong would be greatly appreciated!

Steps to Reproduce

from neuroconv.datainterfaces import SpikeGLXRecordingInterface
path=f"[my-path]" 
interface = SpikeGLXRecordingInterface(file_path=path)

Traceback

>>> interface = SpikeGLXRecordingInterface(file_path=path)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/nfs/turbo/*/processNeuropixels/lib/python3.12/site-packages/pydantic/validate_call_decorator.py", line 60, in wrapper_function
    return validate_call_wrapper(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nfs/turbo/*/processNeuropixels/lib/python3.12/site-packages/pydantic/_internal/_validate_call.py", line 96, in __call__
    res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, kwargs))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nfs/turbo/*/processNeuropixels/lib/python3.12/site-packages/neuroconv/datainterfaces/ecephys/spikeglx/spikeglxdatainterface.py", line 82, in __init__
    super().__init__(
  File "/nfs/turbo/*/processNeuropixels/lib/python3.12/site-packages/neuroconv/datainterfaces/ecephys/baserecordingextractorinterface.py", line 36, in __init__
    super().__init__(**source_data)
  File "/nfs/turbo/*/processNeuropixels/lib/python3.12/site-packages/neuroconv/baseextractorinterface.py", line 37, in __init__
    self._extractor_instance = self.extractor(**self.extractor_kwargs)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nfs/turbo/*/processNeuropixels/lib/python3.12/site-packages/spikeinterface/extractors/neoextractors/spikeglx.py", line 65, in __init__
    NeoBaseRecordingExtractor.__init__(
  File "/nfs/turbo/*/processNeuropixels/lib/python3.12/site-packages/spikeinterface/extractors/neoextractors/neobaseextractor.py", line 188, in __init__
    _NeoBaseExtractor.__init__(self, block_index, **neo_kwargs)
  File "/nfs/turbo/*/processNeuropixels/lib/python3.12/site-packages/spikeinterface/extractors/neoextractors/neobaseextractor.py", line 27, in __init__
    self.neo_reader = self.get_neo_io_reader(self.NeoRawIOClass, **neo_kwargs)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nfs/turbo/*/processNeuropixels/lib/python3.12/site-packages/spikeinterface/extractors/neoextractors/neobaseextractor.py", line 66, in get_neo_io_reader
    neo_reader.parse_header()
  File "/nfs/turbo/*/processNeuropixels/lib/python3.12/site-packages/neo/rawio/baserawio.py", line 199, in parse_header
    self._parse_header()
  File "/nfs/turbo/*/processNeuropixels/lib/python3.12/site-packages/neo/rawio/spikeglxrawio.py", line 133, in _parse_header
    raise KeyError(f"key {key} is already in the signals_info_dict")
KeyError: "key (0, 'imec0.lf') is already in the signals_info_dict"

Operating System

Linux

Python Executable

Python

Python Version

3.12

Package Versions

annotated-types==0.7.0
asciitree==0.3.3
attrs==24.2.0
click==8.1.7
docstring_parser==0.16
faiss-cpu==1.9.0
fasteners==0.19
filelock==3.16.1
fsspec==2024.10.0
h5py==3.12.1
hdmf==3.14.5
hdmf_zarr==0.9.0
Jinja2==3.1.4
joblib==1.4.2
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
kilosort==4.0.20
llvmlite==0.43.0
MarkupSafe==3.0.2
mpmath==1.3.0
neo==0.13.4
networkx==3.4.2
neuroconv==0.6.5
numba==0.60.0
numcodecs==0.14.0
numpy==1.26.4
nvidia-cublas-cu12==12.4.5.8
nvidia-cuda-cupti-cu12==12.4.127
nvidia-cuda-nvrtc-cu12==12.4.127
nvidia-cuda-runtime-cu12==12.4.127
nvidia-cudnn-cu12==9.1.0.70
nvidia-cufft-cu12==11.2.1.3
nvidia-curand-cu12==10.3.5.147
nvidia-cusolver-cu12==11.6.1.9
nvidia-cusparse-cu12==12.3.1.170
nvidia-nccl-cu12==2.21.5
nvidia-nvjitlink-cu12==12.4.127
nvidia-nvtx-cu12==12.4.127
packaging==24.2
pandas==2.2.3
parse==1.20.2
probeinterface==0.2.24
psutil==6.1.0
pydantic==2.9.2
pydantic_core==2.23.4
pynwb==2.8.2
python-dateutil==2.9.0.post0
pytz==2024.2
PyYAML==6.0.2
quantities==0.16.1
referencing==0.35.1
rpds-py==0.21.0
ruamel.yaml==0.18.6
ruamel.yaml.clib==0.2.12
scikit-learn==1.5.2
scipy==1.14.1
setuptools==75.5.0
six==1.16.0
spikeinterface==0.101.2
sympy==1.13.1
threadpoolctl==3.5.0
torch==2.5.1
tqdm==4.67.0
triton==3.1.0
typing_extensions==4.12.2
tzdata==2024.2
zarr==2.17.2

Code of Conduct

@h-mayorquin
Copy link
Collaborator

Hi, thanks for raising an issue.

This seems like a neo issue. I would suggest trying the neo reader for spikeglx and if that fails it would produce a cleaner error trace which we can fix on the side.

Two questions:

  1. Can you open an issue on neo if you get the error at the neo level.
  2. Can you share the data with us so we can debug quicker?

@h-mayorquin
Copy link
Collaborator

Hi, I think I have an idea on what's causing this? Can you show me thee tree output of the folder that you are trying to convert?

@h-mayorquin
Copy link
Collaborator

I think this neo PR should solve this problem:
NeuralEnsemble/python-neo#1608

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants