Description Usage Arguments Value Author(s) See Also Examples
Performs an hypergeometric test of enrichment of a set of hypotheses in significant elements.
1 | hyper.test(p.values, testSet, thr=0.001, universe=length(p.values), verbose=FALSE)
|
p.values |
A named |
testSet |
A |
thr |
A |
universe |
An |
verbose |
If |
A list
with class "htest" containing the following components:
A numeric
value, the test statistic.
A numeric
value, the corresponding p-value.
Laurent Jacob, Pierre Neuvial and Sandrine Dudoit
AN.test
()
BS.test
()
graph.T2.test
()
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 | library("KEGGgraph")
## library("NCIgraph")
library("rrcov")
data("Loi2008_DEGraphVignette")
exprData <- exprLoi2008
classData <- classLoi2008
rn <- rownames(exprData)
## Retrieve expression levels data for genes from one KEGG pathway
gr <- grListKEGG[[1]]
gids <- translateKEGGID2GeneID(nodes(gr))
mm <- match(gids, rownames(exprData))
## Keep genes from the graph that are present in the expression data set
idxs <- which(!is.na(mm))
gr <- subGraph(nodes(gr)[idxs], gr)
idxs <- which(is.na(mm))
if(length(idxs)) {
print("Gene ID not found in expression data: ")
str(gids[idxs])
}
dat <- exprData[na.omit(mm), ]
str(dat)
X1 <- t(dat[, classData==0])
X2 <- t(dat[, classData==1])
## DEGraph T2 test
res <- testOneGraph(gr, exprData, classData, verbose=TRUE, prop=0.2)
## T2 test (Hotelling)
rT2 <- T2.test(X1, X2)
str(rT2)
## Adaptive Neyman test
rAN <- AN.test(X1, X2, na.rm=TRUE)
str(rAN)
## Adaptive Neyman test from Fan and Lin (1998)
rAN <- AN.test(X1, X2, na.rm=TRUE)
str(rAN)
## Test from Bai and Saranadasa (1996)
rBS <- BS.test(X1, X2, na.rm=TRUE)
str(rBS)
## Hypergeometric test
pValues <- apply(exprData, 1, FUN=function(x) {
tt <- t.test(x[classData==0], x[classData==1])
tt$p.value
})
str(pValues)
names(pValues) <- rownames(exprData)
rHyper <- hyper.test(pValues, gids, thr=0.01)
str(rHyper)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.