GSEA | R Documentation |
This function performs gene set enrichment analysis.
GSEA(x, go, alpha=1, permutations=1000, ncores=1, iseed=12345)
fGSEA(x, go, alpha=1, permutations=1000, ncores=1, iseed=12345)
x |
data.frame, with at least two columns. See |
go |
vector, a set of genes. |
alpha |
power to scale the weights. See |
permutations |
number of permutations to estimate P value of the enrichment score. |
ncores |
number of CPU cores to be used. |
iseed |
integer, used as a seed for random number generation. |
x
is a data.frame with at least two columns: the first column is a vector of gene ids and the second column is a vector of phenotype association statistics, eg, log fold change, or t-test statistics, whose sign and absolute values denote the direction and strength of the association.
alpha
is power to scale the weights: 0 (unweighted = Kolmogorov-Smirnov), 1 (weighted), and 2 or larger (over-weighted).
GSEA
produces a gsea
object, which is a list with the elements:
ES |
enrichment score |
indicator |
a vector of integers indicating the location of the genes of interest |
RES |
a vector of running enrichment scores |
NES |
normalized enrichment score accounted for the gene set size |
Pvalue |
p value of the enrichment score estimated by permutations |
plot.gsea
, print.gsea
, msigdb.gsea
#example usage
#create a random data set
set.seed(1234)
n=10000
x=data.frame(ID=paste0('Gene',1:n),strength=sort(rnorm(n,0,1)),stringsAsFactors=FALSE)
fit1=GSEA(x=x,go=paste0('Gene',sample(n,100)))
plot(fit1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.