analizing multiple abf traces at once

I need to analyze electrophysiology data acquired in Clampex (abf files). Although I have the tools to open abf files with Igor and I manage to analyze sweep by sweep with no problem, I find it difficult to generate a macro to analyze all the sweeps at once (without me having to type the name of each sweep/trace. It is OK for small files, but I am now dealing with abf files that contain more than 300 sweeps/traces and i would like to simplify this by writing a loop or something similar. I would appreciate any tip or idea.
thanks!
Unless you are using a package like NeuroMatic that makes analyzing lots of waves easy/automated, then I think the answer to your question is that you need to learn how to program using Igor's programming language.

Execute the following on Igor's command line to bring up the programming manual.
DisplayHelpTopic "Igor Pro Programming"


Learning to program in Igor takes time and practice. But if you provide more information about what you are doing, how you currently do your analysis, and how you would like to have it automated, we may be able to make some more specific suggestions.
I do not use Neuromatic but custom made macros (initially programmed by someone else in the lab and now updated to my needs by myself). I do not know a lot about programming, so i am trying to make my way through.

Basically, I have a group of around 300 traces/sweeps in one file in which I want to detect a peak and a maximum slope. My macro automatically detects this as long as I type the file name and extension (the extension correspond to the sweep number). Each sweep contains only one peak and corresponds to one point in time (sweeps are taken 30 sec apart), so I want to keep this info in order (sweep 1 is time 0, sw 2 is 0.5 (min), etc).

The problem is that the macro I wrote only allows me to go through one sweep at the time and I need to type the name of each sweep every time. This is tedious and time consuming, so I thought on automatizing the macro so it can detect the last sweep it analyzed and take the following one.

to make it more clear, my files have a name like 110816_000_1, 110816_000_2, 110816_000_3, etc. Being the "_1, _2, _3" the extensions for the different sweeps. So I have to type the name of 300 of these to analyze the whole file. I would like to have a macro that can detect that if I recently analyzed the "_1", then it will automatically analyze "_2", and so on.

Basically, what I am asking is if there is an easy loop that I can add to my macro to do so. I am constantly looking at the Help files from Igor, but as I got stuck here, I thought maybe someone could give me a tip.

thanks,

If your files are already open in Igor you could try something like:

Function AutomateAnalysis(sBaseName, vNumberOfFiles)
     String sBaseName     //common part of file names, such as "110816_000_"
     Variable vNumberOfFiles     //number of files to analyze

     Variable vIndex
     for(vIndex = 1; vIndex < vNumberOfFiles; vIndex += 1)
          Wave w = $(sBaseName + num2str(vIndex)) //get reference to current wave
         //do analysis here using wave reference "w"
     endfor
End


I just typed this directly into IgorExchange without testing. I hope that I have not made any embarassing mistakes. If so, they will be quickly rectified by others, I am quite certain. This code should give you an idea of how to procede and the sort of syntax to try.

By the way, you can call this function from the command line as

AutomateAnalysis("110816_000_", 300)

This example assumes that your waves are in the current directory or you give the full path to the files via the base name. Keeping track of the results is also up to you. You can create a destination wave and store the values as the analysis procedes or you could simply print them to the history window.
While there are many different kinds of analyses, the basic framework is always the same:

1) Write a 'worker function' that analyzes a single dataset. Make sure that the location of that dataset (name of the wave or name of the file) is passed as an argument to the function so that it is easy to run for different datasets. From your post it appears that you already have this function or are very close to it.

2) Write a higher level 'superfunction' that knows how your data is stored (i.e. it knows how to find your data and it can figure out how many waves/files there are) and that simply calls your initial function repeatedly with different arguments. This is what you probably need to do.

In a sense the superfunction wraps around the lower level one, feeding it different arguments each time. In semi-Igor code you would have something like this:
Function MyWorkerFunction(dataWave)
    wave dataWave // this contains the data
   
    // do some work with dataWave, and store some result
    // important: the workerfunction needs to save its result in a different
    // location for different input, otherwise it will be overwritten each time
    string processedResult = "Result_" + NameOfWave(dataWave)
    Make /O $processedResult
End

Function MySuperFunction()
    // figure out what waves need to be processed
    // in your case these could be filePaths
    // that you get by combining NewPath (see its documentation)
    // and IndexedFolderItem (see its documentation, too)
   
    // it is very important that this routine can figure out what is data
    // and what isn't. Therefore you need to give the waves/files consistent names.
    // Here I'm assuming that the names are myDataWave0, myDataWave1, etc.
    string myListOfWavesToProcess = WaveList("myDataWave*", ";", "")
   
    variable nItemsToProcess = ItemsInList(myListOfWavesToProcess)
   
    // to do all the files you'll need a loop. A for loop is usually the logical choice
    for (i = 0; i < nItemsToProcess; i+=1)
        wave thisWave = $StringFromList(i, myListOfWavesToProcess)
        MyWorkerFunction(thisWave)
    endfor
   
    // done!
End


If it encourages you, writing the superfunction is typically much easier than writing the analysis itself, since there is often not much more to it than the example shows.