ri_data_extract: Extract peak data from a RI file

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

A convenient function to extract peak data from a RI file. This function is mostly intended for debugging purposes, for example, when a given peak is not found within a expected time range (which could be because a faulty retention time correction). The arguments of this function are similar as those of the ncdf4_data_extract function.

Usage

1
ri_data_extract(RIfile, massValues, timeRange, useRT = FALSE, ...)

Arguments

RIfile

A path to a RI file format (binary or text).

massValues

A numeric vector representing m/z values. The values will be converted to integers internally.

timeRange

A numeric vector of length 2 representing the lower and upper time limits.

useRT

Logical. If TRUE, the time range is in seconds, otherwise if FALSE (default), the time range is in retention time index units (TRUE).

...

extra parameters passed to internal functions. This should be needed. However, The most important is columns which is used for text-format RI files. See text2bin.

Details

The function takes a RI file generated by TargetSearch (binary or text works) and extracts all the peaks detected of given m/z ion traces in a given time range. The time range can be in seconds or arbitrary retention time index units.

The output is simply a four column matrix in which a row is a peak of a given ion trace at a retention time (index). The output is always a matrix even if no peaks are found, in which case the number of rows is zero.

Value

A four column matrix with column names described below. Each row represents a peak in the specified time range. Potentially, there could be zero rows if no peaks are found.

Note

This function is intended to be used internally or by advances users. It can be used for debugging when TargetSearch fails to find a peak.

Author(s)

Alvaro Cuadros-Inostroza

See Also

text2bin, ncdf4_data_extract, FindAllPeaks, FindPeaks

Examples

1
2
3
4
5
6
7
8
9
require(TargetSearchData)
path <- file.path(find.package("TargetSearchData"), "gc-ms-data")
rifile <- dir(path, pattern="RI_", full=TRUE)[1]

# extract peak data for m/z 116 and 117 in time range 180 - 220 seconds
data <- ri_data_extract(rifile, c(116, 117), c(180, 220), useRT=TRUE)

# same but using Retention Time Index
data <- ri_data_extract(rifile, c(116, 117), c(205000, 228000), useRT=FALSE)

TargetSearch documentation built on March 12, 2021, 2 a.m.