Plot.phylocl: Plot phylogenetic tree with clades collapsed

View source: R/plot_phylocl.r

Plot.phyloclR Documentation

Plot phylogenetic tree with clades collapsed

Description

Plot phylogenetic tree with clades collapsed into triangles or rectangles

Usage

Plot.phylocl(tree, cl, strict=TRUE, keep.mono=FALSE, what="triangles",
 col.ed="black", col.td="black", col.etr="transparent", col.ttr="transparent",
 col.pfl="lightgrey", col.pbr="black", lty.p=1, lwd.p=1, col.ct="black",
 ct.off=0, ct.fnt=1, cex=par("cex"), longer="0%", ...)

Arguments

tree

phylo object

cl

two columns classification table

strict

default TRUE: do not join all descendants

keep.mono

default FALSE: do not keep monotypic clades

what

default "triangles", also possible to use "rectangles"

col.ed

default "black", default edge color

col.td

default black", default tips color

col.etr

default "transparent", color to suppress original edges

col.ttr

default "transparent", color to suppress original tips

col.pfl

default "lightgrey", fill color for polygons

col.pbr

default "black", border color of polygons

lty.p

default 1, line type of polygon borders

lwd.p

default 1, line width

col.ct

default "black", color of clade labels

ct.off

default 0, text offset of clade labels

ct.fnt

default 1, text font of clade labels

cex

default par("cex"), text font size of all labels

longer

default "0%", percent to increase xlim to fit longer clade labels

...

options to ape::plot.phylo()

Details

Plot.phylocl() plots phylogenetic tree with clades collapsed into triangles or rectangles.

Alternative is phytools::plot.backbonePhylo() which however requires more manual work.

Some tricks used (null plotting and transparent elements), the last one is actually useful in other ways.

Intersections and other deviated cases not controlled. However, they are really easy to spot.

All parameters of polygons should be either "scalars" or vectors of the same length as clade list (minus monotypic clades), clades are in alphabetical order. To help, list of clade names is invisibly returned in the end.

If keep.mono=TRUE, then monotypic clades must have names in the clade list, otherwise this option is useless.

Value

Returns list of clade names.

Author(s)

Alexey Shipunov

See Also

phytools::plot.backbonePhylo()

Examples

aa.d <- hclust(dist(t(atmospheres)))
tree <- ape::unroot(ape::as.phylo(aa.d))

cl <- data.frame(
planet=c(
 "Mercury",
 "Venus",
 "Earth",
 "Mars",
 "Jupiter",
 "Saturn",
 "Uranus",
 "Neptune"),
clade=c(
 "Mercury",
 "Mars group",
 "Earth",
 "Mars group",
 "Close giants",
 "Close giants",
 "Distant giants",
 "Distant giants"),
stringsAsFactors=FALSE)

Plot.phylocl(tree, cl, longer="5%", ct.off=0.1)

shipunov documentation built on Feb. 16, 2023, 9:05 p.m.