knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
suppressPackageStartupMessages(library(metabolighteR))
MetaboLights is a database for metabolomics experiments and associated information. The database allows users to deposit raw data, sample information, analysis protocols and metabolite annotation data.
metabolighteR provides easy access to publicly available MetaboLights studies via the MetaboLights RESTful API. Only API methods which retrieve data (GET
) are supported by metabolighteR.
metabolighteR can be installed from CRAN or, for the latest development version, directly from GitHub using the remotes
package.
install.packages('metabolighteR') remotes::install_github('aberHRML/metabolighteR') library(metabolighteR)
A list of all public study identification codes can be easily retrieved.
all_study_ids <- get_studies() studies <- as.vector(all_study_ids$study) head(studies)
Generate a summary table containing; Study ID, Study Title and Study Technology, for publicly available studies.
# For the first five studies study_titles <- purrr::map(studies[1:5], get_study_title) names(study_titles) <- studies[1:5] study_titles <- tibble::as_tibble(study_titles) %>% tidyr::gather() names(study_titles) <- c('STUDY', 'Title') study_tech <- get_study_tech() study_tech_filter <- study_tech %>% dplyr::filter(STUDY %in% studies[1:5]) StudyInfoTable <- dplyr::left_join(study_titles, study_tech_filter, by = 'STUDY')
StudyInfoTable
A list of all available files can be generated using the get_study_files
function.
studyFileList <- get_study_files('MTBLS264') studyFileList
The contents of these files can then be downloaded using the download_file
function.
fileContents_A <- download_study_file('MTBLS264', studyFileList$file[1]) head(fileContents_A) fileContents_B <- download_study_file('MTBLS264', studyFileList$file[4]) head(fileContents_B)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.