## Example 1 ####
g <- barabasi.game(2000, directed=FALSE)
id <- mst.plot.mod(g)
## Example 2 ####
### plotting a graph by combining two algorithms ##%
fn <- function(g){layout.reingold.tilford(g,
circular=TRUE, root=which.max(degree(g)))}
id <- mst.plot.mod(g, v.size=1, sf=-20, layout.function=fn,
layout.overall=layout.fruchterman.reingold, mst.e.size=2,
vertex.color="darkgreen")
data("PPI_Athalina")
id <- mst.plot.mod(g1, v.size=1, sf=0, layout.function=fn,
layout.overall=layout.fruchterman.reingold, mst.e.size=1,
vertex.color="magenta", colors=heat.colors(20))
## Example 3 ####
## When expression values of genes or nodes
## are given and to be plotted as a color of vertices ###
id <- mst.plot.mod(g1, expression=rnorm(vcount(g1)), v.size=1)
## Example 4 ####
## When expression values of genes or nodes are given
## and to be plotted as a color of vertices,
## also the degree of nodes to be shown as their vertex-size ###
id <- mst.plot.mod(g1, expression=rnorm(vcount(g1)),
v.size=degree(g1), v.sf=c(1,5))
## Example 5 ####
## When MST edges are highlighted in purple color and rest
## of the edges are plotted with a range of heat colors
## depending on the distance between nodes ###
id <- mst.plot.mod(g1, mst.edge.col="purple",
colors=heat.colors(20), vertex.color="yellow", v.size=1)
## Example 6 ####
## Plotting a graph with kamada-kawai layout algorithm ###
id <- mst.plot.mod(g1, mst.edge.col="purple",
colors=heat.colors(20), vertex.color="white", v.size=1,
layout.function=layout.kamada.kawai)
## Example 7 ####
## Plotting a graph with when weights of edges are given ###
id <- mst.plot.mod(g1, mst.edge.col="purple", edge.col.wt =
runif(ecount(g1), min=1, max=10), vertex.color="yellow", v.size=
1, layout.function=layout.kamada.kawai)
Run the code above in your browser using DataLab