Match lipid molecules using MS1 precursor mass

match_ms1(features, libs, mz_tol = 0.025)

Arguments

features

two column dataframe, m/z and RT

libs

Which libraries to match against. Should be the output of [get_lib] or [create_lib]

mz_tol

M/Z tolerance for matching, in Da. Default 0.025 Da.

Value

The input dataframe with additional column

Examples

features_file <- system.file("extdata", "features.csv", package = "lipID") features <- readr::read_csv(features_file)
#> Parsed with column specification: #> cols( #> mz = col_double(), #> rt = col_double(), #> Sample1 = col_double(), #> Sample2 = col_double(), #> Sample3 = col_double(), #> Sample4 = col_double(), #> Sample5 = col_double(), #> Sample6 = col_double() #> )
head(features)
#> # A tibble: 6 x 8 #> mz rt Sample1 Sample2 Sample3 Sample4 Sample5 Sample6 #> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 623. 36.6 11538991 31417167 1721597. 26270387 240068. 146196506 #> 2 649. 37.1 3026293. 4228799 2539904 4811817 34383605 1173481 #> 3 651. 38.1 2715640 71834. 1390301 4208460 18656983 15282626 #> 4 679. 26.9 78211. 942846. 402485. 11245291 2873644. 2362536 #> 5 691. 30.4 3210293 1832204 910287. 29621351 753207. 2049241 #> 6 691. 30.6 7495133. 3902430 8532539. 9627881 27338627 2198889
libs <- get_libs() ms1_annotation <- match_ms1(features, libs)
#> Joining, by = c("mz", "rt")
head(ms1_annotation)
#> # A tibble: 6 x 12 #> mz rt Sample1 Sample2 Sample3 Sample4 Sample5 Sample6 file class_name #> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> <chr> #> 1 623. 36.6 1.15e7 3.14e7 1.72e6 2.63e7 240068. 1.46e8 Cer_… Backbone:… #> 2 623. 36.6 1.15e7 3.14e7 1.72e6 2.63e7 240068. 1.46e8 Cer_… Backbone:… #> 3 623. 36.6 1.15e7 3.14e7 1.72e6 2.63e7 240068. 1.46e8 Cer_… Backbone:… #> 4 623. 36.6 1.15e7 3.14e7 1.72e6 2.63e7 240068. 1.46e8 Cer_… Backbone:… #> 5 623. 36.6 1.15e7 3.14e7 1.72e6 2.63e7 240068. 1.46e8 Cer_… Backbone:… #> 6 623. 36.6 1.15e7 3.14e7 1.72e6 2.63e7 240068. 1.46e8 Cer_… Backbone:… #> # … with 2 more variables: name <chr>, prec_mz <dbl>