# Example1 : Metabolome data
data(fasting)
data(pathway)
# pca and pca loading
pca <- prcomp(fasting$X, scale=TRUE)
pca <- pca_loading(pca)
# all detected metabolites
metabolites <- colnames(fasting$X)
# statistically significant negatively correlated metabolites in PC1 loading
SIG <- metabolites[pca$loading$R[,1] < 0 & pca$loading$p.value[,1] < 0.05]
DET <- metabolites
# Fix for multiple annotations
DET[DET == "UDP-glucose ; UDP-galactose"] <- "UDP-glucose"
DET[DET == "Isonicotinamide ; Nicotinamide"] <- "Nicotinamide"
DET[DET == "1-Methylhistidine ; 3-Methylhistidine"] <- "3-Methylhistidine"
# metabolite set list
M <- pathway$fasting
# MSEA by over representation analysis
B <- msea_ora(SIG, DET, M)
B$`Result of MSEA(ORA)`
## Example2 : Proteome data
data(covid19)
data(pathway)
X <- covid19$X$proteomics
Y <- covid19$Y
D <- covid19$D
tau <- covid19$tau
protein_name <- colnames(X)
# pls-rog and pls-rog loading
plsrog <- pls_rog(X,Y,D)
plsrog <- plsrog_loading(plsrog)
# statistically significant proteins
index_prot <- which(plsrog$loading$R[,1]>0 & plsrog$loading$p.value[,1]<0.05)
sig_prot <- protein_name[index_prot]
# protein set list
M <- pathway$covid19$proteomics
# MSEA by over representation analysis
B <- msea_ora(sig_prot, protein_name, M)
B$`Result of MSEA(ORA)`
## Example3: Metabolome data
data(fasting_mseapca)
SIG <- fasting_mseapca$SIG
DET <- fasting_mseapca$DET
M <- fasting_mseapca$pathway
# Perform ORA using detected metabolites only
B <- msea_ora(SIG, DET, M)
B$`Result of MSEA(ORA)`
Run the code above in your browser using DataLab