subtract,purityD-method {msPurity} | R Documentation

## Using Subtract MZ values based on ppm tolerance and noise ratio

### Description

Uses a purityD object with references to multiple MS files. Subtract blank peaks from the sample peaks see subtractMZ for more information

### Usage

    ## S4 method for signature 'purityD'
    subtract(
      Object,
      byClass = TRUE,
      mapping = c("sample", "blank"),
      ppm = 5,
      s2bthres = 10
    )

### Arguments

`Object` | object; purityD object
`byClass` | boolean; subtract within each class
`mapping` | parameter not functional (TODO)
`ppm` | numeric = ppm tolerance
`s2bthres` | numeric = threshold for the samp2blank (i1/i2)

### Value

purityD object with averaged spectra

### See Also

`subtractMZ`

### Examples

    datapth <- system.file("extdata", "dims", "mzML", package="msPurityData")
    inDF <- Getfiles(datapth, pattern=".mzML", check = FALSE, cStrt = FALSE)

    ppDIMS <- purityD(inDF, cores=1)
    ppDIMS <- averageSpectra(ppDIMS)
    ppDIMS <- filterp(ppDIMS, thr = 5000)
    ppDIMS <- subtract(ppDIMS)

[Package msPurity version 1.14.1 Index]