Package 'cmmr'

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

Help Index


Create POST request Body for advanced batch search

Description

create_advanced_batch_body creates a list for the advanced batch search POST request.

Usage

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()
)

Arguments

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)

Value

A properly formatted JSON body for the POST request.


Create POST request Body for batch search

Description

create_batch_body returns a string of a POST request body.

Usage

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
)

Arguments

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

Value

If all inputs are all correctly formatted, a string of a POST request will be returned for the result.

Examples

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 MS/MS search POST request body

Description

create_msms_body returns a string of a POST request body.

Usage

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"
)

Arguments

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

Value

If all inputs are all correctly formatted, a string of a POST request will be returned for the result.