data("PPI_Athalina")
data("modules_PPI_Athalina")
## Example 1 #######%
##% Modular layout plot of A. Thalina PPI network, modules
##are colored randomly, module information is given as a list
##object ###%
id <- plot.modules(g1,mod.list = lm,
layout.function=layout.graphopt, color.random = TRUE ,
tkplot=FALSE,node.lab=FALSE,v.size=1)
## Example 2 #######%
##% Modular layout plot of A. Thalina PPI network, modules
##are colored randomly, module information is predicted using
##'fastgreedy' algorithm ###%
id <- plot.modules(g1, layout.function=layout.graphopt,
color.random = TRUE , tkplot=FALSE,node.lab=FALSE,v.size=1)
## Example 3 #######%
##% Modular layout plot of A. Thalina PPI network when
##expression value of genes are given ###%
id <- plot.modules(g1, layout.function=layout.graphopt,
color.random = TRUE, expression=rnorm(vcount(g1)),
tkplot=FALSE,node.lab=FALSE,v.size=1)
## Example 4 #######%
##% Modular layout plot of A. Thalina PPI network when
##expression value of modules 1, 2 and 3 are shown by colors by
##ranking independently from each other ###%
id <- plot.modules(g1, layout.function=layout.graphopt,
modules.color="grey", expression=rnorm(vcount(g1)),
tkplot=FALSE,node.lab=FALSE,v.size=1, exp.by.module=c(1,2,3))
## Example 5 #######%
##% Modular layout plot of A. Thalina PPI network by
##emphasizing module labels ###%
id <- plot.modules(g1, mod.list=lm,
layout.function=layout.graphopt, modules.color="grey",
tkplot=FALSE, mod.lab=TRUE,v.size=1, lab.color="green" )
## Example 6 #######%
##% Modular layout plot of A. Thalina PPI network
##highlighting shortest paths between modules 1, 5 and 7, 18 ###%
id <- plot.modules(g1, mod.list=lm,
layout.function=layout.graphopt, modules.color="grey",
tkplot=FALSE, nodeset=c(1,5,7,18), sf=-10, v.size=1)
## Example 7 #######%
##% Modular layout plot of A. Thalina PPI network combining
##two layouts ###%
fn <- function(g)layout.star(g,
center=which.max(degree(g))-1)
id <- plot.modules(g1,mod.list = lm,
layout.function=layout.graphopt, layout.overall=fn, color.random
= TRUE , tkplot=FALSE,node.lab=FALSE,v.size=1)
## Example 8 #######%
##% Modular layout plot of A. Thalina PPI network by scaling
##up second module and scaling down the expansion of other modules ###%
fn <- function(g)layout.star(g,
center=which.max(degree(g))-1)
sm <- rep(1, length(lm))
sm[2] <- 40
id <- plot.modules(g1,mod.list = lm, layout.function=layout.graphopt,
layout.overall=fn, color.random=TRUE,tkplot=FALSE,v.size=2, scale.module=sm,
mod.edge.col="green")
Run the code above in your browser using DataLab