plotGseaEnrTable: Plot GSEA Enrichment Table

View source: R/plot.gsea.R

plotGseaEnrTableR Documentation

Plot GSEA Enrichment Table

Description

This function plots the GSEA enrichment table.

Usage

plotGseaEnrTable(GseaTable, x, go, genesets, species=c('human','mouse'),
 alpha=1, simplify.func=shorten.MSigDB.terms, simplify.func.par=list(),
 type=c('RES','NES'), col.up='#F8766D', col.down='#00BFC4', mar=NULL, oma=NULL, ...)

Arguments

GseaTable

a data.frame, must be (usually a subset of) the GSEA output from msigdb.gsea or GOtest.

x

a data.frame of query gene signatures used for generating GseaTable.

go

a data.frame of gene annotations. See Details.

genesets

a vector of gene annotation set names. See Details.

species

Specifying the species for the input gene signatures. Only used when GseaTable is computed from msigdb.gsea.

alpha

power to scale the weights: 0 (unweighted = Kolmogorov-Smirnov), 1 (weighted), and 2 or larger (over-weighted)

simplify.func

function to convert MSigDB terms to a simplified form. Default shorten.MSigDB.terms.

simplify.func.par

a named list to pass parameters to simplify.func.

type

content type to be plotted, either RES (running enrichment score) or NES (normalized enrichment score).

col.up

color for positive score.

col.down

color for negative score.

mar

a numerical vector of the form c(bottom, left, top, right) which gives the number of lines of margin to be specified on the four sides of the plot.

oma

a vector of the form c(bottom, left, top, right) giving the size of the outer margins in lines of text..

...

additional arguments used for plot.

Details

Depending on the original function for calculating GseaTable, either go or genesets must be specified as in function GOtest or msigdb.gsea. When both are provided, only go will be used.

See example usage below.

See Also

msigdb.gsea, GOtest, shorten.MSigDB.terms

Examples

## Not run: 

#load approved symbols for protein-coding genes by HGNC;
#these will be the gene universe for the present toy example analysis
universe=curated.genesets(c('HGNC_universe'))$Gene
n=length(universe)
#
#Create a toy example for weighted enrichment using GSEA and logistic regression
toy=data.frame(Gene=universe,Phenotype='XYZ',Z=rnorm(n,0,1),stringsAsFactors=FALSE)

#GSEA against MSigDB gene ontology biological process (C5.BP). This may take a long time to run.
fit2=msigdb.gsea(x=toy, genesets=c('C5.BP'), query.population=universe,
	background='query', method='GSEA', permutations=100)
head(fit2)
#Plot the GSEA running enrichment score for the top 10 GSEA terms
plotGseaEnrTable(GseaTable=fit2[1:10,], x=toy, genesets=c('C5.BP'))

## End(Not run)

mw201608/GOtest documentation built on May 3, 2023, 11:49 a.m.