BuildEdges {G1DBN} | R Documentation |
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.
out <- 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.
L`ebre Sophie (http://www3.imperial.ac.uk/theoreticalgenomics/people/slebre/),
Chiquet Julien (http://stat.genopole.cnrs.fr/~jchiquet).
DBNScoreStep1, DBNScoreStep2, BuildNetwork.
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 DBN ## STEP 1 - The first step score matrix S1 <- DBNScoreStep1(Xn, method='ls') ## building the edges of the Step1 inferred Graph 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 Step2 inferred Graph 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