ImportFameSettings: Retention time markers settings

ImportFameSettingsR Documentation

Retention time markers settings

Description

This function imports a list of retention standard markers for RI correction.

Usage

ImportFameSettings(file, mass=NULL, standard=NULL, colnames=FALSE, ...)

Arguments

file

A character string naming a tab-delimited text file with standard markers OR a matrix-like object.

mass

Optional. The m/z standard marker(s). Either a scalar, which applies to every marker, or a vector.

standard

Optional. The RI values of the standards. A numeric vector.

colnames

Logical flag. If TRUE, the column names will be used to look up for the settings, otherwise the column positions will be used. See details below.

...

Options passed to read.delim, which is used internally to read the settings file.

Details

The standard marker file is a tab-delimited text file with 2, 3 or 4 columns. Additional columns are ignored. If the parameter colnames is FALSE, then the column names are ignored and they must be in the following specified below. If TRUE, use the column names below (case is ignored). Note that some columns are optional as they can be specified by the options mass and standard.

  • LowerLimit - The Retention time lower limit in seconds (required).

  • UpperLimit - The Retention time upper limit in seconds (required).

  • RIstandard - The RI value of that standard. This is optional (option standard).

  • mass - The m/z standard marker. This is optional (option mass).

Instead of passing a file via the file option, one can pass a matrix or a data.frame, The same aforementioned conditions apply in terms of column names and number.

In general, the mass and the standard should be to NULL. If not, then they take precedence over the values defined by the file parameter.

If no arguments are given, a default object will be returned.

Value

A tsRim object.

Note

If the parameter colnames is set to TRUE, then care needs to be taken regarding the column names: they must be named exactly as described in the details section, otherwise they can be silently ignored and a default value might be used instead. This has been the default behavior.

Author(s)

Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig

See Also

RIcorrect, tsRim, read.delim

Examples

require(TargetSearchData)
# get the RI marker definition file
rim.file <- tsd_file_path("rimLimits.txt")

# set the mass marker to 87
mass <- 87

# load the definition
rimLimits <- ImportFameSettings(rim.file, mass = mass)

# sometimes you need to change the limits of a particular standard
rimLimits(rimLimits)[2,] <- c(410, 450)

# to change the mass value
rimMass(rimLimits) <- 85

# alternatively, you can pass a two column matrix as limits and pass the
# rest as parameters separately (toy example).
limits <- cbind(c(10, 20, 30), c(15, 25, 35))
mass <- 100
standard  <- c(100, 200, 300)
rimLimits <- ImportFameSettings(limits, mass, standard)

# or combine all into a matrix (note the column order!)
def <- cbind(limits, standard, mass)
rimLimits <- ImportFameSettings(def)


acinostroza/TargetSearch documentation built on Nov. 13, 2024, 12:28 a.m.