Package: rmzTabM
Authors: Steffen Neumann
Modified: 2025-08-13 15:48:09.184513
Compiled: Wed Aug 13 15:52:12 2025
library(BiocStyle)
library(rmzTabM)
library(metabolighteR)
#> Loading required package: magrittr
library(kableExtra)
The Metabolites Asignement File (MAF) is used by the EMBL-EBI MetaboLights repository to capture the metabolite abundances in the individual samples, the spectral characteristics of the features and, if present, the metabolite identifications.
The convertMzTab2MAF()
function will read the mzTab-M
via readMzTab()
and extract the smlTable
and
the smfTable
. Abundances are extracted from the
smlTable
, while m/z and retention time come from
the feature table.
The MAF is created as a data.frame
and written as TSV
using write.MAF()
from the metabolighteR
package by Tom Wilson. The data.frame is also returned as (invisible)
return value of convertMzTab2MAF()
.
# An example file:
mzTabfile <- system.file("testdata",
"MTBLS263.mztab",
package="rmzTabM",
mustWork=TRUE)
# Another example file shipped is:
mztabfile <- system.file("testdata",
c("lcmsms_dda_hydrophilic_height_mzTab.mztab"),
package="rmzTabM",
mustWork=TRUE)
MAFfile <- file.path(tempdir(check=TRUE), "m_MTBLS0815_v2_maf.tsv")
maf <- convertMzTab2MAF(mzTabfile=mztabfile,
MAFfile=MAFfile)
kable(head(maf[!(grepl ("MSP: Unknown", maf$database_identifier) | is.na(maf$database_identifier)), ])) %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed", font_size = 7)) %>%
scroll_box(width = "800px", height = "200px")
database_identifier | chemical_formula | smiles | inchi | metabolite_identification | mass_to_charge | fragmentation | charge | modifications | retention_time | taxid | species | database | database_version | reliability | uri | search_engine | search_engine_score | smallmolecule_abundance_sub | smallmolecule_abundance_stdev_sub | smallmolecule_abundance_std_error_sub | 0717_kinetex_wine_50_4min_pos_IDA_A1 | 0717_kinetex_wine_50_4min_pos_IDA_B1 | 0717_kinetex_wine_50_4min_pos_IDA_C1 | 0717_kinetex_wine_50_4min_pos_IDA_D1 | 0717_kinetex_wine_50_4min_pos_IDA_E1 | 0717_kinetex_wine_50_4min_pos_IDA_F1 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
193 | MSP: URACIL | C4H4N2O2 | OC1=NC(O)=NC=C1 | NA | w/o MS2:URACIL | 113.0359 | NA | NA | NA | 32.05267 | NA | NA | 1 | Unknown | 63 | NA | NA | NA | NA | NA | NA | 9664 | 7888 | 5912 | 13912 | 8022 | 4678 |
220 | MSP: C5H9NO2; PlaSMA ID-48 | C5H9NO2 | NA | NA | C5H9NO2; PlaSMA ID-48 | 116.0708 | NA | NA | NA | 28.98533 | NA | NA | 1 | Unknown | 88.8 | NA | NA | NA | NA | NA | NA | 11891 | 6080 | 13243 | 14411 | 10669 | 28595 |
325 | MSP: Pyroglutamic acid (not validated, isomer of 89); PlaSMA ID-88 | C5H7NO3 | O=C(O)C1NC(=O)CC1 | NA | Pyroglutamic acid (not validated, isomer of 89); PlaSMA ID-88 | 130.0494 | NA | NA | NA | 38.17650 | NA | NA | 1 | Unknown | 86.8 | NA | NA | NA | NA | NA | NA | 25494 | 19988 | 32873 | 28238 | 26622 | 35567 |
354 | MSP: Leucine; PlaSMA ID-100 | C6H13NO2 | O=C(O)C(N)CC(C)C | NA | w/o MS2:Leucine; PlaSMA ID-100 | 132.1008 | NA | NA | NA | 147.66800 | NA | NA | 1 | Unknown | 99.6 | NA | NA | NA | NA | NA | NA | 1092 | 607 | 2840 | 465 | 1234 | 1083 |
402 | MSP: Hypoxanthine | C5H4N4O | OC1=NC=NC=2NC=NC12 | NA | w/o MS2:Hypoxanthine | 137.0468 | NA | NA | NA | 31.73683 | NA | NA | 1 | Unknown | 68.1 | NA | NA | NA | NA | NA | NA | 7305 | 3924 | 10788 | 13304 | 9321 | 8399 |
471 | MSP: 4-Methyl-5-thiazoleethanol; LC-ESI-QTOF; MS2; CE | C6H9NOS | CC1=C(CCO)SC=N1 | NA | w/o MS2:4-Methyl-5-thiazoleethanol; LC-ESI-QTOF; MS2; CE | 144.0475 | NA | NA | NA | 47.81267 | NA | NA | 1 | Unknown | 67 | NA | NA | NA | NA | NA | NA | 23383 | 17362 | 24074 | 32806 | 17364 | 34208 |
sessionInfo()
#> R version 4.5.1 (2025-06-13)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 24.04.2 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0
#>
#> locale:
#> [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
#> [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
#> [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
#> [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: UTC
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] kableExtra_1.4.0 metabolighteR_0.1.4 magrittr_2.0.3
#> [4] rmzTabM_1.0.5.9007 BiocStyle_2.36.0
#>
#> loaded via a namespace (and not attached):
#> [1] jsonlite_2.0.0 dplyr_1.1.4 compiler_4.5.1
#> [4] BiocManager_1.30.26 tidyselect_1.2.1 xml2_1.3.8
#> [7] stringr_1.5.1 bitops_1.0-9 tidyr_1.3.1
#> [10] jquerylib_0.1.4 systemfonts_1.2.3 scales_1.4.0
#> [13] textshaping_1.0.1 yaml_2.3.10 fastmap_1.2.0
#> [16] R6_2.6.1 generics_0.1.4 knitr_1.50
#> [19] tibble_3.3.0 desc_1.4.3 svglite_2.2.1
#> [22] bslib_0.9.0 pillar_1.11.0 RColorBrewer_1.1-3
#> [25] rlang_1.1.6 stringi_1.8.7 cachem_1.1.0
#> [28] xfun_0.52 fs_1.6.6 caTools_1.18.3
#> [31] sass_0.4.10 viridisLite_0.4.2 cli_3.6.5
#> [34] withr_3.0.2 pkgdown_2.1.3 digest_0.6.37
#> [37] rstudioapi_0.17.1 lifecycle_1.0.4 vctrs_0.6.5
#> [40] evaluate_1.0.4 glue_1.8.0 farver_2.1.2
#> [43] ragg_1.4.0 purrr_1.1.0 rmarkdown_2.29
#> [46] httr_1.4.7 tools_4.5.1 pkgconfig_2.0.3
#> [49] htmltools_0.5.8.1