# NOT RUN {
#### Toy example: only one graph
if(require(mvtnorm)){
# Generate two random samples of size 50 from two multivariate normal distributions
n<-50
# true parameters of class 1 and class 2
param.class1<-simulation$condition1
param.class2<-simulation$condition2$`10`$`2`
# simulated dataset
data.class1<-rmvnorm(n = n,mean =param.class1$mu ,sigma =param.class1$S)
data.class2<-rmvnorm(n = n,mean =param.class2$mu ,sigma=param.class2$S)
# Input arguments for the sourceSet function
data<-rbind(data.class1,data.class2)
classes<-c(rep(1,nrow(data.class1)),rep(2,nrow(data.class2)))
graphs<-list("toy.graph"=simulation$graph)
result<-sourceSet(graphs ,data ,classes ,seed = 123 ,permute =FALSE ,shrink =FALSE, alpha=0.05 )
# source set: primary disregulation (toy.graph)
result$toy.graph$primarySet
# secondary disregulation (toy.graph)
result$toy.graph$secondarySet
# all affected variables
unique(unlist(result$toy.graph$orderingSet))
# summary statistics
info<-infoSource(result)
info$variable
info$graph
# visual summaries
easyLookSource(result)
sourceSankeyDiagram(result)
}
# launch cytoscape and run:
# }
# NOT RUN {
sourceCytoscape(result,name.graphs = "toy.graph",collection.name = "Example")
sourceUnionCytoscape(result ,collection.name = "Example")
# }
# NOT RUN {
### Real data:
# see vignette, section Getting deepening
vignette("SourceSet")
# }
Run the code above in your browser using DataCamp Workspace