# NOT RUN {
if(require(gRbase) & require(graph)){
## Directed graph
## sub-graph Acute Myel... Leukemia
graph<-gRbase::dag(~867:25+867:613+5295:867+5294:867+
+ 207:5295+207:5294+4193:207+3551:207+
+ 4792:3551+7157:4193+3265:6654+
+ 3845:6654+6654:2885+2885:25+2885:613)
genes<-graph::nodes(graph)
# covariance matrix of the reference condition
data<-t(chimera[genes,colnames(chimera)==1])
S<-cov(data)
S<-fitSgraph(graph,S)
# select path to dysregulate
path<-list(c("613","867"),c("867","5295"),c("5295","207"),
c("207","4193"),c("4193","7157"))
## ..or select the path in an interactive plot
# path<-getPathShiny(graph)
# select parameters of the dysregulation
min<-c(2,8,2,0.1,0.5)
max<-c(2,10,2,4,0.5)
prob<-c(1,0,0,0.5,1)
# activation, switch, switch, random, deactivation
dys<-cbind(min,max,prob)
rownames(dys)<-sapply(path,paste,collapse = "~")
dys
set.seed(123)
# main function
Result<-simPATHy(graph,path,S,min,max,prob)
class(Result)
names(Result)
# simulated data from two conditions
round(Result$dataset[c(1:3,501:503),1:5],3)
# Summary
easyLookDys(Result)
# ..or interactive summary
# easyLookShiny(resObj=Result,graph=graph)
# Visualization
plotCorGraph(S1=Result$S1,S2 = Result$S2,graph = graph,path = path,colLim = c(-0.3,0.3))
plotGraphNELD3(S1=Result$S1,S2 = Result$S2,graph = graph,colLim = c(-0.3,0.3))
## Undirected graph
graph <- gRbase::ug(~a:b, ~a:c, ~c:d, ~b:d, ~b:c)
# when reference condition covariance matrix is not supplied simPATHy generate a random one
Result_ug<-simPATHy(graph)
easyLookDys(Result_ug)
plotGraphNELD3(S1=Result_ug$S1,S2 = Result_ug$S2,graph = graph,colLim = c(-0.5,0.5))
}
# }
Run the code above in your browser using DataLab