The EGSEAResults class

Share:

Description

The EGSEAResults class stores the results of an EGSEA analysis.

The opertator $ extracts a slot from an object of class EGSEAResults.

topSets extracts a table of the top-ranked gene sets from an EGSEA analysis.

show displays the parameters of an EGSEAResults object

summary displays a brief summary of the analysis results stored in an EGSEAResults object

limmaTopTable returns a dataframe of the top table of the limma analysis for a given contrast.

getlimmaResults returns the linear model fit produced by limma::eBayes.

plotHeatmap generates a heatmap of fold changes for a selected gene set.

plotSummaryHeatmap generates a summary heatmap for the top n gene sets of the comparative analysis across multiple contrasts.

plotPathway generates a visual map for a selected KEGG pathway with the gene fold changes overalid on it.

plotMethods generates a multi-dimensional scaling (MDS) plot for the gene set rankings of different base GSE methods

plotSummary generates a Summary plot for EGSEA analysis.

plotGOGraph generates a graph of the top significant GO terms in a GO term collection, which could be c5 from MSigDB or Gene Ontolog from the GeneSetDB.

showSetByname shows the details of a given gene set indicated by name.

showSetByID shows the details of a given gene set indicated by ID.

getSetScores returns a dataframe of the gene set enrichment scores per sample. This can be only calculated using specific base methods, namely, "ssgsea".

Usage

 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
## S4 method for signature 'EGSEAResults'
x$name

topSets(object, gs.label = 1, contrast = 1, sort.by = NULL, number = 10,
  names.only = TRUE, verbose = TRUE)

## S4 method for signature 'EGSEAResults'
show(object)

## S4 method for signature 'EGSEAResults'
summary(object)

limmaTopTable(object, contrast = 1)

getlimmaResults(object)

plotHeatmap(object, gene.set, gs.label = 1, contrast = 1,
  file.name = "heatmap", format = "pdf", fc.colors = c("#67A9CF",
  "#F7F7F7", "#EF8A62"), verbose = TRUE)

plotSummaryHeatmap(object, gs.label = 1, number = 20, sort.by = NULL,
  show.vals = NULL, file.name = "sum_heatmap", format = "pdf",
  verbose = TRUE)

plotPathway(object, gene.set, gs.label = 1, contrast = 1,
  file.name = "pathway", verbose = TRUE)

plotMethods(object, gs.label = 1, contrast = 1, file.name = "methods.mds",
  format = "pdf", verbose = TRUE)

plotSummary(object, gs.label = 1, contrast = 1, file.name = "summary",
  format = "pdf", x.axis = "p.adj", x.cutoff = NULL, sort.by = NULL,
  use.names = FALSE, verbose = TRUE)

plotGOGraph(object, gs.label = "c5", contrast = 1, sort.by = NULL,
  noSig = 5, file.name = "c5-top-", format = "pdf", verbose = TRUE)

showSetByName(object, gs.label = 1, set.name)

showSetByID(object, gs.label = 1, id)

getSetScores(object, gs.label = 1)

Arguments

x

EGSEAResults object, the analysis result object from egsea, egsea.cnt or egsea.ora.

name

character, the slot name

object

EGSEAResults object, the analysis result object from egsea, egsea.cnt or egsea.ora.

gs.label

the number or label of the gene set collection of interest.

contrast

contrast column number or column name specifying which contrast is of interest. if contrast = 0 or "comparison" and the number of contrasts greater than 1, the comparative gene sets are retruned.

sort.by

character, determines how to order the analysis results in the stats table. The accepted values depend on the function used to generate the EGSEA results.

number

integer, maximum number of gene sets to list

names.only

logical, whether to display the EGSEA statistics or not.

verbose

logical, whether to print out progress messages and warnings.

gene.set

character, the name of the gene set. See the output of topSets.

file.name

character, the prefix of the output file name.

format

character, takes "pdf" or "png".

fc.colors

vector, determines the fold change colors of the heatmap. Three colors of the negative, zero and positive log fold changes, respectively, should be assigned. Default is c( "#67A9CF", "#F7F7F7", "#EF8A62"). These colors were generated using rev(RColorBrewer::brewer.pal(3, "RdBu"))

show.vals

character, determines which EGSEA score values are shown on the map. Default is NULL which does not show anything.

x.axis

character, the x-axis of the summary plot. All the values accepted by the sort.by parameter can be used. Default x.axis="p.value".

x.cutoff

numeric, cut-off threshold to filter the gene sets of the summary plots based on the values of the x.axis. Default x.cutoff=NULL.

use.names

logical, determines whether to display the GeneSet IDs or GeneSet Names. Default is FALSE.

noSig

numeric, number of significant GO terms to be displayed. A number larger than 5 might not work due to the size of the generated graph.

set.name

character, a vector of gene set names as they appear in topSets.

id

character, a vector of gene set IDs as they appears in the plotSummary.

Details

The EGSEAResults class is used by egsea, egsea.cnt and egsea.ora to store the results of an EGSEA analysis. This helps in mining the analysis results and generating customized tables and plots.

limmaTopTable output can be understood from limma::topTable.

getlimmaResults's output can be manipulated using limma::topTable and limma::topTreat.

plotHeatmap fold changes are colored based on the fc.colors and only genes that appear in the EGSEA analysis are visualized in the heatmap. Gene names are coloured based on the statistical significance level from limma DE analysis.

