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

Spike amplitude #130

Closed
CarloCerquetella opened this issue Nov 6, 2019 · 10 comments · Fixed by #595
Closed

Spike amplitude #130

CarloCerquetella opened this issue Nov 6, 2019 · 10 comments · Fixed by #595

Comments

@CarloCerquetella
Copy link

Hello everyone,

I am using kilosort2 with some strict values in ops.Th ([50 4]) and in ops.lambda ([50 50]) because in this way, if I understood the algorithm correctly, KS2 will pick up only high amplitude spikes and the waveforms assigned to the same template will have the same amplitude (more or less).
I have checked some of them manually and I am still recording some 15microV spikes. I have no clue about the reason why this is still happening. Is there a way to extract the average spike amplitude per template? I check the rez.mu variable but I don't think it is in voltage values but rather related to the template projections. Is it correct?

Thanks for any clue!

@jkbhagatio
Copy link
Contributor

Related to this, I'm also wondering how the spike amplitude values returned by kilosort are calculated (presumably based on the templates), given that they don't seem to be uV value corresponding to the binary data file.

@marius10p
Copy link
Contributor

Correct, this is about template projections. 50 is extremely high, and I don't know what would happen in that case. Try something like 15 or 20. Even then, some spikes that are small in amplitude will be extracted, because their template projections are high, i.e. they have a lot of distributed information, even though there is no one very large channel.

If you load it in the most recent version of Phy, it will also calculate raw amplitudes for you and allow you easily switch between them and the Kilosort2 ones. This way you can easily compare.

@CarloCerquetella
Copy link
Author

CarloCerquetella commented Nov 7, 2019

Hello, thank you both for the interest and fast answer. Is the amplitude of this unit around 17 uV then? Because I do still think this value refers to template projections but I don't know how to access the raw amplitude values.
Tet1Unit2Phy
Ok, I see why I got them even with these high values.
Is the info in uV contained somewhere as a list of values (with the respective position of the template too)?

@marius10p
Copy link
Contributor

It's not, that's the template projection. I think the most recent Phy might have deactivated the alternative amplitude views that you could cycle between. Watch this space: phy issue .

@CarloCerquetella
Copy link
Author

Ok. Thanks a lot!
Do you know how phy calculated these values previously? I would be very happy to write this part in matlab and include it in the kilosort script.

@marius10p
Copy link
Contributor

I don't know, but Cyrille usually replies fast, so let's wait for him.

@marius10p
Copy link
Contributor

Apparently that was only a problem on my end. You should be able to press "A" and cycle through different types of amplitudes, including the raw.

@CarloCerquetella
Copy link
Author

Ok, I have downloaded the most recent version of Phy2 and I can actually see the "raw" amplitudes but it says 1000, it can not be in uV:
photo_2019-11-09_18-52-51
How does Kilosort2 encode the values in the rez.mu variable? Maybe I could use this info to go back to my original data, no?

@marius10p
Copy link
Contributor

I think those are in units of your raw file format. Now you need a conversion factor from that to uV, that you should know from your acquisition system.

@CarloCerquetella
Copy link
Author

Yes, got it and done.
Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants