Last data update: 2014.03.03

R: A Function to Evaluate Gene-Set Enrichment Using PAEA Over...
multigmtPAEAAnalysisR Documentation

A Function to Evaluate Gene-Set Enrichment Using PAEA Over Multiple GMT Files.

Description

This is a wrapper function for PAEAAnalysis which evaluates the enrichmnet of gene sets in expression data using the PAEA method. A characteristic direction (the result of the function chdirAnalysis and a Gene Matrix Transposed (GMT) file, which is a set of subsets of genes whose enrichmnet is evaluated, and returns a prioritized list of the gene sets.

Ths function takes multiple GMT files as input and output the results to Tab Separated Value files.

Usage

multigmtPAEAAnalysis(chdirresults, gmtfiles=AllGMTfiles, gammas = c(1), 
casesensitive = FALSE, showprogress=TRUE)

Arguments

chdirresults

This input is the first part of the output from chdirAnalysis, which has the names $chdirprops. This contains the characteristic direction which forms the basis for the enrichmnet analysis.

gmtfiles

This is a list of names of GMT files(A data set composed of a list of lists of genes) over which the enrichment analysis is calculated. By default all included GMT files are used (not that it is neccessary to use data(AllGMTfiles) to load the names first.)

gammas

The list of shrinkage parameter values as used in the calculation of the characteristic direction.

casesensitive

A logical variable which determines whether the gene comparisons should be case sensitive.

showprogress

show a progress bar.

Value

p_values-GMTfile.txt

The results of the enerichmnet for each GMT file is saved to file in the current working directory.

Author(s)

Neil R. Clark and Avi Ma'ayan

References

Clark, Neil R., et al. "The characteristic direction: a geometrical approach to identify differentially expressed genes." BMC bioinformatics 15.1 (2014): 79.

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.


##################################
#
# An example multigmtPAEA analysis
#
##################################
# Load the expression data

data(example_expression_data)
data(example_sampleclass)
data(example_gammas)

#load GMT file names
data(AllGMTfiles)

# Run the characteristic direction analysis
chdir_analysis_example <- chdirAnalysis(example_expression_data,example_sampleclass,
example_gammas,CalculateSig=FALSE)

# Run the PAEA analysis over the first two GMT files in the library

multiPAEAtest <- multigmtPAEAAnalysis(chdir_analysis_example$chdirprops, 
AllGMTfiles[2:3], example_gammas)

# To run on all the gmt files

#multiPAEAtestAll <- multigmtPAEAAnalysis(chdir_analysis_example$chdirprops, gammas=example_gammas)

## The function is currently defined as
function (chdirresults, gmtfile, gammas = c(1), casesensitive = FALSE) 
{
    gmtlinenames <- lapply(gmtfile, function(x) x[[1]])
    gmtlines <- lapply(gmtfile, function(x) x[-1])
    PAEAresults <- lapply(gmtlines, function(x) PAEA(chdirresults[[1]], 
        x, casesensitive = casesensitive))
    gammalabels <- unlist(lapply(gammas, function(x) paste("gamma=", 
        x)))
    pvalues <- lapply(PAEAresults, function(x) x[[2]])
    pvalues <- matrix(unlist(pvalues), ncol = length(gmtlines), 
        dimnames = list(gammalabels, gmtlinenames))
    pavalues <- lapply(PAEAresults, function(x) x[[1]])
    pavalues <- matrix(unlist(pvalues), ncol = length(gmtlines), 
        dimnames = list(gammalabels, gmtlinenames))
    gmtp <- sort.list(pvalues[1, ])
    list(t(pvalues[, gmtp]), t(pavalues[, gmtp]))
  }

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(GeoDE)
Loading required package: Matrix
Loading required package: MASS
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GeoDE/multigmtPAEAAnalysis.Rd_%03d_medium.png", width=480, height=480)
> ### Name: multigmtPAEAAnalysis
> ### Title: A Function to Evaluate Gene-Set Enrichment Using PAEA Over
> ###   Multiple GMT Files.
> ### Aliases: multigmtPAEAAnalysis
> ### Keywords: enrichment multivariate
> 
> ### ** Examples
> 
> ##---- Should be DIRECTLY executable !! ----
> ##-- ==>  Define data, use random,
> ##--	or do  help(data=index)  for the standard data sets.
> 
> 
> ##################################
> #
> # An example multigmtPAEA analysis
> #
> ##################################
> # Load the expression data
> 
> data(example_expression_data)
> data(example_sampleclass)
> data(example_gammas)
> 
> #load GMT file names
> data(AllGMTfiles)
> 
> # Run the characteristic direction analysis
> chdir_analysis_example <- chdirAnalysis(example_expression_data,example_sampleclass,
+ example_gammas,CalculateSig=FALSE)
> 
> # Run the PAEA analysis over the first two GMT files in the library
> 
> multiPAEAtest <- multigmtPAEAAnalysis(chdir_analysis_example$chdirprops, 
+ AllGMTfiles[2:3], example_gammas)
   |                                                                               |                                                                      |   0%[1] 0
[1] 1
   |                                                                               |===================================                                   |  50%
> 
> # To run on all the gmt files
> 
> #multiPAEAtestAll <- multigmtPAEAAnalysis(chdir_analysis_example$chdirprops, gammas=example_gammas)
> 
> ## The function is currently defined as
> function (chdirresults, gmtfile, gammas = c(1), casesensitive = FALSE) 
+ {
+     gmtlinenames <- lapply(gmtfile, function(x) x[[1]])
+     gmtlines <- lapply(gmtfile, function(x) x[-1])
+     PAEAresults <- lapply(gmtlines, function(x) PAEA(chdirresults[[1]], 
+         x, casesensitive = casesensitive))
+     gammalabels <- unlist(lapply(gammas, function(x) paste("gamma=", 
+         x)))
+     pvalues <- lapply(PAEAresults, function(x) x[[2]])
+     pvalues <- matrix(unlist(pvalues), ncol = length(gmtlines), 
+         dimnames = list(gammalabels, gmtlinenames))
+     pavalues <- lapply(PAEAresults, function(x) x[[1]])
+     pavalues <- matrix(unlist(pvalues), ncol = length(gmtlines), 
+         dimnames = list(gammalabels, gmtlinenames))
+     gmtp <- sort.list(pvalues[1, ])
+     list(t(pvalues[, gmtp]), t(pavalues[, gmtp]))
+   }
function (chdirresults, gmtfile, gammas = c(1), casesensitive = FALSE) 
{
    gmtlinenames <- lapply(gmtfile, function(x) x[[1]])
    gmtlines <- lapply(gmtfile, function(x) x[-1])
    PAEAresults <- lapply(gmtlines, function(x) PAEA(chdirresults[[1]], 
        x, casesensitive = casesensitive))
    gammalabels <- unlist(lapply(gammas, function(x) paste("gamma=", 
        x)))
    pvalues <- lapply(PAEAresults, function(x) x[[2]])
    pvalues <- matrix(unlist(pvalues), ncol = length(gmtlines), 
        dimnames = list(gammalabels, gmtlinenames))
    pavalues <- lapply(PAEAresults, function(x) x[[1]])
    pavalues <- matrix(unlist(pvalues), ncol = length(gmtlines), 
        dimnames = list(gammalabels, gmtlinenames))
    gmtp <- sort.list(pvalues[1, ])
    list(t(pvalues[, gmtp]), t(pavalues[, gmtp]))
}
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>