plotSummaryHeatmap creates a summary heatmap for the rankings of top number gene sets of the comparative analysis across all the contrasts. The show.vals score can be displayed on the heatmap for each gene set. This can help to identify gene sets that are highly ranked/sgnificant across multiple contrasts.

plotSummary generates a Summmary Plot for an EGSEA analysis. Since the EGSEA "Significance Score" is proportional to the p-value and the absolute fold changes, it could be useful to highlight gene sets that have high Significance scores. The blue labels on the summary plot indicate gene sets that do not apear in the top 10 list of gene sets based on the "sort.by" argument (black labels) yet they appear in the top 5 list of gene sets based on the EGSEA "Significance Score". If two contrasts are provided, the rank is calculated based on the "comparison" analysis results and the "Significance Score" is calculated as the mean. If sort.by = NULL, the slot sort.by of the object is used to order gene sets.

Value

$ returns the selected slot.

topSets returns a dataframe of top gene sets with the calculated statistics for each if names.only = FALSE.

show does not return data.

summary does not return data.

limmaTopTable returns a dataframe.

getlimmaResults returns an MArrayLM object.

plotHeatmap does not return data but creates image and CSV files.

plotSummaryHeatmap does not return data but creates image and CSV files.

plotPathway does not return data but creates a file.

plotMethods does not reutrn data but creates an image file.

plotSummary does not return data but creates an image file.

plotGOGraph does not return data but creates an image file.

showSetByName does not return data

showSetByID does not return data.

getSetScores returnsa a dataframe where rows are gene sets and columns are samples.

Slots

results

list, EGSEA analysis results

limmaResults

MArrayLM, is a limma linear fit model

contrasts

character, the contrasts defined in the analysis

sampleSize

numeric, number of samples

gs.annots

list, the gene set collection annotation index

baseMethods

character, vector of base GSE methods

baseInfo

list, additional information on the base methods (e.g., version).

combineMethod

character, the p-value combining method

sort.by

character, the results ordering argument

symbolsMap

data.frame, the mapping between Entrez IDs and Gene Symbols

logFC

matrix, the logFC matrix of contrasts

report

logical, whether the report was generated

report.dir

character, the directory of the EGSEA HTML report

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
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Exampple of EGSEAResults
library(EGSEAdata)
data(il13.gsa)
gsa = il13.gsa
class(gsa)
print(gsa$baseMethods)

# Example of topSets
library(EGSEAdata)
data(il13.gsa)
gsa = il13.gsa
class(gsa)
topSets(gsa,  gs.label="kegg",contrast=1, number = 10)
topSets(gsa,  gs.label=1, contrast=1, sort.by="ora", number = 10, 
names.only=FALSE)
topSets(gsa,  gs.label="kegg",contrast=0, number = 10)

# Example of show
library(EGSEAdata)
data(il13.gsa)
gsa = il13.gsa
class(gsa)
show(gsa)

# Example of summary
library(EGSEAdata)
data(il13.gsa)
gsa = il13.gsa
class(gsa)
summary(gsa)

# Example of limmaTopTable
library(EGSEAdata)
data(il13.gsa)
gsa = il13.gsa
class(gsa)
colnames(limmaTopTable(gsa))
head(limmaTopTable(gsa))

# Example of getlimmaResults
library(EGSEAdata)
data(il13.gsa)
gsa = il13.gsa
class(gsa)
fit = getlimmaResults(gsa)
class(fit)
names(fit)

# Example of plotHeatmap
library(EGSEAdata)
data(il13.gsa)
gsa = il13.gsa
class(gsa)
plotHeatmap(gsa, "Asthma", gs.label="kegg")
plotHeatmap(gsa, "Asthma", gs.label="kegg", contrast = "comparison", 
file.name = "asthma.hm.cmp")

# Example of plotHeatmap
library(EGSEAdata)
data(il13.gsa)
gsa = il13.gsa
class(gsa)
plotSummaryHeatmap(gsa, gs.label="kegg")

# Example of plotPathway
library(EGSEAdata)
data(il13.gsa)
gsa = il13.gsa
class(gsa)
plotPathway(gsa, gs.label="kegg", "Asthma")
plotPathway(gsa, gs.label="kegg", "Asthma", contrast="comparison", 
file.name = "asthma.map.cmp")

# Example of plotMethods
library(EGSEAdata)
data(il13.gsa)
gsa = il13.gsa
class(gsa)
plotMethods(gsa)

# Example of plotSummary
library(EGSEAdata)
data(il13.gsa)
gsa = il13.gsa
class(gsa)
plotSummary(gsa)
plotSummary(gsa, contrast=c(1,2), file.name = "summary.cmp")

# Example of plotGOGraph
library(EGSEAdata)
data(il13.gsa)
gsa = il13.gsa
class(gsa)
plotGOGraph(gsa, sort.by="avg.rank")

# Example of showSetByName
library(EGSEAdata)
data(il13.gsa)
gsa = il13.gsa
class(gsa)
showSetByName(gsa, "kegg", "Asthma")

# Example of showSetByID
library(EGSEAdata)
data(il13.gsa)
gsa = il13.gsa
class(gsa)
showSetByID(gsa, "kegg", "hsa04060")

# Example of getSetScores
library(EGSEAdata)
data(il13.gsa)
gsa = il13.gsa
class(gsa)
head(getSetScores(gsa, "kegg"))