R/mass.match.R

Defines functions mass.match

Documented in mass.match

mass.match <-
function(x, known.mz, match.tol.ppm=5)
{
    mass.matched.pos<-rep(0, length(x))
    for(i in 1:length(x))
    {
        this.d<-abs((x[i]-known.mz)/x[i])
        if(min(this.d) < match.tol.ppm/1e6) mass.matched.pos[i]<-1
    }
    return(mass.matched.pos)
}
yufree/apLCMS documentation built on Jan. 11, 2020, 8:18 p.m.