collapseUnsupportedEdges: Collapse Unsupported Edges/Branches in a Phylogeny

View source: R/collapseUnsupportedEdges.R

collapseUnsupportedEdgesR Documentation

Collapse Unsupported Edges/Branches in a Phylogeny

Description

Given a set of node support values (e.g., bootstrap proportions, posterior probabilities) and a certain threshold, all edges receiving less support than the threshold will be collapsed.

Usage

collapseUnsupportedEdges(phy, value = "node.label", cutoff)

Arguments

phy

An object of class phylo.

value

A character string giving the name of the list element that contains the support values; default is "node.label".

cutoff

A numeric value giving the threshold below which edges will be collapsed.

Value

An object of class phylo.

Examples

## phylogeny of bark beetles
data(ips.tree)
## non-parametric bootstrap proportions (BP)
ips.tree$node.label
## collapse clades with < 70 BP
tr <- collapseUnsupportedEdges(ips.tree, "node.label", 70)
## show new topology
par(mfrow = c(1, 2))
plot(ips.tree, no.margin = TRUE)
nodelabels(ips.tree$node.label, cex = .5, frame = "n", adj = c(0, .5))
plot(tr, no.margin = TRUE)

ips documentation built on May 29, 2024, 4:39 a.m.