MIES icon indicating copy to clipboard operation
MIES copied to clipboard

apfrequency: Make it more robust

Open t-b opened this issue 1 year ago • 1 comments

The problem is that it is not robust to fluctuations around spike threshold.

  • User should be able to set FWHM of spikes and height above threshold

  • [x] ~~TJ will provide good and bad data~~

  • [ ] Copy what ipfx does (chat with Nathan)

t-b avatar Sep 03 '24 20:09 t-b

The basic spike detection procedure implemented in IPFX is:

  1. Identify putative spikes as places where the dV/dt equals or exceeds 20 mV/ms (dV/dt values are taken from a Bessel-filtered version of the voltage trace with a 10 kHz cutoff frequency)
  2. Find putative AP peaks (max Vm between those detected points)
  3. Find the maximum dV/dt between the initially detected points and the putative peaks, then define the putative spike threshold as the point were it reaches 5% of that max value
  4. Drop putative APs where any of the following occur:
    • threshold to peak is less than 2 mV
    • threshold-to-peak time greater than 2 ms
    • putative peak is below -30 mV
  5. Refine the spike thresholds by finding the point for each AP where the dV/dt is 5% of the average maximum dV/dt across all APs in the sweep (rather than its own specific max dV/dt as before)

That's the basic idea - there are some other checks/dealing with edge cases in the code (like trying to figure out if a voltage transient may be throwing off threshold/peak pairs, and that kind of thing), and there are some adjustments to the initial 20 mV/ms dV/dt detection threshold for short square sweeps where the initial passive rise in the membrane potential can exceed that value in some cells.

gouwens avatar Sep 18 '24 19:09 gouwens