-
Notifications
You must be signed in to change notification settings - Fork 190
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
Saving deepinterpolation denoised file as binary #1785
Comments
Hi, can you paste the full error? For running KS3, I recommend doing it via SpikeInterface since our wrapper automatically maps all inputs correctly ;)
For saving to binary, we recommend using the |
Thanks for the quick reply! I just re-ran the sorter and got this error:
When I try to save the recording using rec5.save(), I get this error still:
Is there a way I can use .save() to get a .dat file output that can be input into kilosort rather than a .raw (I'm guessing the saved recording file is traces_cached_seg0.raw)? |
Thanks. Can you try to install SpikeInterface from the |
Hi, thanks for your quick response, I tried running the sorting but experienced a different error instead. This is the full output and error message: Starting container
|
@jazlynntan I recently made a PR that refactors and updates the deepinterolation step. Can you test it out? |
Hi, I tried it out but can't get past the deepinterpolation step now. Am I doing something wrong? My code is:
rec1 - 4 are the preprocessing steps based on the Neuropixel tutorial. My recording is on the Neuropixel 1.0 phase 3B staggered configuration probe. There is one bad channel (the reference), hence while 'recording' has 384 channels, rec2 onwards has 383. I pad rec4 to obtain 384 channels and then run deepinterpolation on that. I'm using the pretrained model from deepinterpolation. And the error:
|
HI @jazlynntan The problem is that the model that you are using is padding the electrodes with interleaved zeros to obtain a shape of (384, 2). Basically you have: ... @jeromelecoq can confirm! Is your NOTE the PR is still in progress. I will add more docs and tutorials in the following week |
The original recording is a Neuropixel 1.0 recording, but rec4 is a processed version with the reference channel removed (hence one less than the usual 384). I did pad it using Would you suggest I instead train deepinterpolation from scratch? If so, do you mind sharing what version of deepinterpolation you use? Noted and thank you for the work on the PR. A tutorial on denoising with deepinterpolation would be really helpful! |
Hello,
I managed to run deepinterpolation and the time series plot looks good. However, when I try to save it as a .dat binary file to run on my local installation of Kilosort3, I get the error message: TypeError: init() got an unexpected keyword argument 'recording'. I get the same error when running Kilosort3 on the denoised recording using the singularity container directly.
I run deepinterpolation via:
import spikeinterface.preprocessing as sp
rec5 = sp.deepinterpolate(sp.zero_channel_pad(rec4,384), model_path = '2020_02_29_15_28_unet_single_ephys_1024_mean_squared_error-1050.h5')
where rec4 is the output of filtering, removing bad channels and common average referencing, following the code of the Neuropixel tutorial. The zero channel padding is because I removed a bad channel (the reference channel). I have the model downloaded and the path is correct.
Regarding saving, I tried:
job_kwargs = dict(n_jobs=12, chunk_duration='1s', progress_bar=True)
rec = rec5.save(folder='myfolder', format='binary', **job_kwargs)
which gave the same TypeError: init() got an unexpected keyword argument 'recording'
as well as:
import spikeinterface.core as sc
job_kwargs = dict(chunk_duration='1s', progress_bar=True)
sc.write_binary_recording(rec5, file_paths = 'myfolder/deepinterpolation_denoised.dat', dtype='int16', n_jobs=12, **job_kwargs)
which again gave the same error.
May I know if I was running deepinterpolation wrongly? Also, is it recommended to save the output as a binary .dat file via the recording.save() method or the write_binary_recording() method? I attempted to save my filtered recording (without deepinterpolation denoising) via the .save() method but it gave a .raw file that my local installation of Kilosort3 did not accept (error message that the input was not binary).
Thank you!
The text was updated successfully, but these errors were encountered: