AHMassBank 1.0.0
Authors: Johannes Rainer [cre] (https://orcid.org/0000-0002-6977-7147)
Compiled: Tue Apr 25 16:09:18 2023
MassBank is an open access, community maintained annotation database for small
compounds. Annotations provided by this database comprise names, chemical
formulas, exact masses and other chemical properties for small compounds
(including metabolites, medical treatment agents and others). In addition,
fragment spectra are available which are crucial for the annotation of
untargeted mass spectrometry data. The CompoundDb
Bioconductor package supports conversion of MassBank data into the CompDb
(SQLite) format which enables a simplified distribution of the resource and easy
integration into Bioconductor-based annotation workflows.
CompDb Databases from AnnotationHubThe AHMassBank package provides the metadata for all CompDb SQLite databases
with MassBank annotations in r Biocpkg("AnnotationHub"). To get and use MassBank annotations we first we
load/update the AnnotationHub resource.
library(AnnotationHub)
## Warning: replacing previous import 'utils::findMatches' by
## 'S4Vectors::findMatches' when loading 'AnnotationDbi'
ah <- AnnotationHub()
Next we list all MassBank entries from AnnotationHub.
query(ah, "MassBank")
## AnnotationHub with 3 records
## # snapshotDate(): 2023-04-06
## # $dataprovider: MassBank
## # $species: NA
## # $rdataclass: CompDb
## # additional mcols(): taxonomyid, genome, description,
## # coordinate_1_based, maintainer, rdatadateadded, preparerclass, tags,
## # rdatapath, sourceurl, sourcetype
## # retrieve records with, e.g., 'object[["AH107048"]]'
##
## title
## AH107048 | MassBank CompDb for release 2021.03
## AH107049 | MassBank CompDb for release 2022.06
## AH111334 | MassBank CompDb for release 2022.12.1
We fetch the CompDb with MassBank annotations for release 2021.03.
qr <- query(ah, c("MassBank", "2021.03"))
cdb <- qr[[1]]
## loading from cache
## require("CompoundDb")
CompDb Databases from MassBankMassBank provides its annotation database as a MySQL dump. To simplify its usage
(also for users not experienced with MySQL or with the specific MassBank
database layout), MassBank annotations can also be converted into the
(SQLite-based) CompDb format which can be easily used with the
CompoundDb package. The steps to convert a MassBank MySQL
database to a CompDb SQLite database are described below.
First the MySQL database dump needs to be downloaded from the MassBank github
page. This database needs
to be installed into a local MySQL/MariaDB database server (using mysql -h localhost -u <username> -p < MassBank.sql with <username> being the name of
the user with write access to the database server).
To transfer the MassBank data into a CompDb database a helper function from
the CompoundDb package can be used.
library(RMariaDB)
con <- dbConnect(MariaDB(), host = "localhost", user = <username>,
pass = <password>, dbname = "MassBank")
source(system.file("scripts", "massbank_to_compdb.R", package = "CompoundDb"))
massbank_to_compdb(con)
sessionInfo()
## R version 4.3.0 RC (2023-04-13 r84269)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 22.04.2 LTS
##
## Matrix products: default
## BLAS: /home/biocbuild/bbs-3.17-bioc/R/lib/libRblas.so
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_GB LC_COLLATE=C
## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
## [9] LC_ADDRESS=C LC_TELEPHONE=C
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
##
## time zone: America/New_York
## tzcode source: system (glibc)
##
## attached base packages:
## [1] stats4 stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] CompoundDb_1.4.0 S4Vectors_0.38.0 AnnotationFilter_1.24.0
## [4] AnnotationHub_3.8.0 BiocFileCache_2.8.0 dbplyr_2.3.2
## [7] BiocGenerics_0.46.0 BiocStyle_2.28.0
##
## loaded via a namespace (and not attached):
## [1] tidyselect_1.2.0 dplyr_1.1.2
## [3] blob_1.2.4 filelock_1.0.2
## [5] Biostrings_2.68.0 bitops_1.0-7
## [7] fastmap_1.1.1 RCurl_1.98-1.12
## [9] lazyeval_0.2.2 promises_1.2.0.1
## [11] digest_0.6.31 mime_0.12
## [13] lifecycle_1.0.3 cluster_2.1.4
## [15] ProtGenerics_1.32.0 rsvg_2.4.0
## [17] ellipsis_0.3.2 KEGGREST_1.40.0
## [19] interactiveDisplayBase_1.38.0 RSQLite_2.3.1
## [21] magrittr_2.0.3 compiler_4.3.0
## [23] rlang_1.1.0 sass_0.4.5
## [25] tools_4.3.0 utf8_1.2.3
## [27] yaml_2.3.7 knitr_1.42
## [29] htmlwidgets_1.6.2 bit_4.0.5
## [31] curl_5.0.0 xml2_1.3.3
## [33] BiocParallel_1.34.0 withr_2.5.0
## [35] purrr_1.0.1 grid_4.3.0
## [37] fansi_1.0.4 colorspace_2.1-0
## [39] xtable_1.8-4 ggplot2_3.4.2
## [41] MASS_7.3-59 scales_1.2.1
## [43] cli_3.6.1 rmarkdown_2.21
## [45] crayon_1.5.2 generics_0.1.3
## [47] httr_1.4.5 rjson_0.2.21
## [49] DBI_1.1.3 cachem_1.0.7
## [51] zlibbioc_1.46.0 parallel_4.3.0
## [53] AnnotationDbi_1.62.0 BiocManager_1.30.20
## [55] XVector_0.40.0 base64enc_0.1-3
## [57] vctrs_0.6.2 jsonlite_1.8.4
## [59] bookdown_0.33 IRanges_2.34.0
## [61] bit64_4.0.5 clue_0.3-64
## [63] jquerylib_0.1.4 glue_1.6.2
## [65] codetools_0.2-19 DT_0.27
## [67] Spectra_1.10.0 gtable_0.3.3
## [69] BiocVersion_3.17.1 later_1.3.0
## [71] GenomeInfoDb_1.36.0 GenomicRanges_1.52.0
## [73] munsell_0.5.0 tibble_3.2.1
## [75] pillar_1.9.0 rappdirs_0.3.3
## [77] htmltools_0.5.5 GenomeInfoDbData_1.2.10
## [79] R6_2.5.1 evaluate_0.20
## [81] shiny_1.7.4 Biobase_2.60.0
## [83] png_0.1-8 memoise_2.0.1
## [85] httpuv_1.6.9 bslib_0.4.2
## [87] MetaboCoreUtils_1.8.0 Rcpp_1.0.10
## [89] gridExtra_2.3 ChemmineR_3.52.0
## [91] xfun_0.39 fs_1.6.2
## [93] MsCoreUtils_1.12.0 pkgconfig_2.0.3