esi-neuroscience / syncopy

Systems Neuroscience Computing in Python: user-friendly analysis of large-scale electrophysiology data
BSD 3-Clause "New" or "Revised" License
46 stars 14 forks source link

ZETA method to replace PSTH #169

Open KatharineShapcott opened 2 years ago

KatharineShapcott commented 2 years ago

As far as I know doesn't have a PSTH method yet for spike events. My suggestion is not to bother and implement this cool looking method called Zeta IFR instead: https://elifesciences.org/articles/71969

Here's the kind of sales pitch figure from the paper comparing the two, as you can see it's a pretty simple method but would give nice statistics about responsivity of any event like data: elife-71969-fig1-v3

There's no assumptions about the distribution of the underlying data and no need to pick bin sizes or any other parameters.

They do have python code (https://github.com/JorritMontijn/zetapy/blob/master/main.py) but it's not up to date and is literally a line by line translation of the matlab code (https://github.com/JorritMontijn/ZETA/blob/master/getZeta.m).

I would be happy to help implement this because I think it will be a super helpful first pass analysis for our data. Do you think it's a good fit for Syncopy?

tensionhead commented 2 years ago

Without having much expert knowledge about the analysis problems you face, the ZETA procedure itself looks sufficiently novel, useful and robust to me. I wonder what is the connection to the KS-Test, which also is parameter free and works on the cumulative distributions as well? But in any case from my side, please go ahead @KatharineShapcott ! As we don't actually have started with the time-lock submodul of SyNCoPy yet, you could probably best provide a backend script, like we already have for example for the superlet method: superlet.py. So you could work with pure numpy/scipy/... and we can take care of the integration into SyNCoPy when building the time-lock submodule. Or what do you think @pantaray ?

pantaray commented 2 years ago

Good idea @tensionhead Sounds like a plan. Thank you for bringing this up, @KatharineShapcott !

KatharineShapcott commented 2 years ago

So you could work with pure numpy/scipy/... and we can take care of the integration into SyNCoPy when building the time-lock submodule.

Okay great thanks. That makes it easy, I'll try and write something, run a few tests and let you know if I still think it's suitable.

I wonder what is the connection to the KS-Test, which also is parameter free and works on the cumulative distributions as well?

They go into this in the methods, as far as I understood their jittering method seems to create a better null distribution https://elifesciences.org/articles/71969/figures#fig3s3

tensionhead commented 2 years ago

Ok great, we'll merge the latest submodule coherence very very soon (hopefully tmrw) into our dev branch, then we'll create a dedicated timelockanalysis branch where you then could directly commit into. I will update this comment/ping you once we are there!

tensionhead commented 2 years ago

Ok @KatharineShapcott , with quite some delay we got everything in place.. I just created a new timelockanalysis branch!

dfsp-spirit commented 1 year ago

@KatharineShapcott Is this still relevant to you, and if so, do you still want to provide the core scipy/numpy code, as discussed above?