table_annotate: Annotate LCMS features

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

View source: R/table_annotate.R

Description

table_annotate() compares the 20 most important variables identified in the PLS-DA and Random Forests modelling of the LCMS data with the monoisotopic mass of those in coralmz.

Usage

1
table_annotate(ppm = 50, save.impvars = FALSE, save.matches = FALSE)

Arguments

ppm

Numeric mass error to use for cross referencing

save.impvars

Logical indicating if the table of the 20 most important variables for each model should be saved to ./inst/extdata/

save.matches

Logical indicating if the table of cross referencing matches should be save to ./tables/

Details

table_annotate() Loads the LCMS PLS-DA and LCMS RF models and creates a table (list$imp_vars) of the 20 most important variables according to varImp. The cross referencing relies on the user defined mass error. Three variables are created to define the upper and lower bounds of the mass error:

$mz_neutral

The neutral mass of the ion calculated by subtracting the monoisotopic mass of the hydrogen ion (1.007276 Da)

$mz_low

Equal to mz_neutral - the user defined ppm error

$mz_high

Equal to mz_neutral + the user defined ppm error

The table of the 20 most important variables and their mass error can be optionally saved to ./inst/extdata/ as a .rds file. Matches with compounds in the coralmz package, if any, are retrieved and can be optionally saved to ./tables/ as a comma separated .txt file.

Value

Returns a list containing the important and matched variables

Note

Commas in the references variable are replaced with semi colons to avoid conflicts with downstream use of the .csv file. Although this function is exported, table_crossref() was not intended to be used outside of this package.

Author(s)

Benjamin R. Gordon

See Also

varImp coralmz


brgordon17/coralclass documentation built on June 15, 2020, 9:21 p.m.