Learn R Programming

phangorn (version 1.99-12)

plot.networx: Phylogenetic networks

Description

as.networx convert splits objects into a networx object. plot.networx plot phylogenetic network or split graphs.

Usage

as.networx(x, ...)
## S3 method for class 'splits':
as.networx(x, planar = FALSE, ...)
## S3 method for class 'networx':
plot(x, type="3D", use.edge.length = TRUE, show.tip.label=TRUE, 
     show.edge.label=FALSE, edge.label = NULL, show.node.label=FALSE, 
     node.label = NULL, show.nodes=FALSE, tip.color="blue", 
     edge.color="grey", edge.width=3, edge.lty=1, font=3, 
     cex=1, ...)

Arguments

x
an object of class "splits" (as.networx) or "networx" (plot)
planar
logical whether to produce a planar graph from only cyclic splits (may excludes splits).
type
"3D" to plot using rgl or "2D" in the normal device.
use.edge.length
a logical indicating whether to use the edge weights of the network to draw the branches (the default) or not.
show.tip.label
a logical indicating whether to show the tip labels on the graph (defaults to TRUE, i.e. the labels are shown).
show.edge.label
a logical indicating whether to show the tip labels on the graph.
edge.label
an additional vector of edge labels (normally not needed).
show.node.label
a logical indicating whether to show the node labels (see example).
node.label
an additional vector of node labels (normally not needed).
show.nodes
a logical indicating whether to show the nodes (see example).
tip.color
the colors used for the tip labels.
edge.color
the colors used to draw edges.
edge.width
the width used to draw edges.
edge.lty
a vector of line types.
font
an integer specifying the type of font for the labels: 1 (plain text), 2 (bold), 3 (italic, the default), or 4 (bold italic).
cex
a numeric value giving the factor scaling of the labels.
...
Further arguments passed to or from other methods.

Details

A networx object hold the information for a phylogenetic network and extends the phylo object. Therefore some generic function for phylo objects will also work for networx objects. The argument planar = FALSE will create a planar split graph based on a cyclic ordering. These objects can be nicely plotted in "2D". So far not all parameters behave the same on the the rgl "3D" and basic graphic "2D" device.

References

Dress, A.W.M. and Huson, D.H. (2004) Constructing Splits Graphs IEEE/ACM Transactions on Computational Biology and Bioinformatics (TCBB), 1(3), 109--115

See Also

consensusNet, neighborNet, splitsNetwork, hadamard, distanceHadamard, layout.kamada.kawai, evonet, as.igraph, densiTree

Examples

Run this code
set.seed(1)
tree1 = rtree(20, rooted=FALSE)
sp = as.splits(rNNI(tree1, n=10))
net = as.networx(sp)
plot(net)
# also see example in consensusNet 
example(consensusNet)

Run the code above in your browser using DataLab