View source: R/runFastHeitzEdge.R
runFastHeinz.e | R Documentation |
Detect the optimized subnetwork in one network object based on combined node scores and edge scores in the netowrk by heuristic algorithm by maximized the weighted sum of node scores and edge scores in all possible subnetworks
runFastHeinz.e(network, node.scores, edge.scores, weightratio.edge.node = 1)
network |
An igraph or graphNEL object with nodes and edges with default node scores and node names, the edges with names and scores |
node.scores |
The vector of scores of the corresponding nodes in network the names of the node.scores are the names of the nodes in the network |
edge.scores |
The vector of scores of connecting edges of all the nodes in network the names of the edge.scores are the names of the edges in the network, which is the names of two connecting nodes in the network joined with _ |
weightratio.edge.node |
The weight ratio of edges scores versus node scores with default value 1, reflecting the weights of the nodes and edges in the network at object function |
The optimized subnetwork in igraph format with attributes node and edge with both name and scores for nodes and also edges
dat1<-matrix(rnorm(20000),ncol=200,nrow=100)
colnames(dat1)<-paste("Var", as.character(1:200),sep="")
# simulate the p values for all the possible edges in the network
ind.pos.pval.edge<-rbinom(200*199/2,1,0.5)
pval.edge<-(1-ind.pos.pval.edge)*runif(200*199/2)+ind.pos.pval.edge*rbeta(200*199/2,0.1,1)
names(pval.edge)<-unlist(sapply(1:199,function(i){sapply((i+1):200, function(j){paste(paste("Var",
as.character(i),sep=""),paste("Var",as.character(j),sep=""),sep="_")})}))
# simulate p values for all the nodes in the network
ind.pos.pval.node<-rbinom(200,1,0.2)
pval.node<-(1-ind.pos.pval.node)*runif(200)+ind.pos.pval.node*rbeta(200,0.1,1)
names(pval.node)<-paste("Var", as.character(1:200),sep="")
# generate the node score-NodeScore, edge scores-EdgeScore and igraph object-Network
network.test<-uniform.beta.node.edge.score(pval.node,pval.edge,0.05,0.05,dat1)
network.test1<-network.test$Network
node.scores<-network.test$NodeScore
edge.scores<-network.test$EdgeScore
# detect the optimized subnetwork in simulated network
subnetwork.opt<-runFastHeinz.e(network.test1, node.scores,edge.scores,weightratio.edge.node=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.