| Title: | Interface to the 'Metabolights' REST API |
|---|---|
| Description: | Access to the 'Metabolights' REST API <https://www.ebi.ac.uk/metabolights/index>. Retrieve elements of publicly available 'Metabolights' studies. |
| Authors: | Tom Wilson [aut, cre] (ORCID: <https://orcid.org/0000-0003-3112-4682>), Steffen Neumann [ctb] (ORCID: <https://orcid.org/0000-0002-7899-7192>) |
| Maintainer: | Tom Wilson <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.4 |
| Built: | 2026-05-29 09:59:15 UTC |
| Source: | https://github.com/wilsontom/metabolighteR |
Retrieve a list of all the available public GET methods
all_get_methods()all_get_methods()
a tbl_df of API GET methods
MAF files combine the metabolite abundance matrix, the spectral data like m/z and retention time, and the metabolite names, structures and database identifiers.
create.MAF(assaytype = "LCMS", nrow = NULL, abundances = NULL)create.MAF(assaytype = "LCMS", nrow = NULL, abundances = NULL)
assaytype |
Currently unused, but would be used for different MAF files for NMR and MS |
nrow |
Create the MAF with nrow empty rows. |
abundances |
is a data frame or matrix with the metabolite abundances, intensities or concentrations. |
If an abundance matrix is given, the the generated MAF will have as many (empty) spectral and identification metadata rows as abundance rows, joined to the provided abundance matrix.
nrow and abundances should be mutually exclusive, but that is not yet tested.
maf <- create.MAF(nrow=17)maf <- create.MAF(nrow=17)
Download the contents of a specified file from a public study
download_study_file(study_id, filename)download_study_file(study_id, filename)
study_id |
a character string of a valid MTBLS study id |
filename |
a character of the full filename and extension to download |
a tibble of file contents
Retrieve the ISA Investigation for a specified Metabolights Study
get_isa_investigation(study_id)get_isa_investigation(study_id)
study_id |
A character string of a valid MTBLS study id |
the ISA-tab Investigation output
## Not run: ISA <- get_isa_investigation('MTBLS375') writeLines(isa_investigation_parse, con = paste0('outpath/ISA.txt')) ## End(Not run)## Not run: ISA <- get_isa_investigation('MTBLS375') writeLines(isa_investigation_parse, con = paste0('outpath/ISA.txt')) ## End(Not run)
Retrieve all private studies which belong to your user account
get_private_studies()get_private_studies()
a tibble of your private Study IDs
## Not run: get_private_studies() ## End(Not run)## Not run: get_private_studies() ## End(Not run)
Retrieve a list of all publically available Metabolights studies
get_studies()get_studies()
a tibble of Study IDs
get_studies()get_studies()
Retrieve the filename details for available assays of a public study
get_study_assay_file(study_id)get_study_assay_file(study_id)
study_id |
A character string of a valid MTBLS study id |
a character string of the study assay filename
get_study_assay_file('MTBLS375')get_study_assay_file('MTBLS375')
Retrieve the abstract based description of a public study
get_study_assay_list(study_id)get_study_assay_list(study_id)
study_id |
A character string of a valid MTBLS study id |
a list off the study assays and associated details
get_study_assay_list('MTBLS375')get_study_assay_list('MTBLS375')
Retrieve a list of available audit folders for a study
get_study_audit(study_id)get_study_audit(study_id)
study_id |
A character string of a valid MTBLS study id |
a list of available audit folders
get_user_studiesget_user_studies
Retrieve the contact details for a specified public study '
get_study_contacts(study_id)get_study_contacts(study_id)
study_id |
a character string of a valid MTBLS study id |
a tibble of study contacts
get_study_contacts('MTBLS375')get_study_contacts('MTBLS375')
Retrieve the abstract based description of a public study
get_study_desc(study_id)get_study_desc(study_id)
study_id |
A character string of a valid MTBLS study id |
a character string of the study description
get_study_desc('MTBLS375')get_study_desc('MTBLS375')
Retrieve the study descriptors and annotation values for a publically available study
get_study_descriptors(study_id)get_study_descriptors(study_id)
study_id |
A character string of a valid MTBLS study id |
a tibble of study descriptors
get_study_descriptors('MTBLS375')get_study_descriptors('MTBLS375')
Retrieve the study factors and annotation values for a publically available study
get_study_factors(study_id)get_study_factors(study_id)
study_id |
A character string of a valid MTBLS study id |
a tibble of study factors
get_study_factors('MTBLS375')get_study_factors('MTBLS375')
Retrieve the names and type of all files that have been deposited with the public study. If raw_data is TRUE then details of raw data files(ie, .mzML) are also returned.
get_study_files(study_id, raw_data = FALSE)get_study_files(study_id, raw_data = FALSE)
study_id |
A character string of a valid MTBLS study id |
raw_data |
logical; if |
a tibble of file info
get_study_files('MTBLS375', raw_data = FALSE)get_study_files('MTBLS375', raw_data = FALSE)
Retrieve the meta data for a publically available study
get_study_meta(study_id)get_study_meta(study_id)
study_id |
A character string of a valid MTBLS study id |
a tibble of study meta data
get_study_meta('MTBLS375')get_study_meta('MTBLS375')
Retrieve the organisms used within a study
get_study_org(study_id)get_study_org(study_id)
study_id |
A character string of a valid MTBLS study id |
a tibble of study organism data
## Not run: get_study_org('MTBLS375') ## End(Not run)## Not run: get_study_org('MTBLS375') ## End(Not run)
Retrieve the protocol information that has been deposited for a public study
get_study_protocols(study_id)get_study_protocols(study_id)
study_id |
A character string of a valid MTBLS study id |
a tibble of study protocols
get_study_protocols('MTBLS375')get_study_protocols('MTBLS375')
Retrieve details on any publications that have been associated with the study
get_study_pubs(study_id)get_study_pubs(study_id)
study_id |
A character string of a valid MTBLS study id |
a tibble of study publications
get_study_pubs('MTBLS375')get_study_pubs('MTBLS375')
Get a list of all sample names mapped to files within the study
get_study_samples(study_id)get_study_samples(study_id)
study_id |
A character string of a valid MTBLS study id |
a tibble of filename sample name and reliability score. 1.0 indicates a perfect match
## Not run: get_study_samples('MTBLS375') ## End(Not run)## Not run: get_study_samples('MTBLS375') ## End(Not run)
Retrieve a tibble of all Study IDs and the analytical technology used in the study
get_study_tech()get_study_tech()
a tibble of study id and technology
get_study_tech()get_study_tech()
Retrieve the full title of the study
get_study_title(study_id)get_study_title(study_id)
study_id |
A character string of a valid MTBLS study id |
a character string of the study title
get_study_title('MTBLS375')get_study_title('MTBLS375')
Retrieve a list of studies for a user
get_user_studies()get_user_studies()
a list of user owned studies
get_user_studiesget_user_studies
Retrieve details about the Metabolights RESTful WebService
get_webservice()get_webservice()
a list of the MTBLS webservice information
get_webservice()get_webservice()
Set your Metabolights API Token as global option. If MTBLS_API_KEY is set in .Renviron then this variable will be passed directly
to the MTBLS_API_KEY option. If no MTBLS_API_KEY is set in .Renviron, then the API Token must be passed as an input in the set_api_token
function
mtbls_key(API_KEY = NULL)mtbls_key(API_KEY = NULL)
API_KEY |
a character string of your Metabolights API Token (Default is |
## Not run: # If API Token is set in `.Renviron` mtbls_key() # If API Token is not set in `.Renviron` mtbls_key('XXXX-0000-XXXX-0000') ## End(Not run)## Not run: # If API Token is set in `.Renviron` mtbls_key() # If API Token is not set in `.Renviron` mtbls_key('XXXX-0000-XXXX-0000') ## End(Not run)
Read the MAF file as data frame.
read.MAF(file)read.MAF(file)
file |
A filename to a MAF file |
a data frame. Row and column names are NOT "fixed" via make.names
file <- system.file("examples/m_MTBLS1968_LC-MS_positive_reverse-phase_metabolite_profiling_v2_maf.tsv", package = "metabolighteR") maf <- read.MAF(file)file <- system.file("examples/m_MTBLS1968_LC-MS_positive_reverse-phase_metabolite_profiling_v2_maf.tsv", package = "metabolighteR") maf <- read.MAF(file)
Write a suitably formatted data frame to a MAF file.
write.MAF(maf, file = "")write.MAF(maf, file = "")
maf |
MAF data frame to write |
file |
either a character string naming a file or a connection open for writing. "" indicates output to the console. |
maf <- create.MAF(nrow=17) write.MAF(maf, file=tempfile())maf <- create.MAF(nrow=17) write.MAF(maf, file=tempfile())