View source: R/shiny.getMSEA_Metabolon.R
shiny.getMSEA_Metabolon | R Documentation |
A function that returns the pathway enrichment score for all perturbed metabolites in a patient's full metabolomic profile. # Main MSEA Analysis Function that implements the entire methodology This is a methodology for the analysis of global molecular profiles called Metabolite Set Enrichment Analysis (MSEA). It determines whether an a priori defined set of metabolites shows statistically significant, concordant differences between two biological states (e.g. phenotypes). MSEA operates on all metabolites from an experiment, rank ordered by the signal to noise ratio and determines whether members of an a priori defined metabolite set are nonrandomly distributed towards the top or bottom of the list and thus may correspond to an important biological process. To assess significance the program uses an empirical permutation procedure to test deviation from random that preserves correlations between metabolites. For details see Subramanian et al 2005.
shiny.getMSEA_Metabolon(input, cohorts)
ds: |
Input metabolite expression dataset |
cls: |
Input class vector (phenotype) |
met.db: |
Metabolite set database in GMT format |
nperm: |
Number of random permutations (default: 1000) |
weighted.score.type: |
Enrichment correlation-based weighting: 0=no weight (KS), 1=standard weight, 2 = over-weight (default: 1) |
adjust.FDR.q.val: |
Adjust the FDR q-vals (default: F) |
met.size.threshold.min: |
Minimum size (in metabolites) for database metabolite sets to be considered (default: 25) |
met.size.threshold.max: |
Maximum size (in metabolites) for database metabolite sets to be considered (default: 500) |
random.seed: |
Random number seed. (default: 123456) |
report: Global output report, sorted by NES in decreasing order.
# If the .GMT file isn't already created, create it. data(Miller2015) population = rownames(Miller2015) paths.hsa = list.dirs(path=system.file("extdata", package="CTDext"), full.names = FALSE) paths.hsa = paths.hsa[-which(paths.hsa %in% c("", "RData", "allPathways", "MSEA_Datasets"))] sink(sprintf("%s/Metabolon.gmt", system.file("extdata/MSEA_Datasets", package="CTDext"))) for (p in 1:length(paths.hsa)) { load(system.file(sprintf("/extdata/RData/%s.RData", paths.hsa[p]), package="CTDext")) pathway.compounds = V(ig)$label[which(V(ig)$shape=="circle")] pathCompIDs = unique(tolower(pathway.compounds[which(pathway.compounds %in% population)])) print(sprintf("%s %s", paths.hsa[p], paste(pathCompIDs, collapse=" ")), quote=FALSE) } sink() res = shiny.getMSEA_Metabolon(input, cohorts) # The format (columns) for the global result files is as follows. # Pathway : Pathway name. # SIZE : Size of the set in metabolites. # NES : Normalized (multiplicative rescaling) normalized enrichment score. # NOM p-val : Nominal p-value (from the null distribution of the metabolite set). # FDR q-val: False discovery rate q-values # FWER p-val: Family wise error rate p-values. # glob.p.val: P-value using a global statistic (number of sets above the set's NES).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.