Skip to contents

Helper function to build m/z and retention time and/or drift time targets for searching MS data. Each target is composed of an id, m/z (in Da), retention time (in seconds) and drift time (in milliseconds) ranges.

Usage

make_ms_targets(
  mz = NULL,
  rt = NULL,
  drift = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  id = NULL
)

Arguments

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

drift

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

id

Character with the same length as m/z and retention time targets to be used as identifier/s. When not given, the id is built as a combination of the m/z and retention time ranges or values.

Value

A data.frame with columns: id, mz, rt, drift, mzmin, mzmax, rtmin, rtmax, driftmin and driftmax.