DEGraph (version 1.24.0)

testOneConnectedComponent: Applies a series of two-sample tests to a connected graph using various statistics

Description

Applies a series of two-sample tests to a connected graph using various statistics.

Usage

testOneConnectedComponent(graph, data, classes, ..., prop=0.2, verbose=FALSE)

Arguments

graph
A graph object.
data
A 'numeric matrix (size: number 'p' of genes x number 'n' of samples) of gene expression.
classes
A character vector (length: 'n') of class assignments.
...
Further arguments to be passed to laplacianFromA().
prop
A numeric value, percentage of components retained for Fourier and PCA.
verbose
If TRUE, extra information is output.

Value

A structured list containing the p-values of the tests, the graph object of the connected component and the number of retained Fourier dimensions.

Details

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().

See Also

testOneGraph() getConnectedComponentList()

Examples

Run this code
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)

Run the code above in your browser using DataCamp Workspace