Title: | CEU Mass Mediator RESTful API |
---|---|
Description: | 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/YaoxiangLi/cmmr>. |
Authors: | Yaoxiang Li [aut, cre] , Alberto Gil de la Fuente [aut], Charles Hinzman [aut], Amrita Cheema [aut] |
Maintainer: | Yaoxiang Li <[email protected]> |
License: | GPL-3 |
Version: | 1.0.5 |
Built: | 2024-11-10 05:00:03 UTC |
Source: | https://github.com/yaoxiangli/cmmr |
advanced_batch_search
performs an advanced batch search on the CEU Mass Mediator API
and returns a dataframe of search results.
advanced_batch_search( cmm_url = "https://ceumass.eps.uspceu.es/mediator/api/v3/advancedbatch", chemical_alphabet = "all", modifiers_type = "none", metabolites_type = "all-except-peptides", databases = list("hmdb"), masses_mode = "mz", ion_mode = "positive", adducts = list("all"), deuterium = FALSE, tolerance = 10, tolerance_mode = "ppm", masses = c(399.3367, 421.3169, 315.2424, 337.2234, 280.2402), all_masses = list(), retention_times = c(18.8425, 18.8425, 8.1449, 8.1449, 28.2695, 4.0216), all_retention_times = list(), composite_spectra = list(), all_composite_spectra = list() )
advanced_batch_search( cmm_url = "https://ceumass.eps.uspceu.es/mediator/api/v3/advancedbatch", chemical_alphabet = "all", modifiers_type = "none", metabolites_type = "all-except-peptides", databases = list("hmdb"), masses_mode = "mz", ion_mode = "positive", adducts = list("all"), deuterium = FALSE, tolerance = 10, tolerance_mode = "ppm", masses = c(399.3367, 421.3169, 315.2424, 337.2234, 280.2402), all_masses = list(), retention_times = c(18.8425, 18.8425, 8.1449, 8.1449, 28.2695, 4.0216), all_retention_times = list(), composite_spectra = list(), all_composite_spectra = list() )
cmm_url |
A character string specifying the CEU Mass Mediator API endpoint. |
chemical_alphabet |
A character string specifying the chemical alphabet to use. |
modifiers_type |
A character string specifying the modifier type. |
metabolites_type |
A character string specifying the metabolites type. |
databases |
A list specifying the databases to search. |
masses_mode |
A character string specifying the masses mode. |
ion_mode |
A character string specifying the ionization mode. |
adducts |
A list specifying the adducts to include in the search. |
deuterium |
Logical value indicating whether to consider deuterium substitutions. |
tolerance |
A numeric value specifying the mass tolerance. |
tolerance_mode |
A character string specifying the tolerance mode. |
masses |
A numeric vector of masses to search. |
all_masses |
A list for arrays of masses (optional). |
retention_times |
A numeric vector of retention times corresponding to the masses. |
all_retention_times |
A list for retention times arrays (optional). |
composite_spectra |
A list for composite spectra (optional). |
all_composite_spectra |
A list for all composite spectra (optional) |
A dataframe containing the search results from the CEU Mass Mediator API.
df <- advanced_batch_search( cmm_url = "https://ceumass.eps.uspceu.es/mediator/api/v3/advancedbatch", chemical_alphabet = "all", modifiers_type = "none", metabolites_type = "all-except-peptides", databases = list("hmdb"), masses_mode = "mz", ion_mode = "positive", adducts = list("all"), deuterium = FALSE, tolerance = 10.0, tolerance_mode = "ppm", masses = c(399.3367, 421.31686, 315.2424, 337.2234, 280.2402), all_masses = list(), retention_times = c(18.842525, 18.842525, 8.144917, 8.144917, 28.269503, 4.021555), all_retention_times = list(), composite_spectra = list(), all_composite_spectra = list() ) head(df)
df <- advanced_batch_search( cmm_url = "https://ceumass.eps.uspceu.es/mediator/api/v3/advancedbatch", chemical_alphabet = "all", modifiers_type = "none", metabolites_type = "all-except-peptides", databases = list("hmdb"), masses_mode = "mz", ion_mode = "positive", adducts = list("all"), deuterium = FALSE, tolerance = 10.0, tolerance_mode = "ppm", masses = c(399.3367, 421.31686, 315.2424, 337.2234, 280.2402), all_masses = list(), retention_times = c(18.842525, 18.842525, 8.144917, 8.144917, 28.269503, 4.021555), all_retention_times = list(), composite_spectra = list(), all_composite_spectra = list() ) head(df)
batch_search
returns a dataframe with the results from the database search.
batch_search( cmm_url = "https://ceumass.eps.uspceu.es/api/v3/batch", metabolites_type = "all-except-peptides", databases = "[\"all-except-mine\"]", masses_mode = "mz", ion_mode = "positive", adducts = "[\"M+H\",\"M+Na\"]", tolerance = 10, tolerance_mode = "ppm", unique_mz )
batch_search( cmm_url = "https://ceumass.eps.uspceu.es/api/v3/batch", metabolites_type = "all-except-peptides", databases = "[\"all-except-mine\"]", masses_mode = "mz", ion_mode = "positive", adducts = "[\"M+H\",\"M+Na\"]", tolerance = 10, tolerance_mode = "ppm", unique_mz )
cmm_url |
A URL string for the CEU Mass Mediator or a local API endpoint. |
metabolites_type |
Search metabolites type: "all-except-peptides", "only-lipids", or "all-including-peptides". |
databases |
A JSON array of databases to search: e.g., "all", "HMDB", "LipidMaps", etc. |
masses_mode |
Masses mode: "neutral" or "mz". |
ion_mode |
Ionization mode: "positive" or "negative". |
adducts |
A JSON array of adducts to include in the search, e.g., '["M+H", "M+Na"]'. |
tolerance |
A numeric tolerance value (range: 0-100). |
tolerance_mode |
Tolerance mode: "ppm" or "mDa". |
unique_mz |
A numeric vector of unique m/z values for the search. |
A dataframe containing search results.
df_pos <- batch_search( "https://ceumass.eps.uspceu.es/api/v3/batch", "all-except-peptides", '["all-except-mine"]', "mz", "positive", '["M+H","M+Na"]', 10, "ppm", c(670.4623, 1125.2555, 602.6180) )
df_pos <- batch_search( "https://ceumass.eps.uspceu.es/api/v3/batch", "all-except-peptides", '["all-except-mine"]', "mz", "positive", '["M+H","M+Na"]', 10, "ppm", c(670.4623, 1125.2555, 602.6180) )
create_advanced_batch_body
creates a list for the advanced batch search POST request.
create_advanced_batch_body( chemical_alphabet = "all", modifiers_type = "none", metabolites_type = "all-except-peptides", databases = list("hmdb"), masses_mode = "mz", ion_mode = "positive", adducts = list("all"), deuterium = FALSE, tolerance = 10, tolerance_mode = "ppm", masses = c(399.3367, 421.3169, 315.2424, 337.2234, 280.2402), all_masses = list(), retention_times = c(18.8425, 18.8425, 8.1449, 8.1449, 28.2695, 4.0216), all_retention_times = list(), composite_spectra = list(), all_composite_spectra = list() )
create_advanced_batch_body( chemical_alphabet = "all", modifiers_type = "none", metabolites_type = "all-except-peptides", databases = list("hmdb"), masses_mode = "mz", ion_mode = "positive", adducts = list("all"), deuterium = FALSE, tolerance = 10, tolerance_mode = "ppm", masses = c(399.3367, 421.3169, 315.2424, 337.2234, 280.2402), all_masses = list(), retention_times = c(18.8425, 18.8425, 8.1449, 8.1449, 28.2695, 4.0216), all_retention_times = list(), composite_spectra = list(), all_composite_spectra = list() )
chemical_alphabet |
A string for the chemical alphabet: "CHNOPS", "CHNOPSCL", "ALL". |
modifiers_type |
A string for the modifier type: "none", "NH3", "HCOO", etc. |
metabolites_type |
A string for metabolites type: "all-except-peptides", "only-lipids", etc. |
databases |
A vector of databases to search: e.g., list("HMDB"). |
masses_mode |
A string specifying masses mode: "neutral" or "mz". |
ion_mode |
A string for the ionization mode: "positive", "negative", etc. |
adducts |
A vector of adducts to include in the search, e.g., list("M+H", "M+Na"). |
deuterium |
Logical value: whether to consider deuterium substitutions (TRUE or FALSE). |
tolerance |
Numeric value specifying the tolerance. |
tolerance_mode |
A string for the tolerance mode: "ppm" or "mDa". |
masses |
Numeric vector of masses to search. |
all_masses |
Empty array for all masses (optional). |
retention_times |
Numeric vector of retention times. |
all_retention_times |
Empty array for retention times (optional). |
composite_spectra |
Empty array for composite spectra. |
all_composite_spectra |
A list for all composite spectra (optional) |
A properly formatted JSON body for the POST request.
create_batch_body
returns a string of a POST request body.
create_batch_body( metabolites_type = "all-except-peptides", databases = "[\"all-except-mine\"]", masses_mode = "mz", ion_mode = "positive", adducts = "[\"M+H\",\"M+Na\"]", tolerance = 10, tolerance_mode = "ppm", unique_mz )
create_batch_body( metabolites_type = "all-except-peptides", databases = "[\"all-except-mine\"]", masses_mode = "mz", ion_mode = "positive", adducts = "[\"M+H\",\"M+Na\"]", tolerance = 10, tolerance_mode = "ppm", unique_mz )
metabolites_type |
"all-except-peptides", "only-lipids", "all-including-peptides" |
databases |
"all", "all-except-mine", "HMDB", "LipidMaps", "Metlin", "Kegg", "in-house", "mine" |
masses_mode |
"neutral", "mz" |
ion_mode |
"positive", "negative" |
adducts |
for positive mode [M+H, M+2H, M+Na, M+K,M+NH4, M+H-H2O] |
tolerance |
double (Range: [0..100]) |
tolerance_mode |
"ppm", "mDa" |
unique_mz |
An array of unique m/zs |
If all inputs are all correctly formatted, a string of a POST request will be returned for the result.
batch_body <- create_batch_body( "all-except-peptides", '["all-except-mine"]', "mz", "positive", '["M+H","M+Na"]', 10, "ppm", c(670.4623, 1125.2555, 602.6180) ) batch_body <- create_batch_body( "all-except-peptides", '["all-except-mine"]', "mz", "negative", '["M-H","M+Cl"]', 10, "ppm", c(670.4623, 1125.2555, 602.6180) ) ## Not run: create_batch_body(c(670.4623, 1125.2555, 602.6180)) ## End(Not run)
batch_body <- create_batch_body( "all-except-peptides", '["all-except-mine"]', "mz", "positive", '["M+H","M+Na"]', 10, "ppm", c(670.4623, 1125.2555, 602.6180) ) batch_body <- create_batch_body( "all-except-peptides", '["all-except-mine"]', "mz", "negative", '["M-H","M+Cl"]', 10, "ppm", c(670.4623, 1125.2555, 602.6180) ) ## Not run: create_batch_body(c(670.4623, 1125.2555, 602.6180)) ## End(Not run)
create_msms_body
returns a string of a POST request body.
create_msms_body( ion_mass, ms_ms_peaks, precursor_ion_tolerance = 500, precursor_ion_tolerance_mode = "mDa", precursor_mz_tolerance = 1000, precursor_mz_tolerance_mode = "mDa", ion_mode = "positive", ionization_voltage = "all", spectra_types = "experimental" )
create_msms_body( ion_mass, ms_ms_peaks, precursor_ion_tolerance = 500, precursor_ion_tolerance_mode = "mDa", precursor_mz_tolerance = 1000, precursor_mz_tolerance_mode = "mDa", ion_mode = "positive", ionization_voltage = "all", spectra_types = "experimental" )
ion_mass |
ion_mass |
ms_ms_peaks |
ms_ms_peaks |
precursor_ion_tolerance |
precursor_ion_tolerance |
precursor_ion_tolerance_mode |
precursor_ion_tolerance_mode |
precursor_mz_tolerance |
precursor_mz_tolerance |
precursor_mz_tolerance_mode |
precursor_mz_tolerance_mode |
ion_mode |
ion_mode |
ionization_voltage |
ionization_voltage |
spectra_types |
spectra_types |
If all inputs are all correctly formatted, a string of a POST request will be returned for the result.
msms_search
performs an MS/MS search on the CEU Mass Mediator API
and returns a dataframe with the search results.
msms_search( ion_mass, ms_ms_peaks, precursor_ion_tolerance = 100, precursor_ion_tolerance_mode = "mDa", precursor_mz_tolerance = 500, precursor_mz_tolerance_mode = "mDa", ion_mode, ionization_voltage = "all", spectra_types = "experimental", cmm_url = "https://ceumass.eps.uspceu.es/api/msmssearch" )
msms_search( ion_mass, ms_ms_peaks, precursor_ion_tolerance = 100, precursor_ion_tolerance_mode = "mDa", precursor_mz_tolerance = 500, precursor_mz_tolerance_mode = "mDa", ion_mode, ionization_voltage = "all", spectra_types = "experimental", cmm_url = "https://ceumass.eps.uspceu.es/api/msmssearch" )
ion_mass |
Numeric. Mass of the ion to search for. |
ms_ms_peaks |
Matrix. The MS/MS peaks, with two columns representing mass and intensity. |
precursor_ion_tolerance |
Numeric. Tolerance for the precursor ion (default: 100.0). |
precursor_ion_tolerance_mode |
Character. Tolerance mode for precursor ion: |
precursor_mz_tolerance |
Numeric. Tolerance for the m/z (default: 500.0). |
precursor_mz_tolerance_mode |
Character. Tolerance mode for precursor m/z: |
ion_mode |
Character. Ionization mode: |
ionization_voltage |
Character. Ionization voltage to use (default: "all"). |
spectra_types |
Character. Spectra types: |
cmm_url |
Character. URL for the CEU Mass Mediator API (default: "https://ceumass.eps.uspceu.es/api/msmssearch"). |
A dataframe containing the search results from the CEU Mass Mediator API.
ms_ms_peaks <- matrix( c( 40.948, 0.174, 56.022, 0.424, 84.370, 53.488, 101.500, 8.285, 102.401, 0.775, 129.670, 100.000, 146.966, 20.070 ), ncol = 2, byrow = TRUE ) df <- msms_search( ion_mass = 147, ms_ms_peaks = ms_ms_peaks, ion_mode = "positive" )
ms_ms_peaks <- matrix( c( 40.948, 0.174, 56.022, 0.424, 84.370, 53.488, 101.500, 8.285, 102.401, 0.775, 129.670, 100.000, 146.966, 20.070 ), ncol = 2, byrow = TRUE ) df <- msms_search( ion_mass = 147, ms_ms_peaks = ms_ms_peaks, ion_mode = "positive" )