| goCluster FDR analysis {goCluster} | R Documentation |
These three functions are used to perform FDR analysis within
goCluster. They could be combined to a single function in a
future version of goCluster.
randomizeTree(X, elements) mergeAnno(X, i) selectAnnoStats(X, threshold)
X |
A lists of lists. |
elements |
The total number of selectable elements. |
i |
Index of the annotation to select. |
threshold |
Holds p-value thresholds for each annotation. |
randomizeTree will accept a tree as its input
and fills each terminal node of the tree with integers that are
uniformly distributed between 1 and elements. The number of
integers is determined by the size of the respective terminal
node. The minial integer possible is one, the maximal integer is given
by the option elements.
mergeAnno also expects a tree as input and will return the
element i among the list one level above the terminal nodes of
a leaf.
selectAnnoStats will select all elements from the tree X
that have a p-value below the threshold given in the threshold
option. The length of the threshold element has to match the
number of annotations analyzed and represented by the tree X.
Gunnar Wrobel, work@gunnarwrobel.de, http://www.gunnarwrobel.de.
set.seed(1000)
## Loading the reduced dataset with 100 genes
data(benomylsetupsmall)
a <- new("goCluster")
execute(a) <- benomylsetupsmall
## This demonstrates the use of "selectAnnoStats"
a@sign@statset[[1]][[1]]
selectAnnoStats(a@sign@statset, 0.1)[[1]][[1]]
## Randomizing the clustering result
randomGroups <- list()
for (i in 1:4) randomGroups[[i]] <- randomizeTree(a@algo@clusterset, 100)
## Four randomized datasets
randomGroups
## The clusters in the original dataset are being replaced
## by the randomized dataset. copyA now holds the randomized
## data together with the original annotation data which is
## necessary in order to perform the statistical analysis
copyA <- a
copyA@algo@clusterset <- randomGroups
## This executes the statistical function (a@sign@stat) on
## the randomized dataset (copyA) and assigns the
## result to the randomstat slot that is a specific
## slot for the FDR significance analysis
a@sign@stat <- reset(a@sign@stat)
a@sign@randomstat <- execute(a@sign@stat, copyA)@statset
randomStats <- list()
## This will merge the results for each of the three annotations
## and yields a distribution of p-values based on random gene
## selection
for (i in 1:3) randomStats[[i]] <- unlist(mergeAnno(a@sign@randomstat, i))
## This can be used to get information on the density
hist(randomStats[[1]],plot=FALSE,breaks=20)$density