Function to make targets for parsing data within MassSpecData class methods
Source:R/fct_ms_make_ms_targets.R
make_ms_targets.Rd
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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.