Closed litzj01 closed 5 days ago
Hello! Just following up to see if anyone has gotten a chance to look into this. Thanks!
In the new version I have not implemented to save shapes to the hdf5 file but it seems you want to use this?
save_shape=True
is a keyword only for the spike detection, this can run without saving the shapes.
I will add this again, it's an easy change, so hopefully will get that done very soon!
We do use the hdf5 file waveform shapes for our analysis and would love to have that feature again. Thank you so much for your support!
Seems to be commented out since this commit.
I personally save the spikes
DataFrame to .csv out of convenience, but I assume down the line the idea would be to use the SpikeInterface WaveformExtractor
?
I have the same situation as litzj01. We use the Sorted.hdf5 file from HS, combine it with a stimulus timing file, and filter out subthreshold units between specific timing windows. The filtered dataset is put into MATLAB as a .h5, and all information about a single unit becomes grouped into individual structures for analysis.
@TheSuperbohl That is pretty much exactly our pipeline as well! May I ask which MEA type you are using? We are using a 3Brain 64x64 MEA.
Ok, so this should work again!
Once you have run the clustering, you can do Clusters.SaveHDF5('HS2_detected.hdf5')
(where Clusters
is the clustering object) to store everything. You can also load this again with hs.HSClustering('HS2_detected.hdf5')
, this will then have the shapes as well.
If you run this via SpikeInterface, it'll for now always store the shapes. Will make a PR shortly to make the option accessible there as well.
To test this, you need to clone this repo, I want to be sure it all works as intended before uploading again to pypi (for pip install). Please let me know if there are any problems.
Aside, this code still tries to support the old legacy data format as we still have some old some recordings stored in this way ... getting increasingly unlikely we'll every look at these again. The code would be cleaner if I could remove this at some point, would this be an issue?
@litzj01 yes are using the same 3Brain chips. I would probably be fine if it gets removed at some point. I am currently trying to retool our pipeline so we can use just spike interface. If I need to at some point, I can work on how to take extracted waveform shapes from spike interface and fit into the restructured .h5 file we make for the MATLAB pipeline.
Aside, this code still tries to support the old legacy data format as we still have some old some recordings stored in this way ... getting increasingly unlikely we'll every look at these again. The code would be cleaner if I could remove this at some point, would this be an issue?
neo
still supports the old recordings, so it's probably safe to remove direct support here as they will still be easily readable.
Great, will clean up the code soon to transition to the new method.
I am using the latest HS2 on SI and can't get the waveform shapes to save in the output file.
Here my code where save_shape=True:
sorter_params = { "chunk_size": None, "rescale": True, "rescale_value": -1280.0, "lowpass": True, "common_reference": "median", "spike_duration": 1.0, "amp_avg_duration": 0.4, "threshold": 8.0, "min_avg_amp": 1.0, "AHP_thr": 0.0, "neighbor_radius": 129, "inner_radius": 100, "peak_jitter": 0.25, "rise_duration": 0.26, "decay_filtering": False, "decay_ratio": 1.0, "localize": True, "save_shape": True, "out_file": "HS2_detected", "left_cutout_time": 0.3, "right_cutout_time": 1.8, "verbose": True, "clustering_bandwidth": 4.0, "clustering_alpha": 4.5, "clustering_n_jobs": -1, "clustering_bin_seeding": True, "clustering_min_bin_freq": 4, "clustering_subset": None, "pca_ncomponents": 2, "pca_whiten": True, }
sorting = ss.run_sorter(sorter_name="herdingspikes", recording=recording1, **sorter_params)
I have
save_shape=True
, however, the output HS2_sorted.hdf5 only contains these 7 fields ('Sampling', 'centres', 'ch', 'cluster_id', 'data', 'exp_inds', 'times'
).I attempted to run the same code with
save_shape=False
to see if it fixed the issue, however, this caused the sort to fail:I have spython 0.3.13 installed in the environment, so I don't understand what the issue here is either. Any help would be appreciated!