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

Issue with Spike Sorting Data from matlab file #3343

Open
ajcheng1 opened this issue Aug 27, 2024 · 28 comments
Open

Issue with Spike Sorting Data from matlab file #3343

ajcheng1 opened this issue Aug 27, 2024 · 28 comments
Labels
NEO Problem related to NEO IO question General question regarding SI

Comments

@ajcheng1
Copy link

This is a bit of a continuation of #3340. I was able to successfully load the matlab file into .bin using this simple two line code into matlab and convert it to bin.
image

Loading data into spikeinterface seems to work properly
image

Pre-processsing runs fine
image

But when I sort, I get this error for three different spike sorter tools:
image

  1. Mountain sort5 - numpy.linalg.LinAlgError: SVD did not converge
  2. Spyking Circus & tridesclous2 - ValueError: Digital filter critical frequencies must be 0 < Wn < fs/2 (fs=12500.0 -> fs/2=6250.0) Spike sorting failed. You can inspect the runtime trace in C:\Users\Shado\SHJ\spykingcircus2_output/spikeinterface_log.json.

The error message is lengthy, but I can add it here if needed. Is there any advice on this? I can also share the matlab file.

@chrishalcrow
Copy link
Collaborator

Hey @ajcheng1 , if there are problems with several spike sorters, there might be something wrong with the data (probably something silly - it always is!). I'd recommend taking a look at your data and seeing if it looks like you'd expect.

