Description Usage Arguments Value Author(s) See Also Examples
Given a score matrix, this function builds the list of the edges of the associated network. The edges are ordered according to their scores. The score matrix has been computed from a network inference algorithm (e.g. DBNScoreStep1 or DBNScoreStep2, Shrinkage, Lasso, ...). An optional threshold can be specified, as well as a maximal number of edges.
1 2 | BuildEdges(score,threshold=1,nb=NULL,
targetNames=NULL,predNames=NULL,prec=3,dec=FALSE)
|
score |
matrix with r rows (=target genes) and d columns (=predictor genes) containing the scores resulting from an estimation procedure (e.g. DBNScoreStep1 or DBNScoreStep2, Shrinkage, Lasso, ...). |
threshold |
An optional real setting the maximal value for edge selection, default=1. |
nb |
An optional integer setting the maximal number of selected edges, default=NULL. |
targetNames |
An optional array (r) giving a list of names for the target genes, default=NULL. |
predNames |
An optional array (d) giving a list of names for the predictor genes, default=NULL. |
prec |
An optional integer setting the number of decimal places for score display, default=3. |
dec |
boolean, FALSE if the smallest score points out the most significant edge, default=FALSE. |
A matrix containing a list of edges ordered according to the score (First column: predictor, second column: target, third column: corresponding score). Predictors and targets are referred to through the names given by targetNames or predNames when specified.
Lebre Sophie (http://icube-bfo.unistra.fr/en/index.php/Sophie_Lebre),
Chiquet Julien (http://stat.genopole.cnrs.fr/~jchiquet).
DBNScoreStep1, DBNScoreStep2, BuildNetwork
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 | library(G1DBN)
## ======================================
## SIMULATING THE NETWORK
## number of genes
p <- 10
## the network - adjacency Matrix
MyNet <- SimulNetworkAdjMatrix(p,0.05,c(-1.5,-0.5,0.5,1.5))
MyNet
## ======================================
## SIMULATING THE TIME SERIES EXPERIMENTS
## number of time points
n <- 20
## initializing the B vector
B <- runif(p,-1,1)
## initializing the variance of the noise
sigmaEps <- runif(p,0.1,0.5)
## initializing the process Xt
X0 <- B + rnorm(p,0,sigmaEps*10)
## the times series process
Xn <- SimulGeneExpressionAR1(MyNet$A,B,X0,sigmaEps,n)
## ======================================
## NETWORK INFERENCE WITH G1DBN
## STEP 1 - The first step score matrix
S1 <- DBNScoreStep1(Xn, method='ls')
## Building the edges of the network inferred after Step1
alpha1 <- 0.5
G1 <- BuildEdges(S1$S1ls,threshold=alpha1,dec=FALSE)
G1
## STEP 2- The second step score matrix
S2 <- DBNScoreStep2(S1$S1ls, Xn, method='ls', alpha1)
## Building the edges of the network inferred after Step2
alpha2 <- 0.05
G2 <- BuildEdges(S2,threshold=alpha2,dec=FALSE)
G2
## Building the edges of the simulation Graph
Gsimul <- BuildEdges(MyNet$AdjMatrix,threshold=0,dec=TRUE)
Gsimul
|
Loading required package: MASS
Loading required package: igraph
Attaching package: 'igraph'
The following objects are masked from 'package:stats':
decompose, spectrum
The following object is masked from 'package:base':
union
$Vertices
$Vertices$Num
[1] 10
$Vertices$Labels
[1] 1 2 3 4 5 6 7 8 9 10
$Vertices$Regulated
[1] 2 3 4 6 9 10
$Edges
$Edges$Prop
[1] 0.05
$Edges$Num
[1] 5
$A
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 0 0.000000 0 0 0 0 0 0 0.0000000 0.000000
[2,] 0 -1.400051 0 0 0 0 0 0 0.0000000 0.000000
[3,] 0 0.000000 0 0 0 0 0 0 -0.9435001 0.000000
[4,] 0 0.000000 0 0 0 0 0 0 0.5518108 0.000000
[5,] 0 0.000000 0 0 0 0 0 0 0.0000000 0.000000
[6,] 0 0.000000 0 0 0 0 0 0 -1.1823362 0.000000
[7,] 0 0.000000 0 0 0 0 0 0 0.0000000 0.000000
[8,] 0 0.000000 0 0 0 0 0 0 0.0000000 0.000000
[9,] 0 0.000000 0 0 0 0 0 0 0.0000000 0.000000
[10,] 0 0.000000 0 0 0 0 0 0 0.0000000 -1.014454
$AdjMatrix
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 0 0 0 0 0 0 0 0 0 0
[2,] 0 1 0 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0 0 1 0
[4,] 0 0 0 0 0 0 0 0 1 0
[5,] 0 0 0 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0 0 1 0
[7,] 0 0 0 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0 0 0 0
[10,] 0 0 0 0 0 0 0 0 0 1
Treating 10 vertices:
10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Pred Target Score
[1,] 2 2 0.000
[2,] 10 10 0.000
[3,] 9 3 0.000
[4,] 9 6 0.001
[5,] 8 3 0.117
[6,] 8 4 0.187
[7,] 4 8 0.223
[8,] 9 4 0.226
[9,] 8 6 0.283
[10,] 2 3 0.299
[11,] 3 2 0.315
[12,] 7 1 0.331
[13,] 4 9 0.415
[14,] 3 7 0.425
[15,] 6 8 0.429
[16,] 10 2 0.440
[17,] 2 10 0.449
[18,] 9 7 0.463
Pred Target Score
[1,] 2 2 0.000
[2,] 10 10 0.000
[3,] 9 3 0.001
[4,] 9 6 0.001
Pred Target Score
[1,] 2 2 1
[2,] 9 3 1
[3,] 9 4 1
[4,] 9 6 1
[5,] 10 10 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.