multigmtPAEAAnalysis: A Function to Evaluate Gene-Set Enrichment Using PAEA Over...

Description Usage Arguments Value Author(s) References Examples

View source: R/ChDir-06.R

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

1
2
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
##---- 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]))
  }

GeoDE documentation built on May 1, 2019, 9:12 p.m.