Compare qscore distribution of a subset of nodes to all other nodes.
Source:R/CONDOR.R
condorCoreEnrich.Rd
Compute one-sided KS and wilcox tests to determine if a subset of nodes has a stochastically larger qscore distribution.
Arguments
- test_nodes
is a list containing the subset of nodes (of one node class --blue or red--only) to be tested
- q
is a two column data frame containing the node names in the first column and the q-scores in the second column.
- perm
if TRUE, run permutation tests. Else, run
ks.test
andwilcox.test
only.- plot.hist
if TRUE, produces two histograms of test statistics from permutation tests, one for KS and one for wilcoxon and a red dot for true labeling. Only works if perm=TRUE.
- nsamp
Number of permutation tests to run
Value
if perm=FALSE
, the analytical p-values from
ks.test
and wilcox.test
if perm=TRUE
, the permutation p-values are provided in
addition to the analytical values.
Note
ks.test
and wilcox.test
will throw warnings due to the presence of ties, so the p-values will be
approximate. See those functions for further details.
Examples
r = c(1,1,1,2,2,2,3,3,3,4,4);
b = c(1,2,3,1,2,4,2,3,4,3,4);
reds <- c("Alice","Sue","Janine","Mary")
blues <- c("Bob","John","Ed","Hank")
elist <- data.frame(red=reds[r],blue=blues[b])
condor.object <- createCondorObject(elist)
condor.object <- condorCluster(condor.object)
condor.object <- condorQscore(condor.object)
q_in <- condor.object$qscores$red.qscore
out <- condorCoreEnrich(c("Alice","Mary"),q=q_in,perm=TRUE,plot.hist=TRUE)