Description Usage Arguments Details Value Author(s) Examples
Does breadth-first layout of a network for BioFabric
1 | defaultNodeOrder(bfGraph, firstLabel = NULL)
|
inGraph |
The graph to order, in igraph format (see
|
firstLabel |
(optional) The label of the node to start at. |
Default node layout based on breadth-first search from
highest degree node, searching in order of decreasing
degree. Takes a network provided in igraph format (see
igraph
) and returns the same network, with
the nodes reordered to the default breadth-first layout
order
The provided graph with the nodes reordered per the BioFabric default layout algorithm.
Bill Longabaugh <wlongabaugh@systemsbiology.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
# Gotta have igraph!
library(igraph)
# defaultNodeOrder requires we name the graph, so we
# do that first. Typically, there is no reason to provide
# this function to bioFabric, since it uses it internally.
# However, we can gain extra functionality by providing the
# firstLabel argument, which starts the search at the specified
# node instead od the highest degree node. So wrapping the
# defaultNodeOrder as shown allows us to start at the top of
# the given tree (degree = 2), which is lower degree than
# its child nodes.
bfGraph = graph.tree(20, children=2, mode="out")
bfGraph <- autoNameForFabric(bfGraph)
startAtBF1 <- function(bfGraph) {
return (defaultNodeOrder(bfGraph, firstLabel=V(bfGraph)[1]$name))
}
bioFabric(bfGraph, orderFunc=startAtBF1)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.