getTarget {SIMAT} | R Documentation

## Get target information

### Description

Asssuming that the targets are provided in a NIST mass spectral library, i.e. MSL, format, this function reads the list of targets and the related information.

### Usage

    getTarget(Method = "target", target.file = character(),
                library.file = character(), path = getwd(),
                library.path = getwd(), Library = list(), target.table = list(),
                deltaRI = numeric(), deltaRT = numeric(), Save = FALSE)

### Arguments

`Method` | a srting with three possible values: "target", "library", and "combined". The "target" case means the user only provides a `.MSL` file as a list of targets. In the "library" mode, the user provides only a library in `.MSL` format, but it is required to provide a `target.table` to determine the name of the targets and the selected mass. The `target.table` can be obtained by using `getTargetTable` function. In the "combined" method, the user provides a list of targets as `target.table` and a library in `.MSL` format where the fragments are selected using optimization.
`target.file` | a string including the full name of a `.MSL` file including the target compounds information.

`library.file` | a string including the full name of a `.MSL` file including the library compounds information. The library can include background compounds, e.g. an in-house library. A library can also directly imported using the `Library` argument.
`path` | a string including the full path to the location of the file.name, optional
`library.path` | a string inlcuding the full path to the location of the library file, optional
`Library` | a list of library information, this is used when the library file is not provided.
`target.table` | a list including the name of the compounds, this is required when a library is provided to extract the targets information from the library. This value can be obtained using `getTargetTable` function.
`deltaRI` | a numeric value for the penalty on the retention index similarity score
`deltaRT` | a numeric value for the penalty on the retention time similarity score
`Save` | if `FALSE`, the function returns the targets as a list, otherwise, it saves the list as an `rds` object.

### Details

By calling `readMSL`, this function reads the target list and retrieves the reltated informatin such as retention time, retention index, mass and intensity of the fragments, and compound names. The user can determine the quantifier mass by using a single value for all targets, or a vector of values pointing to the index of the fragment of ineterest for each target. Also, the targets can be chosen by omptimization based on overlapping compounds if a library is provided. The library should not include any targets, but it can be an in-house library built from background compounds detected in measurements of the same type of samples.

### Value

A list containing:

`compound` | a character vector containing the names of the targets
`ms` | a list of numeric vectors of fragment mass of the targets
`sp` | a list of numeric vectors of fragment intensities of the targets
`rt` | a numeric vector of retention times of the targets
`ri` | a numeric vector of the retention indexed of the targets
`quantFrag` | a numeric vector showing the index of quantifier fragment in `ms` and `sp` fields.
`sortedFrag` | a list of numeric vectors showing the order of fragments from the most favorable to the list favorable choice for a quantifier.

### Author(s)

Mo R. Nezami Ranjbar

### References

http://omics.georgetown.edu/SIMAT.html

### See Also

`getTargetTable`, `optFrag`

### Examples

        # load the target table information
        data(target.table)

        # load the background library to be used with fragment selection
        data(Library)

        # get targets info using target table and provided library
        Targets <- getTarget(Method = "library", Library = Library,
                                                    target.table = target.table)

[Package SIMAT version 1.16.0 Index]