EnnyvanBeest/UnitMatch

ReadMeta2 returns a nonsensical output

Closed this issue · 2 comments

Hi Enny,
Thank you for this cool toolbox! Looks very promising :):)
I'm trying to run the DEMO_UNITMATCH.m and I get the following error:

Invalid field name: 'M . # ) B ) • ‰ 3 Êÿ‰ � � ðÿP i g þÿ� � ) � g ´ÿ(
u ! � ‹ � Äÿ¬ÿ# � 5 ÷ÿI � g q � &'.

Error in setfield (line 35)
s.(deblank(strField)) = varargin{end};

Error in ReadMeta2 (line 35)
meta = setfield(meta, tag, C{2}{i});

Error in ExtractKilosortData (line 374)
[Imecmeta] = ReadMeta2(fullfile(rawD(id).folder, strrep(rawD(id).name, 'cbin', 'meta')), 'ap');

Error in DEMO_UNITMATCH (line 51)
UMparam = ExtractKilosortData(UMparam.KSDir, UMparam); % Extract KS data and do some noise removal, optionally decompresses cbin to bin data and uses BOMBCELL quality metric to define good single units

The problem seems to be in ReadMeta2. In particular, line 21 (textscan functions), returns a nonsensical output.

Please help?
All the best,
Valerio

Hi Valerio,

thank you for trying out UnitMatch and raising an issue.

Can you double check the exact input to line 17 of ReadMeta2.m, by putting a debug point there?
What excatly is your file consisting off? Is this indeed a .meta file as acquired by SpikeGLX? If so, what version of SpikeGLX did you use? And what version of Matlab?

If you wish, you are also welcome to send me your meta file (ennyvanbeest@gmail.com) so that I can debug it more easily.

Best wishes,
Enny

Hi Enny,
Apologies for taking this long to get back to you.
The issue had to do with line 374 in ExtractKilosortData:
[Imecmeta] = ReadMeta2(fullfile(rawD(id).folder, strrep(rawD(id).name, 'cbin', 'meta')), 'ap');
this is because my SpikeGLX files are saved as '.bin' as opposed to '.cbin' and that created nonsensical file names.

I'm using SpikeGLX v.20230815, Imec phase30 v3.62 with Matlab 2021b (and replicated in 2023b)

Thank you for your help,
Valerio