Learn R Programming

mseapca (version 2.2.1)

setlabel: Generate binary label matrix of metabolite set

Description

This function generates binary label matrix of metabolites and metabolite sets. This is mainly used to be called by other functions, and used to count the number of metabolites in a specific metabolite set.

Usage

setlabel(MET, M)

Value

binary label matrix of metabolites in metabolite sets

Arguments

MET

A character vector of metabolites (e.g., detected or significant metabolites).

M

A named list of metabolite sets, where each element is a character vector of metabolites.

Author

Hiroyuki Yamamoto

Details

This function is used internally in various ORA methods (e.g., ora_det, ora_all, ora_est) to compute contingency tables for enrichment analysis.

Examples

Run this code
# Example
data(fasting)
data(pathway)

MET <- colnames(fasting$X) # detected metabolites
M <- pathway$fasting # metabolite set list

# Fix for multiple annotations
MET[MET == "UDP-glucose ; UDP-galactose"] <- "UDP-glucose"
MET[MET == "trans-Glutaconic acid ; Itaconic acid"] <- "Itaconic acid"
MET[MET == "Isonicotinamide ; Nicotinamide"] <- "Nicotinamide"
MET[MET == "Isobutyric acid ; Butyric acid"] <- "Isobutyric acid"
MET[MET == "GDP-mannose ; GDP-galactose"] <- "GDP-mannose"
MET[MET == "ADP-glucose ; GDP-fucose"] <- "ADP-glucose"
MET[MET == "1-Methylhistidine ; 3-Methylhistidine"] <- "3-Methylhistidine"

L <- setlabel(MET, M)

# Example 2
data(fasting_mseapca)

MET <- fasting_mseapca$DET
M <- fasting_mseapca$pathway

L <- setlabel(MET, M)

Run the code above in your browser using DataLab