Open lawrence-mbf opened 1 year ago
Note that if the Spike event data is transposed on write, NWB Inspector will not throw an error but will emits this critical message:
UserWarning: SpikeEventSeries 'unit1SS': The second dimension of data does not match the length of electrodes, but instead the first does. Data is oriented incorrectly and should be transposed.
@ lawrence-mbf could you clarify how this file is being created? From the error it looks like the error is due to PyNWB not being able to open the file due to the error check in SpikeEventSeries.__init__
here https://github.com/NeurodataWithoutBorders/pynwb/blob/f0b3317b1dcd87bc89671145105db2141f23f65d/src/pynwb/ecephys.py#L122-L125
This was constructed by a MatNWB script. However, it doesn't appear to satisfy the nwbinspector whichever way the data is transposed, despite the nwbinspector instructions.
I looked through the generated data manually but there doesn't seem to be anything that jumps out as wrong.
However, it doesn't appear to satisfy the nwbinspector whichever way the data is transposed, despite the nwbinspector instructions.
I downloaded the file myself to check it out; I can clarify the electrodes seems to be the second dimension of those fields in the /analysis
group of the file
Just to clarify, it's NWBHDF5IO.read()
that is complaining, which can also be verified against more fundamental python -m pynwb.validate BAYLORNL23_20190320-2.6.0.2.newWT.nwb
which gives
TimeSeriesReferenceVectorData (intervals/trials/timeseries): incorrect type - expected '['int32', 'int32', 'object']', got '['object', 'int64', 'int64']'
VectorIndex/description (intervals/trials/timeseries_index.description): incorrect type - expected 'text', got 'Empty'
VectorIndex/description (units/spike_times_index.description): incorrect type - expected 'text', got 'Empty'
Units/waveforms (units/waveforms): incorrect type - expected 'numeric', got 'object'
Units/waveforms (units/waveforms): incorrect shape - expected '[None, None]', got '(9,)'
VectorData/description (units/trials_index.description): incorrect type - expected 'text', got 'Empty'
hope that extra info helps solve the problem
Thanks @CodyCBakerPhD. In terms of read, I suspect that the bad data type for TimeSeriesReferenceVectorData
and the units/waveforms
are likely the biggest issues.
Is the solution then to attempt to fix these other problems and assume the data is correct? We're primarily focused on the /analysis
datasets currently but these other issues do crop up on the nwbinspector as well.
Below is a link to the NWB file with non-transposed datasets:
This file emits the warnings as mentioned in https://github.com/NeurodataWithoutBorders/pynwb/issues/1746#issuecomment-1656093127
The .new.nwb (non-transposed) has the following invalidations
python -m pynwb.validate BAYLORNL23_20190320-2.6.0.2.new.nwb
> Validating BAYLORNL23_20190320-2.6.0.2.new.nwb against cached namespace information using namespace 'core'.
- found the following errors:
TimeSeriesReferenceVectorData (intervals/trials/timeseries): incorrect type - expected '['int32', 'int32', 'object']', got '['object', 'int64', 'int64']'
VectorIndex/description (intervals/trials/timeseries_index.description): incorrect type - expected 'text', got 'Empty'
VectorIndex/description (units/spike_times_index.description): incorrect type - expected 'text', got 'Empty'
Units/waveforms (units/waveforms): incorrect type - expected 'numeric', got 'object'
Units/waveforms (units/waveforms): incorrect shape - expected '[None, None]', got '(9,)'
VectorData/description (units/trials_index.description): incorrect type - expected 'text', got 'Empty'
The validator doesn't seem to check for transposition, but once the file is valid we can try simply reading it with PyNWB, and it is that step that triggers the constructor error or warning
What happened?
Currently converting data to fit DANDI requirement through MatNWB: https://github.com/NeurodataWithoutBorders/matnwb/issues/527
The data reads fine in MatNWB but actually causes the NWB Inspector to throw and error.
The file itself is 1.3 GB so its download link is provided here: https://mbfbioscience-my.sharepoint.com/:u:/p/lawrence/EX0x5jQ9EelAmOXc_hm0eWQBf5GSkY6spXjBhdIUlHAeCg?e=f2g4cq
Steps to Reproduce
Traceback
Operating System
Windows
Python Executable
Conda
Python Version
3.10
Package Versions
issue_environment.txt
Code of Conduct