You can use widgets (https://spikeinterface.readthedocs.io/en/latest/modules/widgets.html) to visualise; and plot_traces to look at your raw/preprocessed data. There's some more explanation/examples in the overview_tutorial which was done at a recent workshop in Edinburgh: https://github.com/SpikeInterface/SpikeInterface-Training-Edinburgh-May24 .

@zm711
Copy link
Collaborator

zm711 commented Aug 29, 2024

I would say the problem is that this is ~3 seconds long.

37149/12500 = 2.97 seconds.

I doubt any sorter is going to be able to do much with 3 seconds of data.

@zm711
Copy link
Collaborator

zm711 commented Aug 29, 2024

Are you sure that this data should have 384 channels? Is it a neuropixel dataset? Maybe this is something like tetrode data which would by ~5 minutes or even a monotrode dataset which would be ~20 minutes. Neither very long or super easy to sort with. I think @chrishalcrow is right that you likely need to explore your raw data more so that we have a better idea of what you are actually working with.

@ajcheng1
Copy link
Author

Hi @zm711, good insight. It's MEA data that I exported from plexon. I am looking at the matlab files and it contains a bunch of arrays from each channel.
image
and it seems to include the channel number within the matrix and a column of 0 to separate it from the rest of the data point.
image

let me do some more digging into it, but I appreciate the pointers. I believe it's roughly 3 seconds because plexon has already divided up the recording into 3 second intervals of waveforms.

@zm711
Copy link
Collaborator

zm711 commented Aug 29, 2024

No sorter that I know works with waveform snippets any more (legacy ones do), so you need to get the raw data from Plexon rather than the waveform snippet data. @h-mayorquin since you've thought the most about this recent for plexon what should this person be looking for to get the raw data rather than waveform snippets?

@zm711
Copy link
Collaborator

zm711 commented Aug 29, 2024

As a side note @ajcheng1 we have a plexon reader ie

import spikeinterface.extractors as se
recording = se.read_plexon('put_plexon_file_here.plx')

Do you not have access to the raw data any more? I'm worried that someone may have just left you the snippet data which might not serve you too well.

@h-mayorquin
Copy link
Collaborator

Which plexon data is that? Is it plexon2 or plexon1? Is it wideband?
I would just run the sorting directly in the plexon recording as @zm711 suggested.

@ajcheng1
Copy link
Author

It's plexon1. It's related to the issue of plexon containing different streams.
image

@zm711
Copy link
Collaborator

zm711 commented Aug 29, 2024

This seems like an issue with our extractor @h-mayorquin ? Maybe we need to fix that unless you think a stream_id needs to be specified for this reader. Could you try:

from neo.rawio import PlexonRawIO

reader = PlexonRawIO(file_path)
reader.parse_header()

and see if that has any errors.

@h-mayorquin
Copy link
Collaborator

h-mayorquin commented Aug 29, 2024

Can you update neo to its latest version? I just fixed this and this was included in a release.
Just do:

from spikeinterface.extractors import read_plexon

stream_name = "WB-Wideband"
read_plexon(file_path, stream_name=stream_name)

@ajcheng1
Copy link
Author

Just to confirm, is it python neo 0.13.3?
image

I get this error in which the file does not have wideband for some reason.
image

@h-mayorquin
Copy link
Collaborator

Yes, for some reason your recording does not have streams.

Can you run the code that @zm711 suggested and print the header:

from neo.rawio import PlexonRawIO

reader = PlexonRawIO(file_path)
reader.parse_header()
print(reader.header)

@ajcheng1
Copy link
Author

ajcheng1 commented Aug 29, 2024

A bit messy to look at so I took a screenshot as well. I believe my file only has "SPK channels" and not wideband channels though not entirely sure.
image

Header info
`Parsing event channels: 100%|██████████| 1/1 [00:00<00:00, 7463.17it/s]{'nb_block': 1, 'nb_segment': [1], 'signal_streams': array([], dtype=[('name', '<U64'), ('id', '<U64')]), 'signal_channels': array([],
      dtype=[('name', '<U64'), ('id', '<U64'), ('sampling_rate', '<f8'), ('dtype', '<U16'), ('units', '<U64'), ('gain', '<f8'), ('offset', '<f8'), ('stream_id', '<U64')]), 'spike_channels': array([('A1_11', 'ch1#0', '', 9.25663358e-07, 0., -1, 12500.),
       ('A1_12', 'ch2#0', '', 1.39436687e-06, 0., -1, 12500.),
       ('A1_13', 'ch3#0', '', 1.71408549e-06, 0., -1, 12500.),
       ('A1_14', 'ch4#0', '', 6.14320070e-07, 0., -1, 12500.),
       ('A1_21', 'ch5#0', '', 9.15618906e-07, 0., -1, 12500.),
       ('A1_22', 'ch6#0', '', 1.56677165e-06, 0., -1, 12500.),
       ('A1_23', 'ch7#0', '', 3.11344555e-07, 0., -1, 12500.),
       ('A1_24', 'ch8#0', '', 2.06558072e-06, 0., -1, 12500.),
       ('A1_31', 'ch9#0', '', 8.10165341e-07, 0., -1, 12500.),
       ('A1_32', 'ch10#0', '', 1.29558812e-06, 0., -1, 12500.),
       ('A1_33', 'ch11#0', '', 1.30061277e-06, 0., -1, 12500.),
       ('A1_34', 'ch12#0', '', 5.44017674e-07, 0., -1, 12500.),
       ('A1_41', 'ch13#0', '', 4.56973108e-07, 0., -1, 12500.),
       ('A1_42', 'ch14#0', '', 1.13155192e-06, 0., -1, 12500.),
       ('A1_43', 'ch15#0', '', 6.74580633e-07, 0., -1, 12500.),
       ('A1_44', 'ch16#0', '', 1.71910647e-06, 0., -1, 12500.),
       ('A2_11', 'ch17#0', '', 3.19714254e-07, 0., -1, 12500.),
       ('A2_12', 'ch18#0', '', 9.15618906e-07, 0., -1, 12500.),
       ('A2_13', 'ch19#0', '', 1.42783429e-06, 0., -1, 12500.),
       ('A2_14', 'ch20#0', '', 6.37753714e-07, 0., -1, 12500.),
       ('A2_21', 'ch21#0', '', 7.66644903e-07, 0., -1, 12500.),
       ('A2_22', 'ch22#0', '', 1.02442357e-06, 0., -1, 12500.),
       ('A2_23', 'ch23#0', '', 5.03842597e-07, 0., -1, 12500.),
       ('A2_24', 'ch24#0', '', 2.49410842e-07, 0., -1, 12500.),
       ('A2_31', 'ch25#0', '', 6.37753714e-07, 0., -1, 12500.),
       ('A2_32', 'ch26#0', '', 6.05952348e-07, 0., -1, 12500.),
       ('A2_33', 'ch27#0', '', 9.13946217e-07, 0., -1, 12500.),
       ('A2_34', 'ch28#0', '', 2.72845418e-07, 0., -1, 12500.),
       ('A2_41', 'ch29#0', '', 5.54059153e-07, 0., -1, 12500.),
       ('A2_42', 'ch30#0', '', 1.00099204e-06, 0., -1, 12500.),
       ('A2_43', 'ch31#0', '', 8.21882098e-07, 0., -1, 12500.),
       ('A2_44', 'ch32#0', '', 1.77934687e-06, 0., -1, 12500.),
       ('A3_11', 'ch33#0', '', 1.11314375e-06, 0., -1, 12500.),
       ('A3_12', 'ch34#0', '', 1.16001133e-06, 0., -1, 12500.),
       ('A3_13', 'ch35#0', '', 3.71605158e-07, 0., -1, 12500.),
       ('A3_14', 'ch36#0', '', 1.02275274e-06, 0., -1, 12500.),
       ('A3_21', 'ch37#0', '', 3.02975172e-07, 0., -1, 12500.),
       ('A3_22', 'ch38#0', '', 5.47364504e-07, 0., -1, 12500.),
       ('A3_23', 'ch39#0', '', 8.28576523e-07, 0., -1, 12500.),
       ('A3_24', 'ch40#0', '', 3.18040520e-07, 0., -1, 12500.),
       ('A3_31', 'ch41#0', '', 7.83385823e-07, 0., -1, 12500.),
       ('A3_32', 'ch42#0', '', 7.06387266e-07, 0., -1, 12500.),
       ('A3_33', 'ch43#0', '', 4.23496456e-07, 0., -1, 12500.),
       ('A3_34', 'ch44#0', '', 1.04451443e-06, 0., -1, 12500.),
       ('A3_41', 'ch45#0', '', 2.56106609e-07, 0., -1, 12500.),
       ('A3_42', 'ch46#0', '', 7.88404932e-07, 0., -1, 12500.),
       ('A3_43', 'ch47#0', '', 2.42715400e-07, 0., -1, 12500.),
       ('A3_44', 'ch48#0', '', 9.20646136e-07, 0., -1, 12500.),
       ('A4_11', 'ch49#0', '', 2.17941188e-06, 0., -1, 12500.),
       ('A4_12', 'ch50#0', '', 9.03903149e-07, 0., -1, 12500.),
       ('A4_13', 'ch51#0', '', 4.31872892e-06, 0., -1, 12500.),
       ('A4_14', 'ch52#0', '', 8.05142330e-07, 0., -1, 12500.),
       ('A4_21', 'ch53#0', '', 1.23868889e-06, 0., -1, 12500.),
       ('A4_22', 'ch54#0', '', 1.27551631e-06, 0., -1, 12500.),
       ('A4_23', 'ch55#0', '', 1.55337362e-06, 0., -1, 12500.),
       ('A4_24', 'ch56#0', '', 1.83626969e-06, 0., -1, 12500.),
       ('A4_31', 'ch57#0', '', 5.84191469e-07, 0., -1, 12500.),
       ('A4_32', 'ch58#0', '', 5.23930906e-07, 0., -1, 12500.),
       ('A4_33', 'ch59#0', '', 6.66211146e-07, 0., -1, 12500.),
       ('A4_34', 'ch60#0', '', 1.34749326e-06, 0., -1, 12500.),
       ('A4_41', 'ch61#0', '', 2.84562987e-07, 0., -1, 12500.),
       ('A4_42', 'ch62#0', '', 7.43213333e-07, 0., -1, 12500.),
       ('A4_43', 'ch63#0', '', 6.00928996e-07, 0., -1, 12500.),
       ('A4_44', 'ch64#0', '', 1.27551631e-06, 0., -1, 12500.),
       ('A5_11', 'ch65#0', '', 6.81277045e-07, 0., -1, 12500.),
       ('A5_12', 'ch66#0', '', 1.33577575e-06, 0., -1, 12500.),
       ('A5_13', 'ch67#0', '', 1.12653945e-06, 0., -1, 12500.),
       ('A5_14', 'ch68#0', '', 4.40235688e-07, 0., -1, 12500.),
       ('A5_21', 'ch69#0', '', 5.92558991e-07, 0., -1, 12500.),
       ('A5_22', 'ch70#0', '', 9.92624488e-07, 0., -1, 12500.),
       ('A5_23', 'ch71#0', '', 1.17675524e-06, 0., -1, 12500.),
       ('A5_24', 'ch72#0', '', 6.61188113e-07, 0., -1, 12500.),
       ('A5_31', 'ch73#0', '', 2.17439103e-06, 0., -1, 12500.),
       ('A5_32', 'ch74#0', '', 1.22696885e-06, 0., -1, 12500.),
       ('A5_33', 'ch75#0', '', 8.70430347e-07, 0., -1, 12500.),
       ('A5_34', 'ch76#0', '', 1.03112699e-06, 0., -1, 12500.),
       ('A5_41', 'ch77#0', '', 4.63670838e-07, 0., -1, 12500.),
       ('A5_42', 'ch78#0', '', 1.53496076e-06, 0., -1, 12500.),
       ('A5_43', 'ch79#0', '', 1.78772035e-06, 0., -1, 12500.),
       ('A5_44', 'ch80#0', '', 3.61397128e-06, 0., -1, 12500.),
       ('A6_11', 'ch81#0', '', 8.38625395e-07, 0., -1, 12500.),
       ('A6_12', 'ch82#0', '', 4.26843154e-07, 0., -1, 12500.),
       ('A6_13', 'ch83#0', '', 5.20582343e-07, 0., -1, 12500.),
       ('A6_14', 'ch84#0', '', 6.81277045e-07, 0., -1, 12500.),
       ('A6_21', 'ch85#0', '', 4.51951575e-07, 0., -1, 12500.),
       ('A6_22', 'ch86#0', '', 5.60754680e-07, 0., -1, 12500.),
       ('A6_23', 'ch87#0', '', 7.26470628e-07, 0., -1, 12500.),
       ('A6_24', 'ch88#0', '', 1.02777012e-06, 0., -1, 12500.),
       ('A6_31', 'ch89#0', '', 3.48170153e-07, 0., -1, 12500.),
       ('A6_32', 'ch90#0', '', 6.86297212e-07, 0., -1, 12500.),
       ('A6_33', 'ch91#0', '', 1.03948606e-06, 0., -1, 12500.),
       ('A6_34', 'ch92#0', '', 1.29558812e-06, 0., -1, 12500.),
       ('A6_41', 'ch93#0', '', 4.87104406e-07, 0., -1, 12500.),
       ('A6_42', 'ch94#0', '', 3.01302041e-07, 0., -1, 12500.),
       ('A6_43', 'ch95#0', '', 1.03948606e-06, 0., -1, 12500.),
       ('A6_44', 'ch96#0', '', 6.36083250e-07, 0., -1, 12500.),
       ('B1_11', 'ch97#0', '', 1.80948562e-06, 0., -1, 12500.),
       ('B1_12', 'ch98#0', '', 1.15331857e-06, 0., -1, 12500.),
       ('B1_13', 'ch99#0', '', 9.65837837e-07, 0., -1, 12500.),
       ('B1_14', 'ch100#0', '', 8.72096917e-07, 0., -1, 12500.),
       ('B1_21', 'ch101#0', '', 2.17439103e-06, 0., -1, 12500.),
       ('B1_22', 'ch102#0', '', 5.74145921e-07, 0., -1, 12500.),
       ('B1_23', 'ch103#0', '', 5.17235398e-07, 0., -1, 12500.),
       ('B1_24', 'ch104#0', '', 1.09304952e-06, 0., -1, 12500.),
       ('B1_31', 'ch105#0', '', 1.50984934e-06, 0., -1, 12500.),
       ('B1_32', 'ch106#0', '', 5.20582343e-07, 0., -1, 12500.),
       ('B1_33', 'ch107#0', '', 9.37387214e-07, 0., -1, 12500.),
       ('B1_34', 'ch108#0', '', 8.41972616e-07, 0., -1, 12500.),
       ('B1_41', 'ch109#0', '', 2.34345604e-07, 0., -1, 12500.),
       ('B1_42', 'ch110#0', '', 6.87973296e-07, 0., -1, 12500.),
       ('B1_43', 'ch111#0', '', 8.30252146e-07, 0., -1, 12500.),
       ('B1_44', 'ch112#0', '', 6.54495074e-07, 0., -1, 12500.),
       ('B2_11', 'ch113#0', '', 3.93365763e-07, 0., -1, 12500.),
       ('B2_12', 'ch114#0', '', 4.58648864e-07, 0., -1, 12500.),
       ('B2_13', 'ch115#0', '', 2.22793990e-06, 0., -1, 12500.),
       ('B2_14', 'ch116#0', '', 2.24807205e-06, 0., -1, 12500.),
       ('B2_21', 'ch117#0', '', 8.68753647e-07, 0., -1, 12500.),
       ('B2_22', 'ch118#0', '', 5.69124205e-07, 0., -1, 12500.),
       ('B2_23', 'ch119#0', '', 8.82146905e-07, 0., -1, 12500.),
       ('B2_24', 'ch120#0', '', 6.49471389e-07, 0., -1, 12500.),
       ('B2_31', 'ch121#0', '', 6.37753714e-07, 0., -1, 12500.),
       ('B2_32', 'ch122#0', '', 5.75821468e-07, 0., -1, 12500.),
       ('B2_33', 'ch123#0', '', 4.26843154e-07, 0., -1, 12500.),
       ('B2_34', 'ch124#0', '', 1.58686751e-06, 0., -1, 12500.),
       ('B2_41', 'ch125#0', '', 3.19714254e-07, 0., -1, 12500.),
       ('B2_42', 'ch126#0', '', 4.41910145e-07, 0., -1, 12500.),
       ('B2_43', 'ch127#0', '', 6.89647197e-07, 0., -1, 12500.),
       ('B2_44', 'ch128#0', '', 4.55300496e-07, 0., -1, 12500.),
       ('B3_11', 'ch129#0', '', 2.67823351e-07, 0., -1, 12500.),
       ('B3_12', 'ch130#0', '', 3.09671174e-07, 0., -1, 12500.),
       ('B3_13', 'ch131#0', '', 2.97953391e-07, 0., -1, 12500.),
       ('B3_14', 'ch132#0', '', 1.59188925e-06, 0., -1, 12500.),
       ('B3_21', 'ch133#0', '', 3.48170153e-07, 0., -1, 12500.),
       ('B3_22', 'ch134#0', '', 4.85430800e-07, 0., -1, 12500.),
       ('B3_23', 'ch135#0', '', 2.69497858e-07, 0., -1, 12500.),
       ('B3_24', 'ch136#0', '', 7.90078655e-07, 0., -1, 12500.),
       ('B3_31', 'ch137#0', '', 6.02602100e-07, 0., -1, 12500.),
       ('B3_32', 'ch138#0', '', 2.29323858e-07, 0., -1, 12500.),
       ('B3_33', 'ch139#0', '', 4.20147836e-07, 0., -1, 12500.),
       ('B3_34', 'ch140#0', '', 6.07625350e-07, 0., -1, 12500.),
       ('B3_41', 'ch141#0', '', 4.40235688e-07, 0., -1, 12500.),
       ('B3_42', 'ch142#0', '', 6.41103143e-07, 0., -1, 12500.),
       ('B3_43', 'ch143#0', '', 3.21388774e-07, 0., -1, 12500.),
       ('B3_44', 'ch144#0', '', 1.19515860e-06, 0., -1, 12500.),
       ('B4_11', 'ch145#0', '', 1.18511798e-06, 0., -1, 12500.),
       ('B4_12', 'ch146#0', '', 1.06124720e-06, 0., -1, 12500.),
       ('B4_13', 'ch147#0', '', 2.65147367e-06, 0., -1, 12500.),
       ('B4_14', 'ch148#0', '', 3.06822395e-06, 0., -1, 12500.),
       ('B4_21', 'ch149#0', '', 8.90512838e-07, 0., -1, 12500.),
       ('B4_22', 'ch150#0', '', 7.44882266e-07, 0., -1, 12500.),
       ('B4_23', 'ch151#0', '', 6.87973296e-07, 0., -1, 12500.),
       ('B4_24', 'ch152#0', '', 1.80445699e-06, 0., -1, 12500.),
       ('B4_31', 'ch153#0', '', 7.04712576e-07, 0., -1, 12500.),
       ('B4_32', 'ch154#0', '', 6.21016486e-07, 0., -1, 12500.),
       ('B4_33', 'ch155#0', '', 5.79169098e-07, 0., -1, 12500.),
       ('B4_34', 'ch156#0', '', 9.60820418e-07, 0., -1, 12500.),
       ('B4_41', 'ch157#0', '', 3.14693151e-07, 0., -1, 12500.),
       ('B4_42', 'ch158#0', '', 4.82082314e-07, 0., -1, 12500.),
       ('B4_43', 'ch159#0', '', 6.87973296e-07, 0., -1, 12500.),
       ('B4_44', 'ch160#0', '', 7.44882266e-07, 0., -1, 12500.),
       ('B5_11', 'ch161#0', '', 1.80780630e-06, 0., -1, 12500.),
       ('B5_12', 'ch162#0', '', 1.22026383e-06, 0., -1, 12500.),
       ('B5_13', 'ch163#0', '', 2.30495303e-06, 0., -1, 12500.),
       ('B5_14', 'ch164#0', '', 2.42884105e-06, 0., -1, 12500.),
       ('B5_21', 'ch165#0', '', 2.41041157e-07, 0., -1, 12500.),
       ('B5_22', 'ch166#0', '', 7.18100087e-07, 0., -1, 12500.),
       ('B5_23', 'ch167#0', '', 1.27216650e-06, 0., -1, 12500.),
       ('B5_24', 'ch168#0', '', 1.16168931e-06, 0., -1, 12500.),
       ('B5_31', 'ch169#0', '', 4.28517362e-07, 0., -1, 12500.),
       ('B5_32', 'ch170#0', '', 5.17235398e-07, 0., -1, 12500.),
       ('B5_33', 'ch171#0', '', 8.25230610e-07, 0., -1, 12500.),
       ('B5_34', 'ch172#0', '', 1.27718893e-06, 0., -1, 12500.),
       ('B5_41', 'ch173#0', '', 2.59453943e-07, 0., -1, 12500.),
       ('B5_42', 'ch174#0', '', 5.00496022e-07, 0., -1, 12500.),
       ('B5_43', 'ch175#0', '', 6.54495074e-07, 0., -1, 12500.),
       ('B5_44', 'ch176#0', '', 8.05142330e-07, 0., -1, 12500.),
       ('B6_11', 'ch177#0', '', 1.22529389e-06, 0., -1, 12500.),
       ('B6_12', 'ch178#0', '', 3.63235314e-07, 0., -1, 12500.),
       ('B6_13', 'ch179#0', '', 1.55003360e-06, 0., -1, 12500.),
       ('B6_14', 'ch180#0', '', 1.54334442e-06, 0., -1, 12500.),
       ('B6_21', 'ch181#0', '', 5.18909356e-07, 0., -1, 12500.),
       ('B6_22', 'ch182#0', '', 1.02777012e-06, 0., -1, 12500.),
       ('B6_23', 'ch183#0', '', 9.02228496e-07, 0., -1, 12500.),
       ('B6_24', 'ch184#0', '', 1.10979737e-06, 0., -1, 12500.),
       ('B6_31', 'ch185#0', '', 2.96279496e-07, 0., -1, 12500.),
       ('B6_32', 'ch186#0', '', 5.92558991e-07, 0., -1, 12500.),
       ('B6_33', 'ch187#0', '', 6.00928996e-07, 0., -1, 12500.),
       ('B6_34', 'ch188#0', '', 1.08803535e-06, 0., -1, 12500.),
       ('B6_41', 'ch189#0', '', 3.88345052e-07, 0., -1, 12500.),
       ('B6_42', 'ch190#0', '', 2.59453943e-07, 0., -1, 12500.),
       ('B6_43', 'ch191#0', '', 6.05952348e-07, 0., -1, 12500.),
       ('B6_44', 'ch192#0', '', 1.04618544e-06, 0., -1, 12500.),
       ('C1_11', 'ch193#0', '', 4.36887025e-07, 0., -1, 12500.),
       ('C1_12', 'ch194#0', '', 6.37753714e-07, 0., -1, 12500.),
       ('C1_13', 'ch195#0', '', 5.59083597e-07, 0., -1, 12500.),
       ('C1_14', 'ch196#0', '', 1.05288698e-06, 0., -1, 12500.),
       ('C1_21', 'ch197#0', '', 3.69930963e-07, 0., -1, 12500.),
       ('C1_22', 'ch198#0', '', 2.66149407e-07, 0., -1, 12500.),
       ('C1_23', 'ch199#0', '', 3.29758152e-07, 0., -1, 12500.),
       ('C1_24', 'ch200#0', '', 4.35213105e-07, 0., -1, 12500.),
       ('C1_31', 'ch201#0', '', 5.32298813e-07, 0., -1, 12500.),
       ('C1_32', 'ch202#0', '', 5.75821468e-07, 0., -1, 12500.),
       ('C1_33', 'ch203#0', '', 6.76254852e-07, 0., -1, 12500.),
       ('C1_34', 'ch204#0', '', 6.02602100e-07, 0., -1, 12500.),
       ('C1_41', 'ch205#0', '', 3.49845180e-07, 0., -1, 12500.),
       ('C1_42', 'ch206#0', '', 5.00496022e-07, 0., -1, 12500.),
       ('C1_43', 'ch207#0', '', 4.16800517e-07, 0., -1, 12500.),
       ('C1_44', 'ch208#0', '', 1.13658098e-06, 0., -1, 12500.),
       ('C2_11', 'ch209#0', '', 2.79540945e-07, 0., -1, 12500.),
       ('C2_12', 'ch210#0', '', 5.99257312e-07, 0., -1, 12500.),
       ('C2_13', 'ch211#0', '', 7.24797010e-07, 0., -1, 12500.),
       ('C2_14', 'ch212#0', '', 5.85862510e-07, 0., -1, 12500.),
       ('C2_21', 'ch213#0', '', 4.21822303e-07, 0., -1, 12500.),
       ('C2_22', 'ch214#0', '', 5.18909356e-07, 0., -1, 12500.),
       ('C2_23', 'ch215#0', '', 3.23062685e-07, 0., -1, 12500.),
       ('C2_24', 'ch216#0', '', 7.16431132e-07, 0., -1, 12500.),
       ('C2_31', 'ch217#0', '', 5.79169098e-07, 0., -1, 12500.),
       ('C2_32', 'ch218#0', '', 2.81215300e-07, 0., -1, 12500.),
       ('C2_33', 'ch219#0', '', 1.94172114e-07, 0., -1, 12500.),
       ('C2_34', 'ch220#0', '', 2.15932881e-07, 0., -1, 12500.),
       ('C2_41', 'ch221#0', '', 4.65344128e-07, 0., -1, 12500.),
       ('C2_42', 'ch222#0', '', 7.64973006e-07, 0., -1, 12500.),
       ('C2_43', 'ch223#0', '', 5.84191469e-07, 0., -1, 12500.),
       ('C2_44', 'ch224#0', '', 5.79169098e-07, 0., -1, 12500.),
       ('C3_11', 'ch225#0', '', 9.35710622e-07, 0., -1, 12500.),
       ('C3_12', 'ch226#0', '', 2.72845418e-07, 0., -1, 12500.),
       ('C3_13', 'ch227#0', '', 5.33972182e-07, 0., -1, 12500.),
       ('C3_14', 'ch228#0', '', 2.81215300e-07, 0., -1, 12500.),
       ('C3_21', 'ch229#0', '', 2.57780296e-07, 0., -1, 12500.),
       ('C3_22', 'ch230#0', '', 2.34345604e-07, 0., -1, 12500.),
       ('C3_23', 'ch231#0', '', 3.19714254e-07, 0., -1, 12500.),
       ('C3_24', 'ch232#0', '', 4.61995551e-07, 0., -1, 12500.),
       ('C3_31', 'ch233#0', '', 4.46930087e-07, 0., -1, 12500.),
       ('C3_32', 'ch234#0', '', 5.60754680e-07, 0., -1, 12500.),
       ('C3_33', 'ch235#0', '', 4.11778327e-07, 0., -1, 12500.),
       ('C3_34', 'ch236#0', '', 6.41103143e-07, 0., -1, 12500.),
       ('C3_41', 'ch237#0', '', 4.58648864e-07, 0., -1, 12500.),
       ('C3_42', 'ch238#0', '', 4.82082314e-07, 0., -1, 12500.),
       ('C3_43', 'ch239#0', '', 2.66149407e-07, 0., -1, 12500.),
       ('C3_44', 'ch240#0', '', 9.92624488e-07, 0., -1, 12500.),
       ('C4_11', 'ch241#0', '', 1.07296324e-06, 0., -1, 12500.),
       ('C4_12', 'ch242#0', '', 2.19280633e-07, 0., -1, 12500.),
       ('C4_13', 'ch243#0', '', 5.57408868e-07, 0., -1, 12500.),
       ('C4_14', 'ch244#0', '', 9.55794987e-07, 0., -1, 12500.),
       ('C4_21', 'ch245#0', '', 5.37322298e-07, 0., -1, 12500.),
       ('C4_22', 'ch246#0', '', 4.67017626e-07, 0., -1, 12500.),
       ('C4_23', 'ch247#0', '', 3.16366727e-07, 0., -1, 12500.),
       ('C4_24', 'ch248#0', '', 7.21450062e-07, 0., -1, 12500.),
       ('C4_31', 'ch249#0', '', 3.93365763e-07, 0., -1, 12500.),
       ('C4_32', 'ch250#0', '', 4.03410199e-07, 0., -1, 12500.),
       ('C4_33', 'ch251#0', '', 5.40670011e-07, 0., -1, 12500.),
       ('C4_34', 'ch252#0', '', 7.19776836e-07, 0., -1, 12500.),
       ('C4_41', 'ch253#0', '', 1.84128857e-07, 0., -1, 12500.),
       ('C4_42', 'ch254#0', '', 7.49903628e-07, 0., -1, 12500.),
       ('C4_43', 'ch255#0', '', 7.61625649e-07, 0., -1, 12500.),
       ('C4_44', 'ch256#0', '', 1.08803535e-06, 0., -1, 12500.),
       ('C5_11', 'ch257#0', '', 4.20147836e-07, 0., -1, 12500.),
       ('C5_12', 'ch258#0', '', 4.06756417e-07, 0., -1, 12500.),
       ('C5_13', 'ch259#0', '', 5.97583201e-07, 0., -1, 12500.),
       ('C5_14', 'ch260#0', '', 2.84562987e-07, 0., -1, 12500.),
       ('C5_21', 'ch261#0', '', 6.17668880e-07, 0., -1, 12500.),
       ('C5_22', 'ch262#0', '', 6.32733454e-07, 0., -1, 12500.),
       ('C5_23', 'ch263#0', '', 3.14693151e-07, 0., -1, 12500.),
       ('C5_24', 'ch264#0', '', 6.10974757e-07, 0., -1, 12500.),
       ('C5_31', 'ch265#0', '', 3.16366727e-07, 0., -1, 12500.),
       ('C5_32', 'ch266#0', '', 4.51951575e-07, 0., -1, 12500.),
       ('C5_33', 'ch267#0', '', 4.03410199e-07, 0., -1, 12500.),
       ('C5_34', 'ch268#0', '', 6.57843476e-07, 0., -1, 12500.),
       ('C5_41', 'ch269#0', '', 3.02975172e-07, 0., -1, 12500.),
       ('C5_42', 'ch270#0', '', 7.34843921e-07, 0., -1, 12500.),
       ('C5_43', 'ch271#0', '', 4.75386240e-07, 0., -1, 12500.),
       ('C5_44', 'ch272#0', '', 5.33972182e-07, 0., -1, 12500.),
       ('C6_11', 'ch273#0', '', 5.87539367e-07, 0., -1, 12500.),
       ('C6_12', 'ch274#0', '', 2.32672064e-07, 0., -1, 12500.),
       ('C6_13', 'ch275#0', '', 1.13824841e-06, 0., -1, 12500.),
       ('C6_14', 'ch276#0', '', 8.13512834e-07, 0., -1, 12500.),
       ('C6_21', 'ch277#0', '', 5.07192076e-07, 0., -1, 12500.),
       ('C6_22', 'ch278#0', '', 4.55300496e-07, 0., -1, 12500.),
       ('C6_23', 'ch279#0', '', 3.56540143e-07, 0., -1, 12500.),
       ('C6_24', 'ch280#0', '', 3.48170153e-07, 0., -1, 12500.),
       ('C6_31', 'ch281#0', '', 3.95039327e-07, 0., -1, 12500.),
       ('C6_32', 'ch282#0', '', 2.79540945e-07, 0., -1, 12500.),
       ('C6_33', 'ch283#0', '', 4.58648864e-07, 0., -1, 12500.),
       ('C6_34', 'ch284#0', '', 5.45690836e-07, 0., -1, 12500.),
       ('C6_41', 'ch285#0', '', 1.95846037e-07, 0., -1, 12500.),
       ('C6_42', 'ch286#0', '', 7.36516909e-07, 0., -1, 12500.),
       ('C6_43', 'ch287#0', '', 7.90078655e-07, 0., -1, 12500.),
       ('C6_44', 'ch288#0', '', 6.57843476e-07, 0., -1, 12500.),
       ('D1_11', 'ch289#0', '', 5.50713014e-07, 0., -1, 12500.),
       ('D1_12', 'ch290#0', '', 2.84562987e-07, 0., -1, 12500.),
       ('D1_13', 'ch291#0', '', 6.46125371e-07, 0., -1, 12500.),
       ('D1_14', 'ch292#0', '', 6.27709832e-07, 0., -1, 12500.),
       ('D1_21', 'ch293#0', '', 6.02602100e-07, 0., -1, 12500.),
       ('D1_22', 'ch294#0', '', 7.96775868e-07, 0., -1, 12500.),
       ('D1_23', 'ch295#0', '', 3.31431809e-07, 0., -1, 12500.),
       ('D1_24', 'ch296#0', '', 8.00125275e-07, 0., -1, 12500.),
       ('D1_31', 'ch297#0', '', 8.85491473e-07, 0., -1, 12500.),
       ('D1_32', 'ch298#0', '', 7.08058982e-07, 0., -1, 12500.),
       ('D1_33', 'ch299#0', '', 7.69991290e-07, 0., -1, 12500.),
       ('D1_34', 'ch300#0', '', 7.91752652e-07, 0., -1, 12500.),
       ('D1_41', 'ch301#0', '', 3.11344555e-07, 0., -1, 12500.),
       ('D1_42', 'ch302#0', '', 1.20018791e-06, 0., -1, 12500.),
       ('D1_43', 'ch303#0', '', 1.07966950e-06, 0., -1, 12500.),
       ('D1_44', 'ch304#0', '', 1.64544814e-06, 0., -1, 12500.),
       ('D2_11', 'ch305#0', '', 9.60820418e-07, 0., -1, 12500.),
       ('D2_12', 'ch306#0', '', 4.36887025e-07, 0., -1, 12500.),
       ('D2_13', 'ch307#0', '', 6.89647197e-07, 0., -1, 12500.),
       ('D2_14', 'ch308#0', '', 4.16800517e-07, 0., -1, 12500.),
       ('D2_21', 'ch309#0', '', 6.29384139e-07, 0., -1, 12500.),
       ('D2_22', 'ch310#0', '', 3.81649420e-07, 0., -1, 12500.),
       ('D2_23', 'ch311#0', '', 2.41041157e-07, 0., -1, 12500.),
       ('D2_24', 'ch312#0', '', 9.49096901e-07, 0., -1, 12500.),
       ('D2_31', 'ch313#0', '', 9.13946217e-07, 0., -1, 12500.),
       ('D2_32', 'ch314#0', '', 4.95474214e-07, 0., -1, 12500.),
       ('D2_33', 'ch315#0', '', 2.94606290e-07, 0., -1, 12500.),
       ('D2_34', 'ch316#0', '', 7.39861927e-07, 0., -1, 12500.),
       ('D2_41', 'ch317#0', '', 4.25170130e-07, 0., -1, 12500.),
       ('D2_42', 'ch318#0', '', 2.87910734e-07, 0., -1, 12500.),
       ('D2_43', 'ch319#0', '', 5.54059153e-07, 0., -1, 12500.),
       ('D2_44', 'ch320#0', '', 9.75885886e-07, 0., -1, 12500.),
       ('D3_11', 'ch321#0', '', 1.40774559e-06, 0., -1, 12500.),
       ('D3_12', 'ch322#0', '', 6.64537990e-07, 0., -1, 12500.),
       ('D3_13', 'ch323#0', '', 1.10142603e-06, 0., -1, 12500.),
       ('D3_14', 'ch324#0', '', 5.35646702e-07, 0., -1, 12500.),
       ('D3_21', 'ch325#0', '', 4.55300496e-07, 0., -1, 12500.),
       ('D3_22', 'ch326#0', '', 1.00266934e-06, 0., -1, 12500.),
       ('D3_23', 'ch327#0', '', 2.87910734e-07, 0., -1, 12500.),
       ('D3_24', 'ch328#0', '', 6.92993327e-07, 0., -1, 12500.),
       ('D3_31', 'ch329#0', '', 4.01735614e-07, 0., -1, 12500.),
       ('D3_32', 'ch330#0', '', 5.85862510e-07, 0., -1, 12500.),
       ('D3_33', 'ch331#0', '', 6.21016486e-07, 0., -1, 12500.),
       ('D3_34', 'ch332#0', '', 5.74145921e-07, 0., -1, 12500.),
       ('D3_41', 'ch333#0', '', 5.28952782e-07, 0., -1, 12500.),
       ('D3_42', 'ch334#0', '', 5.40670011e-07, 0., -1, 12500.),
       ('D3_43', 'ch335#0', '', 4.30192626e-07, 0., -1, 12500.),
       ('D3_44', 'ch336#0', '', 1.48306769e-06, 0., -1, 12500.),
       ('D4_11', 'ch337#0', '', 3.09671174e-07, 0., -1, 12500.),
       ('D4_12', 'ch338#0', '', 1.55839747e-06, 0., -1, 12500.),
       ('D4_13', 'ch339#0', '', 3.19714254e-07, 0., -1, 12500.),
       ('D4_14', 'ch340#0', '', 8.55361235e-07, 0., -1, 12500.),
       ('D4_21', 'ch341#0', '', 1.02442357e-06, 0., -1, 12500.),
       ('D4_22', 'ch342#0', '', 9.82578501e-07, 0., -1, 12500.),
       ('D4_23', 'ch343#0', '', 1.19349152e-06, 0., -1, 12500.),
       ('D4_24', 'ch344#0', '', 1.44960550e-06, 0., -1, 12500.),
       ('D4_31', 'ch345#0', '', 2.39367321e-07, 0., -1, 12500.),
       ('D4_32', 'ch346#0', '', 8.67075183e-07, 0., -1, 12500.),
       ('D4_33', 'ch347#0', '', 7.64973006e-07, 0., -1, 12500.),
       ('D4_34', 'ch348#0', '', 1.06460382e-06, 0., -1, 12500.),
       ('D4_41', 'ch349#0', '', 9.35710622e-07, 0., -1, 12500.),
       ('D4_42', 'ch350#0', '', 1.02777012e-06, 0., -1, 12500.),
       ('D4_43', 'ch351#0', '', 4.26843154e-07, 0., -1, 12500.),
       ('D4_44', 'ch352#0', '', 6.59516305e-07, 0., -1, 12500.),
       ('D5_11', 'ch353#0', '', 1.66553393e-06, 0., -1, 12500.),
       ('D5_12', 'ch354#0', '', 1.65547501e-06, 0., -1, 12500.),
       ('D5_13', 'ch355#0', '', 9.70856453e-07, 0., -1, 12500.),
       ('D5_14', 'ch356#0', '', 7.39861927e-07, 0., -1, 12500.),
       ('D5_21', 'ch357#0', '', 9.79225995e-07, 0., -1, 12500.),
       ('D5_22', 'ch358#0', '', 9.10600992e-07, 0., -1, 12500.),
       ('D5_23', 'ch359#0', '', 8.05142330e-07, 0., -1, 12500.),
       ('D5_24', 'ch360#0', '', 1.18679251e-06, 0., -1, 12500.),
       ('D5_31', 'ch361#0', '', 3.59888418e-07, 0., -1, 12500.),
       ('D5_32', 'ch362#0', '', 7.04712576e-07, 0., -1, 12500.),
       ('D5_33', 'ch363#0', '', 6.92993327e-07, 0., -1, 12500.),
       ('D5_34', 'ch364#0', '', 7.34843921e-07, 0., -1, 12500.),
       ('D5_41', 'ch365#0', '', 7.04712576e-07, 0., -1, 12500.),
       ('D5_42', 'ch366#0', '', 9.75885886e-07, 0., -1, 12500.),
       ('D5_43', 'ch367#0', '', 1.06961626e-06, 0., -1, 12500.),
       ('D5_44', 'ch368#0', '', 1.04283687e-06, 0., -1, 12500.),
       ('D6_11', 'ch369#0', '', 1.89318916e-06, 0., -1, 12500.),
       ('D6_12', 'ch370#0', '', 1.66386912e-06, 0., -1, 12500.),
       ('D6_13', 'ch371#0', '', 9.32365871e-07, 0., -1, 12500.),
       ('D6_14', 'ch372#0', '', 1.38431012e-06, 0., -1, 12500.),
       ('D6_21', 'ch373#0', '', 9.15618906e-07, 0., -1, 12500.),
       ('D6_22', 'ch374#0', '', 4.23496456e-07, 0., -1, 12500.),
       ('D6_23', 'ch375#0', '', 6.77927362e-07, 0., -1, 12500.),
       ('D6_24', 'ch376#0', '', 4.83755875e-07, 0., -1, 12500.),
       ('D6_31', 'ch377#0', '', 1.01940468e-06, 0., -1, 12500.),
       ('D6_32', 'ch378#0', '', 5.79169098e-07, 0., -1, 12500.),
       ('D6_33', 'ch379#0', '', 7.91752652e-07, 0., -1, 12500.),
       ('D6_34', 'ch380#0', '', 1.62201003e-06, 0., -1, 12500.),
       ('D6_41', 'ch381#0', '', 1.69567222e-06, 0., -1, 12500.),
       ('D6_42', 'ch382#0', '', 8.43648492e-07, 0., -1, 12500.),
       ('D6_43', 'ch383#0', '', 8.05142330e-07, 0., -1, 12500.),
       ('D6_44', 'ch384#0', '', 3.84997264e-07, 0., -1, 12500.)],
      dtype=[('name', '<U64'), ('id', '<U64'), ('wf_units', '<U64'), ('wf_gain', '<f8'), ('wf_offset', '<f8'), ('wf_left_sweep', '<i8'), ('wf_sampling_rate', '<f8')]), 'event_channels': array([('WellStatus', '1', b'event')],
      dtype=[('name', '<U64'), ('id', '<U64'), ('type', 'S5')])}`

@zm711
Copy link
Collaborator

zm711 commented Aug 29, 2024

It looks to me like this dataset just has waveform snippets in it? I think plexon was trying to do some realtime sorting in the past. I don't think this dataset has raw data any more. When was it recorded?

@ajcheng1
Copy link
Author

Hmm, this may be from Axion end then. This was recorded from an Axion MEA plate that was convert to a .nex file (from .spk), Within Plexon Offline Sorter, you can export the .nex file into .plx.

@zm711
Copy link
Collaborator

zm711 commented Aug 29, 2024

We can read .nex files. You want to try:

from neo.rawio import NeuroExplorerRawIO

reader = NeuroExplorerRawIO('path_to_nex_file')
reader.parse_header()
print(reader.header)

then we can see if the plexon conversion was a problem or the initial conversion.

@ajcheng1
Copy link
Author

Side issue with the code involving the parse_reader()
image

@zm711
Copy link
Collaborator

zm711 commented Aug 29, 2024

Unfortunately we haven't touched that rawio for a quite a while so I was hoping it would still work. We need to update it....

Okay and does your Axion system have settings for just waveforms versus wideband recording? Or maybe you're converter to .nex got rid of the wideband. What's the axion workflow?

@ajcheng1
Copy link
Author

Okay, no problem.
Here is the workflow we are using. This is the guide that can explain it better than I can. https://www.axionbiosystems.com/sites/default/files/resources/Spike%20Sorting%20Protocol%20-%20Axion%20BioSystems.pdf
The MEA system creates an Axion .raw file and a .spk file. (I believe .raw can be converted into .csv as well.) To think about it now, I believe converting the data into .nex does break-up the continuous data. Let me do some more digging.

@zm711
Copy link
Collaborator

zm711 commented Aug 29, 2024

.spk is often shorthand for just using the waveform snippets. .raw is often just a binary file. So it might be better to just load the binary file itself. From the script above you can see the info we need: the channel number the number of samples. So if you have some way to get that info you could just load the .raw file itself!

@ajcheng1
Copy link
Author

Gotcha. Do u suggest I try spikeinterface.core.read_binary () ?

@zm711
Copy link
Collaborator

zm711 commented Aug 30, 2024

You can try that but you will need sampling frequency, channels,, and dtype. So as long as you can look that up from your recording equipment or have it written down you should be good to give it a try. We also need to know if axion provides a header or not... I haven't read the axion link you sent yet, but if it does provide a header than we might need to use a different reader, but I would say give it a try. Look at the data and if it seems wrong or throws and error it is likely because the file has a header attached that we need to deal with....

@zm711
Copy link
Collaborator

zm711 commented Sep 4, 2024

@samuelgarcia do you have any experience with Axion equipment. I was trying to look at this and it seems like we don't have anything at Neo. This might be a good issue to open on a neo and we could get a reader in general.

@zm711 zm711 added NEO Problem related to NEO IO question General question regarding SI labels Sep 4, 2024
@samuelgarcia
Copy link
Member

I think the "0xb0" error is a wrong codec for decoding "°". should be easy to fix but we would need the file.

@samuelgarcia
Copy link
Member

i am not familiar with axion.

@h-mayorquin
Copy link
Collaborator

Hey, Sam, let's actually talk one of these days about it. I have some material and know more or less how the file is structured

@zm711
Copy link
Collaborator

zm711 commented Sep 4, 2024

If that's the case then @ajcheng1 would you be willing to open an issue on Neo https://github.com/NeuralEnsemble/python-neo/issues

and share a file with us. Then we can implement a reader for you on the Neo side and this will all happen under the spikeinterface hood for you!

@h-mayorquin
Copy link
Collaborator

He shared a file with me. I can open the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NEO Problem related to NEO IO question General question regarding SI
Projects
None yet
Development

No branches or pull requests

5 participants