Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/testOneConnectedComponent.R
Applies a series of two-sample tests to a connected graph using various statistics.
1 | testOneConnectedComponent(graph, data, classes, ..., prop=0.2, verbose=FALSE)
|
graph |
A |
data |
A ' |
classes |
A |
... |
Further arguments to be passed to |
prop |
A |
verbose |
If |
This function performs the test, assuming that all genes in the graph are represented in the expression data set, in order not to have to modify the graph topology.
Interaction signs are used if available in the graph ('getSignedGraph' is not called here, in order not to have to modify the graph topology.).
The graph given as input has to have only one
connex component. It can be retrieved from the output of
getConnectedComponentList
().
A structured list
containing the p-values of the tests, the
graph
object of the connected component and the number
of retained Fourier dimensions.
Laurent Jacob, Pierre Neuvial and Sandrine Dudoit
testOneGraph
()
getConnectedComponentList
()
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 | library("rrcov")
## Some parameters
n1 <- n2 <- 20
nnodes <- nedges <- 20
k <- 3
ncp <- 0.5
sigma <- diag(nnodes)/sqrt(nnodes)
## Build graph, decompose laplacian
G <- randomWAMGraph(nnodes=nnodes,nedges=nedges)
A <- G@adjMat
lfA <- laplacianFromA(A,ltype="unnormalized")
U <- lfA$U
l <- lfA$l
## Build two samples with smooth mean shift
X <- twoSampleFromGraph(n1,n2,shiftM2=ncp,sigma,U=U,k=k)
## Do hypothesis testing
t <- T2.test(X$X1,X$X2) # Raw T-square
print(t$p.value)
tu <- graph.T2.test(X$X1,X$X2,lfA=lfA,k=k) # Filtered T-squares
print(tu$p.value)
|
Loading required package: R.utils
Loading required package: R.oo
Loading required package: R.methodsS3
R.methodsS3 v1.7.1 (2016-02-15) successfully loaded. See ?R.methodsS3 for help.
R.oo v1.22.0 (2018-04-21) successfully loaded. See ?R.oo for help.
Attaching package: 'R.oo'
The following objects are masked from 'package:methods':
getClasses, getMethods
The following objects are masked from 'package:base':
attach, detach, gc, load, save
R.utils v2.8.0 successfully loaded. See ?R.utils for help.
Attaching package: 'R.utils'
The following object is masked from 'package:utils':
timestamp
The following objects are masked from 'package:base':
cat, commandArgs, getOption, inherits, isOpen, parse, warnings
Loading required package: robustbase
Scalable Robust Estimators with High Breakdown Point (version 1.4-7)
Attaching package: 'rrcov'
The following object is masked from 'package:R.utils':
getRaw
Warning message:
In sqrt(shiftM2) * diff[1:k]/sqrt(rawShiftNorm) :
Recycling array of length 1 in vector-array arithmetic is deprecated.
Use c() or as.vector() instead.
[1] 0.1850897
[1] 0.0001517197
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.