MyNixOS website logo
Description

CEU Mass Mediator RESTful API.

CEU (CEU San Pablo University) Mass Mediator is an on-line tool for aiding researchers in performing metabolite annotation. 'cmmr' (CEU Mass Mediator RESTful API) allows for programmatic access in R: batch search, batch advanced search, MS/MS (tandem mass spectrometry) search, etc. For more information about the API Endpoint please go to <https://github.com/lzyacht/cmmr>.

CMMR - CEU Mass Mediator API in R

CRAN status Travis build status

Consuming CEU Mass Mediator RESTful API in R.

Thank you @albertogilf for your kindness and help!

Please find the CEU Mass Mediator source code repository: CEU Mass Mediator source code on GitHub

The CEU Mass Mediator Website: CEU Mass Mediator

API Endpoint

Batch search http://ceumass.eps.uspceu.es/mediator/api/v3/batch

Advanced search http://ceumass.eps.uspceu.es/mediator/api/v3/advancedbatch

MS/MS search http://ceumass.eps.uspceu.es/mediator/api/msmssearch

About

CEU Mass Mediator is an online tool that aides researchers in identifying metabolites from mass spectrometry experiments. It is currently available as a web interface and a RESTful API. CMMR is a RESTful API implemented for R. This makes it easy to access CEU Mass Mediator programatically in R, integrating search results seamlessly into users custom pipelines and workflows.

Installation

install.packages("cmmr")

Development version

To get a bug fix, or use a feature from the development version, you can install cmmr from GitHub.

# install.packages("devtools")
devtools::install_github("lzyacht/cmmr")

Example

Batch search

Batch search all result in positive mode

library(cmmr)

batch_df_pos <- batch_search('http://ceumass.eps.uspceu.es/mediator/api/v3/batch',
                             'all-except-peptides',
                             '["all-except-mine"]',
                             'mz',
                             'positive',
                             '["M+H","M+Na"]',
                             100,
                             'ppm',
                             c(670.4623, 1125.2555, 602.6180))


head(batch_df_pos)
str(batch_df_pos)

Batch search all result in negative mode

library(cmmr)

batch_df_neg <- batch_search('http://ceumass.eps.uspceu.es/mediator/api/v3/batch',
                             'all-except-peptides',
                             '["all-except-mine"]',
                             'mz',
                             'negative',
                             '["M-H","M+Cl"]',
                             100,
                             'ppm',
                             c(670.4623, 1125.2555, 602.6180))
                             
head(batch_df_neg)
str(batch_df_neg)

Providing external *.csv files for search

You may want to load your own list of m/zs from a csv or excel file to search the database.

unique_mz_file <- system.file("extdata", "unique_mz.csv", package = "cmmr")
unique_mz <- read.table(unique_mz_file, sep = ",", stringsAsFactors = FALSE, header = FALSE)
unique_mz <- as.array(unique_mz[, 1])

batch_df_neg <- batch_search('http://ceumass.eps.uspceu.es/mediator/api/v3/batch',
                             'all-except-peptides',
                             '["all-except-mine"]',
                             'mz',
                             'negative',
                             '["M-H","M+Cl"]',
                             10,
                             'ppm',
                             unique_mz)

And save it as a *.csv to the same folder or some other specified folder


# Save to the same folder of the unique_mz.csv
write.table(batch_df_neg, sub(".csv", "_db_search.csv", unique_mz_file),
                               sep = ",", row.names = FALSE)

Save to current working directory

write.table(batch_df_neg, "batch_df_neg.csv", sep = ",", row.names = FALSE)                          

Advanced batch search

library(cmmr)

advanced_batch_df <- advanced_batch_search(
  cmm_url             = paste0(
    'http://ceumass.eps.uspceu.es/mediator/api/v3/',
    'advancedbatch'),
  chemical_alphabet   = 'all',
  modifiers_type      = 'none',
  metabolites_type    = 'all-except-peptides',
  databases           = '["hmdb"]',
  masses_mode         = 'mz',
  ion_mode            = 'positive',
  adducts             = '["all"]',
  deuterium           = 'false',
  tolerance           = '7.5',
  tolerance_mode      = 'ppm',
  masses              = '[400.3432, 288.2174]',
  all_masses          = '[]',
  retention_times     = '[18.842525, 4.021555]',
  all_retention_times = '[]',
  composite_spectra   = paste0(
    '[[{ "mz": 400.3432, "intensity": 307034.88 }, ',
    '{ "mz": 311.20145, "intensity": 400.03336 }]]'
))

head(advanced_batch_df)
str(advanced_batch_df)

MSMS Search

library(cmmr)

ms_ms_peaks <- matrix(
  c(40.948, 0.174,
    56.022, 0.424,
    84.37, 53.488,
    101.50, 8.285,
    102.401, 0.775,
    129.670, 100.000,
    146.966, 20.070),
  ncol = 2,
  byrow = TRUE)

ms2_df <- msms_search(ion_mass = 147, ms_ms_peaks = ms_ms_peaks, ion_mode = 'positive')

head(ms2_df)
str(ms2_df)
Metadata

Version

0.1.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows