catalystneuro / distributed-coding-matnwb

Converting the "Distributed coding" dataset to NWB using MATLAB
BSD 2-Clause "Simplified" License
1 stars 1 forks source link

psth function doesn't work with published DANDIset #12

Closed cechava closed 2 years ago

cechava commented 2 years ago

using Steinmetz et al., 2019 DANDIset

The snippet below reproduces the error


DANDIset_folder = '~/DANDIsets/000017/';
filepath = [DANDIset_folder 'sub-Moniz/sub-Moniz_ses-20170515T120000.nwb'];
% read in file
nwb_file = nwbRead(filepath);

psth(...
   nwb_file, ...
   unit_id = 5, ...
   group_by = 'visual_stimulus_left_contrast', ...
   before_time = -1, ...
   after_time = 1, ...
   n_bins = 50, ...
   psth_plot_option = 'gaussian', ...
   std = 0.03);

Error using cat
Dimensions of arrays being concatenated are not consistent.

Error in cell2mat (line 75)
            m{n} = cat(2,c{n,:});

Error in psth (line 162)
        group_spike_times = cell2mat(groupby_spike_times{u});
bendichter commented 2 years ago

This seems like it could be an array transpose issue

cechava commented 2 years ago

indeed, that's what it is

cechava commented 2 years ago

fixed with merge of PR #14