Introduction

Through integration with Metabolomics Workbench API, lipidr allows users, to quickly explore public lipidomics experiments. lipidr provides an easy way to re-analyze and visualize these datasets.

Loading libraries

First, we load lipidr using library command. For this vignette we will enable interactive graphics plotting by calling use_interactive_graphics().

Explore Metabolomics Workbench lipidomics datasets

Users can search all Metabolomics Workbench studies using any relevant keyword. A list of all studies matching the keyword will be returned as a table (data.frame).

list_mw_studies(keyword = "lipid")

Download datasets

Datasets can be easily downloaded and parsed into LipidomicsExperiment object using lipidr function fetch_mw_study() by supplying a study_id. The example shown in this vignette is from ST001111 link. The dataset contains positive and negative MS data for untargeted lipidomics from different breast cancer tissues.

d = fetch_mw_study("ST001111")

d
## class: LipidomicsExperiment 
## dim: 777 118 
## metadata(4): summarized dimnames summarized dimnames
## assays(1): Area
## rownames(777): CE 16:0 [M+NH4]+ CE 16:1 [M+NH4]+ ... PS 44:6
##   (22:1(13Z)/22:5(4Z.7Z.10Z.13Z.16Z)) [M-H]- PS 46:5
##   (22:5(4Z.7Z.10Z.13Z.16Z)/24:0) [M-H]-
## rowData names(22): filename Molecule ... total_cs Class
## colnames(118): 1 2 ... 117 118
## colData names(4): SampleType Race Stage Tumor.Type

Note the warning that some molecules were not parsed because their names did not follow the supported patterns. We can examine these molecules, remove them from the dataset or change their names, if desired.

# list non_parsed molecules
non_parsed_molecules(d)
## [1] "SB N-(15Z-tetracosenoyl)-sphing-4-enine (d18:1/24:1)"
## [2] "SB N-(9Z-octadecenoyl)-sphinganine (d18:0/18:1)"     
## [3] "SB N-(docosanoyl)-sphing-4-enine (d18:1/22:0)"       
## [4] "SB N-(eicosanoyl)-sphing-4-enine (d18:1/20:0)"       
## [5] "SB N-(hexadecanoyl)-sphing-4-enine (d18:1/16:0)"     
## [6] "SB N-(octadecanoyl)-sphing-4-enine (d18:1/18:0)"     
## [7] "SB N-(octadecanoyl)-sphinganine (d18:0/18:0)"        
## [8] "SB N-(tetracosanoyl)-sphing-4-enine (d18:1/24:0)"
# All of them are Ceramides, written with full chemical name
# We can replace the first part with "Cer" using RegEx
non_parsed <- non_parsed_molecules(d)
new_names <- sub("^.* \\(", "Cer (", non_parsed)
d <- update_molecule_names(d, old = non_parsed, new = new_names)

# We can check once again to make sure all molecules were parsed correctly
non_parsed_molecules(d)
## character(0)

We can have a look at the clinical data, which was conveniently extracted from Metabolomics Workbench by lipidr.

colData(d)

Next, we tell lipidr that our dataset is normalized and logged.

d <- set_logged(d, "Area", TRUE)
d <- set_normalized(d, "Area", TRUE)

Quality control

We look at total ion concentration (TIC) and distribution (boxplot) for each sample.

plot_samples(d, "tic")
plot_samples(d, "boxplot")