Description Usage Arguments Value Author(s) See Also Examples
This function takes in a single gene set (geneSet), a vector of gene identifiers for all tested genes (universe), a vector of "hits" (hits), and a p-value adjustment method. It outputs a vector containing the size of the gene universe, the size of the gene set within this universe (i.e. how many genes from the universe map to this gene set), the total number of hits, the number of hits expected to occur in the gene set, the actual hits observed in the gene set, and the p-value from a hypergeometric test.
1 | hyperGeoTest(geneSet, universe, hits)
|
geneSet |
a character vector specifying a gene set |
universe |
a character vector of all gene identifiers (usually all genes tested in a screen) |
hits |
a character vector of gene identifiers for those genes considered as hits |
a numeric vector containing the size of the gene universe (named by "Universe Size"), the size of the gene set within this universe (i.e. how many genes from the universe map to this gene set (named by "Gene Set Size"), the total number of hits (named by "Total Hits"), the number of hits expected to occur in the gene set (named by "Expected Hits"), the actual hits observed in the gene set (named by "Observed Hits"), and the pvalue from a hypergeometric test (named by "Pvalue").
John C. Rose, Xin Wang
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ##example 1
gl <- runif(100, min=0, max=5)
gl <- order(gl)
names(gl) <- as.character(sample(x=seq(from=1, to=100, by=1), size=100,
replace=FALSE))
gs1 <- sample(names(gl), size=20, replace=FALSE)
gs2 <- sample(names(gl), size=20, replace=FALSE)
gsc <- list(subset1=gs1, subset2=gs2)
hypgeo <- hyperGeoTest(geneSet=gsc[["subset1"]], universe=names(gl),
hits=names(gl)[which(abs(gl) > 2)])
##example 2
library(org.Dm.eg.db)
library(KEGG.db)
##load phenotype vector (see the vignette for details about the
##preprocessing of this data set)
data("KcViab_Data4Enrich")
##Prepare kegg gene sets
DM_KEGG<-KeggGeneSets(species="Dm")
##Do the tests
hypgeoResults <- hyperGeoTest(geneSet=DM_KEGG[[1]], universe=
names(KcViab_Data4Enrich), hits=names(KcViab_Data4Enrich)[which(abs(
KcViab_Data4Enrich) > 2)])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.