Closed ryaoki closed 3 years ago
This looks like because we assert that colnames
matches the name of the column stored in the DynamicTable
exactly. If you replace colnames
temporarily with the deblank
ed version that will work as a workaround.
nwb.units.colnames = deblank(nwb.units.colnames);
nwb.units.getRow(unit_ids(1), 'useID', true, 'columns', nwb.units.colnames(6))) % should work
I have a hunch this was legacy MatNWB behavior but I cannot say for certain until I know how this data was created. This is certainly not recreatable in current MatNWB.
This looks like because we assert that
colnames
matches the name of the column stored in theDynamicTable
exactly.
For a valid NWB file, this should be the case. colnames
is used to indicate the order of columns in the table, and as such the values in colnames
should match the names of the column datasets. As such, this seems to be an error in the file.
The workaround worked. Thank you very much!
When I tried to load spike time from one of the datasets of Steinmetz et al, 2019 (https://figshare.com/articles/dataset/Datasets_from_Steinmetz_et_al_2019_in_NWB_format/11274968/1) with the following snippet,
unit_colnames{6}
ans =nwb.units.getRow(unit_ids(1), 'useID', true, 'columns', unit_colnames(6))
and I got the following error.It seems to be related to the fact that column name ('spike_times ') have extra spaces at the end, but when I tried with "deblanking", it returned another error.
nwb.units.getRow(unit_ids(1), 'useID', true, 'columns', deblank(unit_colnames(6)))
Thank you in advance.