The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
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
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
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.
install.packages("cmmr")
To get a bug fix, or use a feature from the development version, you can install cmmr from GitHub.
# install.packages("devtools")
::install_github("lzyacht/cmmr") devtools
Batch search all result in positive mode
library(cmmr)
<- batch_search('http://ceumass.eps.uspceu.es/mediator/api/v3/batch',
batch_df_pos '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_search('http://ceumass.eps.uspceu.es/mediator/api/v3/batch',
batch_df_neg '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)
You may want to load your own list of m/zs from a csv or excel file to search the database.
<- system.file("extdata", "unique_mz.csv", package = "cmmr")
unique_mz_file <- read.table(unique_mz_file, sep = ",", stringsAsFactors = FALSE, header = FALSE)
unique_mz <- as.array(unique_mz[, 1])
unique_mz
<- batch_search('http://ceumass.eps.uspceu.es/mediator/api/v3/batch',
batch_df_neg '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)
library(cmmr)
<- advanced_batch_search(
advanced_batch_df 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)
library(cmmr)
<- matrix(
ms_ms_peaks 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)
<- msms_search(ion_mass = 147, ms_ms_peaks = ms_ms_peaks, ion_mode = 'positive')
ms2_df
head(ms2_df)
str(ms2_df)
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.