Skip to contents

mass_data class object can also contain MS2 data.

Data preparation

mass_data class object

We need to create a mass_data class object first; see this document. Here we use the data from that step as examples.

load("feature_table/object_pos")
load("feature_table/object_neg")

MS2 data

The MS2 raw data should be converted to mgf format data. Please refer to this document.

Here we use the demo data prepared alongside this vignette in the feature_table folder.

Add MS2 to mass_dataset class object

Positive mode.

object_pos2 =
  mutate_ms2(
    object = object_pos,
    column = "rp",
    polarity = "positive",
    ms1.ms2.match.mz.tol = 10,
    ms1.ms2.match.rt.tol = 15,
    path = "feature_table/MS2_data/POS/"
  )

Negative mode.

object_neg2 =
  mutate_ms2(
    object = object_neg,
    column = "rp",
    polarity = "negative",
    ms1.ms2.match.mz.tol = 10,
    ms1.ms2.match.rt.tol = 15,
    path = "feature_table/MS2_data/NEG/"
  )

Session information

sessionInfo()
#> R version 4.5.2 (2025-10-31)
#> Platform: aarch64-apple-darwin20
#> Running under: macOS Tahoe 26.3
#> 
#> Matrix products: default
#> BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1
#> 
#> locale:
#> [1] C.UTF-8/C.UTF-8/C.UTF-8/C/C.UTF-8/C.UTF-8
#> 
#> time zone: Asia/Singapore
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] digest_0.6.37     desc_1.4.3        R6_2.6.1          fastmap_1.2.0    
#>  [5] xfun_0.53         cachem_1.1.0      knitr_1.50        htmltools_0.5.8.1
#>  [9] rmarkdown_2.29    lifecycle_1.0.4   cli_3.6.5         sass_0.4.10      
#> [13] pkgdown_2.1.3     textshaping_1.0.1 jquerylib_0.1.4   systemfonts_1.2.3
#> [17] compiler_4.5.2    tools_4.5.2       ragg_1.4.0        evaluate_1.0.4   
#> [21] bslib_0.9.0       yaml_2.3.10       jsonlite_2.0.0    rlang_1.1.6      
#> [25] fs_1.6.6          htmlwidgets_1.6.4