as.networx
convert splits
objects into a networx
object. And most important there exists a generic plot
function to
plot phylogenetic network or split graphs.
as.networx(x, ...)# S3 method for splits
as.networx(x, planar = FALSE, coord = c("none", "2D",
"3D"), ...)
# S3 method for phylo
as.networx(x, ...)
# S3 method for 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 = "black", edge.color = "black", edge.width = 3,
edge.lty = 1, split.color = NULL, split.width = NULL,
split.lty = NULL, font = 3, cex = par("cex"), cex.node.label = cex,
cex.edge.label = cex, col.node.label = tip.color,
col.edge.label = tip.color, font.node.label = font,
font.edge.label = font, ...)
an object of class "splits"
(as.networx) or "networx"
(plot)
Further arguments passed to or from other methods.
logical whether to produce a planar graph from only cyclic splits (may excludes splits).
add coordinates of the nodes, allows to reproduce the plot.
"3D" to plot using rgl or "2D" in the normal device.
a logical indicating whether to use the edge weights of the network to draw the branches (the default) or not.
a logical indicating whether to show the tip labels on
the graph (defaults to TRUE
, i.e. the labels are shown).
a logical indicating whether to show the tip labels on the graph.
an additional vector of edge labels (normally not needed).
a logical indicating whether to show the node labels (see example).
an additional vector of node labels (normally not needed).
a logical indicating whether to show the nodes (see example).
the colors used for the tip labels.
the colors used to draw edges.
the width used to draw edges.
a vector of line types.
the colors used to draw edges.
the width used to draw edges.
a vector of line types.
an integer specifying the type of font for the labels: 1 (plain text), 2 (bold), 3 (italic, the default), or 4 (bold italic).
a numeric value giving the factor scaling of the labels.
a numeric value giving the factor scaling of the node labels.
a numeric value giving the factor scaling of the edge labels.
the colors used for the node labels.
the colors used for the edge labels.
the font used for the node labels.
the font used for the edge labels.
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 = TRUE
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.
Often it is easier and safer to supply vectors of graphical parameters for splits (e.g. splits.color) than for edges. These overwrite values edge.color.
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
Schliep, K., Potts, A. J., Morrison, D. A. and Grimm, G. W. (2017), Intertwining phylogenetic trees and networks. Methods Ecol Evol. 8, 1212--1220. doi:10.1111/2041-210X.12760
consensusNet
, neighborNet
,
splitsNetwork
, hadamard
,
distanceHadamard
, layout_with_kk
,
evonet
, as.igraph
,
densiTree
# NOT RUN {
set.seed(1)
tree1 <- rtree(20, rooted=FALSE)
sp <- as.splits(rNNI(tree1, n=10))
net <- as.networx(sp)
plot(net, "2D")
# }
# NOT RUN {
# also see example in consensusNet
example(consensusNet)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab