-
Notifications
You must be signed in to change notification settings - Fork 188
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
Comments
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 |
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. |
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. |
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. 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. |
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? |
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. |
Which plexon data is that? Is it plexon2 or plexon1? Is it wideband? |
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. |
Can you update neo to its latest version? I just fixed this and this was included in a release. from spikeinterface.extractors import read_plexon
stream_name = "WB-Wideband"
read_plexon(file_path, stream_name=stream_name) |
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) |
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? |
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. |
We can read 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. |
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 |
Okay, no problem. |
|
Gotcha. Do u suggest I try spikeinterface.core.read_binary () ? |
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.... |
@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. |
I think the "0xb0" error is a wrong codec for decoding "°". should be easy to fix but we would need the file. |
i am not familiar with axion. |
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 |
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! |
He shared a file with me. I can open the issue. |
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.
Loading data into spikeinterface seems to work properly
Pre-processsing runs fine
But when I sort, I get this error for three different spike sorter tools:
numpy.linalg.LinAlgError: SVD did not converge
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.
The text was updated successfully, but these errors were encountered: