IgorPro NeuroMatic event detection

Dear Igor pro forum,

I’m an avid user of Igor Pro and also, especially, the Neuromatic extension! I recently got into event analysis (slope detection mode), which works very well. However, I’m having some troubles with the uniqueness (criterion). I’m using the event detection for spike detection (single-cell loose-patch recordings in voltage-clamp mode). Sometimes the currents have a very specific shape (double-negative deflection), that can also have a quite similar amplitude. Usually, Igor would detect the first negative peak as an event (what I want) but then quickly move to the next peak (that belongs to the same spike) and ask to replace the first one (what I don't want). I already tried to play around with "skip points until next event" and the uniqueness window, but it doesn't really work and I have to manually curate every single detected spike, which is quite time-consuming or choose a lower threshold, which makes me loose some smaller spikes...Does anyone have an idea how to fix that? Since I know my minimal interspike intervals, I would ideally like to give an option to really skip e.g. 10 ms until the next spike should be detected (which is not working via the "skip points" option).

 

Any help is greatly appreciated!

 

Best,
Victoria

This is the timepoint of threshold crossing I would like to detect and then move on to the next spike a few e.g. 10 ms later. This is the 2nd threshold crossing within the same spike, that I would like to ignore instead of replacing the first one.

I don't have direct experience with NeuroMatic, but one thing to check first would be whether the "skip points until next event" input expects raw points or scaled x values. If it is indeed a problem or bug in NeuroMatic, it'll likely be using the FindLevels operation for spike detection. 

You could write your own routine like this bit of pseudocode:

FindLevels/Q/R=(StartTime,EndTime)/M=InterSpikeInterval/T=SpikeWidth/D=OutputWave InputWave,SpikeThreshold

The /M flag is the one that determines how far past the initial spike detection Igor goes before searching for the next threshold crossing. 

Ben

In reply to by Ben Murphy-Baum

Hi Ben,

thx for your reply! I was thinking the same, however, I tried out both possibilities (raw points/ scaled x values), and both didn't seem to work properly. 

I also tried the spike/level detection before, and it worked just fine, I just enjoyed the GUI & options in NM to go through single events and directly make waves from detected events...Maybe I can try and write some code to include that...:)

I did some digging, fortunately NeuroMatic's code is pretty clearly written :) When you're clicking through each event, apparently if the events haven't been saved yet, it doesn't use the skip points variable and defaults to an interspike interval of 5 points (it does want raw points btw). 

If you're confident in making a small change to the code to change this behavior, you'll need to:

1. Unhide the procedure files:

SetIgorOption IndependentModuleDev=1

2. Open the NM_EventTab.ipf file, and on lines 3917-3923 you'll find:

case 1: // there is a detected event but it is not saved
           
    if ( numtype( threshX ) == 0 )
        xbgn = threshX - searchDT + 5 * dx // advance 5 points
    endif
           
    break

This needs to be changed to: 

case 1: // there is a detected event but it is not saved
           
    if ( numtype( threshX ) == 0 )
        xbgn = threshX - searchDT + searchSkip * dx // advance searchSkip points
    endif
           
    break

This will allow you to click through events according to the specified inter-spike interval 

Hi Ben, hi John,

thanks for getting back to me &  for your help! I looked into the ipf file, and with my versions (Igor Pro 9.02 and NM v3.0c) the lines of code are already changed to the function instead of the default value :). And it works if I go through the events one-by-one (Which unfortunately takes too much time). It seems that if the "All waves" option is used (which should go through the trace automatically) then the settings in the configurations somehow don't apply anymore.

I also found his email address and wrote him, hopefully he can help, that would be great! :)