filterFragSpectra,purityA-method {msPurity}R Documentation

Filter fragmentation spectra associated with an XCMS feature

Description

General

Flag and filter features based on signal-to-noise ratio, relative abundance, intensity threshold and purity of the precursor ion.

Example LC-MS/MS processing workflow

Usage

## S4 method for signature 'purityA'
filterFragSpectra(
  pa,
  ilim = 0,
  plim = 0.8,
  ra = 0,
  snr = 3,
  rmp = FALSE,
  snmeth = "median",
  allfrag = FALSE
)

Arguments

pa

object; purityA object

ilim

numeric; min intensity of a peak

plim

numeric; min precursor ion purity of the associated precursor for fragmentation spectra scan

ra

numeric; minimum relative abundance of a peak

snr

numeric; minimum signal-to-noise of a peak within each file

rmp

boolean; TRUE if peaks are to be removed that do not meet the threshold criteria. Otherwise they will just be flagged.

snmeth

character; Method to calculate signal to noise ration (either median or mean)

allfrag

boolean; Whether to filter on all fragmentation spectra or just the fragmentation spectra grouped to XCMS feature

Value

Returns a purityA object with the pa@grped_msms spectra matrices are updated with the following columns

Examples

#====== XCMS =================================
## Read in MS data
#msmsPths <- list.files(system.file("extdata", "lcms", "mzML",
#           package="msPurityData"), full.names = TRUE, pattern = "MSMS")
#ms_data = readMSData(msmsPths, mode = 'onDisk', msLevel. = 1)

## Find peaks in each file
#cwp <- CentWaveParam(snthresh = 5, noise = 100, ppm = 10, peakwidth = c(3, 30))
#xcmsObj  <- xcms::findChromPeaks(ms_data, param = cwp)

## Optionally adjust retention time
#xcmsObj  <- adjustRtime(xcmsObj , param = ObiwarpParam(binSize = 0.6))

## Group features across samples
#pdp <- PeakDensityParam(sampleGroups = c(1, 1), minFraction = 0, bw = 30)
#xcmsObj <- groupChromPeaks(xcmsObj , param = pdp)

#====== msPurity ============================
#pa  <- purityA(msmsPths)
#pa <- frag4feature(pa, xcmsObj)
#pa <- filterFragSpectra(pa)

## Run from previously generated data
pa <- readRDS(system.file("extdata", "tests", "purityA",
                          "2_frag4feature_pa.rds", package="msPurity"))
pa <- filterFragSpectra(pa)


[Package msPurity version 1.19.2 Index]