Where, the first column is the index, and the other 6 are 6 different histograms. I would like to find peaks in every histogram, i.e, the positions with more significant values. The expected values comes from other thousands of files similar to this one. I now calculate a z-score (value-mean/standard_deviation) and so I localize the peaks. But, when I have a peak, I would like obtain from the position where the peak start (sometimes with value=0) to the peak finnish (also, sometimes value=0.

If you can give us an algorithm for finding peaks, we can help you code it in perl (or perhaps find a module). If you have an unambiguous definition of peak, we probably can also help with the algorithm. If you are making judgment calls about what is a peak and where it starts and stops, it is very unlikely that any computer program could do the same thing. Good Luck, Bill

What you could do is to do something equivalent to computing the derivate of the function, if it was a continuous mathematical function.

Basically, the idea is to make a new array in which each element is the difference between the current element and the previous element of your array. When the values in the new array change sign (go from positive to negative or vice-versa), you reached an extremum (maximum or minimum) in your original array. From there, you should be able to find what you are looking for.

More, I cannot say, because you are not giving enough information on what you need exactly.