MassBank, MoNA and some other public databases provide msp format database of metabolites. So you can use the functions in metid to transform them to metid format database.

MassBank

Download the MassBank msp database from here: https://massbank.eu/MassBank/. And then put the msp data into one folder.

Then set this folder as you work directory in R.

Run construct_massbank_database() function

massbank_database <- construct_mona_database(
  file = "MassBank_NIST.msp",
  path = ".",
  version = "0.0.1",
  source = "MoNA",
  link = "https://mona.fiehnlab.ucdavis.edu/",
  creater = "Xiaotao Shen",
  email = "shenxt1990@163.com",
  rt = FALSE,
  threads = 5
)

The arguments of construct_mona_database() can be found here construct_mona_database().

massbank_database is a databaseClass object, you can print it to see its information.

save(massbank_database, file = "massbank_database")

MoNA

Download the MoNA msp database from here: https://mona.fiehnlab.ucdavis.edu/downloads. And then put the msp data into one folder.

Note: Only download the database you need, do NOT use the all MS2 spectra databse which is pretty large size.

Then set this folder as you work directory in R.

Run construct_mona_database() function

mona_database <- construct_mona_database(
  file = "MoNA-export-LC-MS-MS_Spectra.msp",
  path = ".",
  version = "0.0.1",
  source = "MoNA",
  link = "https://mona.fiehnlab.ucdavis.edu/",
  creater = "Xiaotao Shen",
  email = "shenxt1990@163.com",
  rt = FALSE,
  threads = 5
)

The arguments of construct_mona_database() can be found here construct_mona_database().

massbank_database is a databaseClass object, you can print it to see its information.

save(mona_database, file = "mona_database")

Session information

sessionInfo()
#> R version 4.2.1 (2022-06-23)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Big Sur ... 10.16
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] rprojroot_2.0.3   digest_0.6.29     R6_2.5.1          jsonlite_1.8.0   
#>  [5] magrittr_2.0.3    evaluate_0.15     stringi_1.7.6     rlang_1.0.3      
#>  [9] cachem_1.0.6      cli_3.3.0         rstudioapi_0.13   fs_1.5.2         
#> [13] jquerylib_0.1.4   bslib_0.3.1       ragg_1.2.2        rmarkdown_2.14   
#> [17] pkgdown_2.0.5     textshaping_0.3.6 desc_1.4.1        tools_4.2.1      
#> [21] stringr_1.4.0     purrr_0.3.4       yaml_2.3.5        xfun_0.31        
#> [25] fastmap_1.1.0     compiler_4.2.1    systemfonts_1.0.4 memoise_2.0.1    
#> [29] htmltools_0.5.2   knitr_1.39        sass_0.4.1