Riccardo,
Yep the red line indicates the calculated signal to noise level. A peak above this line should get picked and integrated. I would like to give the formula for this but latex doesn't work on the forum . Second best option is the actual code for it.
specNoise <- function(spec, gap = quantile(diff(spec[,"mz"]), .9)) {
# In a spectrum with just one raw peak we can't calculate noise
if (nrow(spec) < 2) {
return(0)
}
intmean <- mean(spec[,"intensity"])
mzlen <- diff(range(spec[,"mz"]))
mzdiff <- diff(spec[,"mz"])
gaplen <- sum(mzdiff[mzdiff > gap])
weighted.mean(c(intmean, min(spec[,"intensity"])/2), c(1 - gaplen/mzlen,
gaplen/mzlen))
}
where spec is a single scan. It comes to this function as a matrix of columns mz and intensity.
Let me know if this is clear. Otherwise I can try and explain the way it works.
Paul