fix.poly: Resolving polytomies to non-zero length branches

View source: R/fix.poly.R

fix.polyR Documentation

Resolving polytomies to non-zero length branches

Description

The function either collapses clades under a polytomy or resolves polytomous clades to non-zero length branches, dichotomous clades.

Usage

fix.poly(tree,type=c("collapse","resolve"),node=NULL,tol=1e-10,random=TRUE)

Arguments

tree

a phylogenetic tree.

type

either 'collapse' to create polytomies to one or more specific nodes or 'resolve' to resolve (fix) all the polytomies within the tree or to one or more specific nodes.

node

the node in the tree where a polytomy should be created or fixed, either. If type='resolve' and node=NULL all the polytomies present in the tree are resolved.

tol

the tolerance to consider a branch length significantly greater than zero, set at 1e-10 by default. If type='resolve', all the branch lengths smaller than tol are treated as polytomies.

random

a logical value specifying whether to resolve the polytomies randomly (the default) or in the order they appear in the tree (if random = FALSE).

Details

Under type='resolve' polytomous clades are resolved adding non-zero length branches to each new node. The evolutionary time attached to the new nodes is partitioned equally below the dichotomized clade.

Value

A phylogenetic tree with randomly fixed (i.e. type='resolve') polytomies or created polytomies (i.e. type='collapse').Note, tip labels are ordered according to their position in the tree.

Author(s)

Silvia Castiglione, Pasquale Raia, Carmela Serio

References

Castiglione, S., Serio, C., Piccolo, M., Mondanaro, A., Melchionna, M., Di Febbraro, M., Sansalone, G., Wroe, S., & Raia, P. (2020). The influence of domestication, insularity and sociality on the tempo and mode of brain size evolution in mammals. Biological Journal of the Linnean Society,132: 221-231. doi:10.1093/biolinnean/blaa186

See Also

fix.poly vignette;

Examples

## Not run: 
 require(ape)

 data("DataCetaceans")
 DataCetaceans$treecet->treecet

 # Resolve all the polytomies within Cetaceans phylogeny
 fix.poly(treecet,type="resolve")->treecet.fixed
 par(mfrow=c(1,2))
 plot(treecet,no.margin=TRUE,show.tip.label=FALSE)
 plot(treecet.fixed,no.margin=TRUE,show.tip.label=FALSE)

 # Resolve the polytomies pertaining the genus Kentriodon
 fix.poly(treecet,type="resolve",node=221)->treecet.fixed2
 par(mfrow=c(1,2))
 plot(treecet,no.margin=TRUE,show.tip.label=FALSE)
 plot(treecet.fixed2,no.margin=TRUE,show.tip.label=FALSE)

 # Collapse Delphinidae into a polytomous clade
 fix.poly(treecet,type="collapse",node=179)->treecet.collapsed
 par(mfrow=c(1,2))
 plot(treecet,no.margin=TRUE,show.tip.label=FALSE)
 plot(treecet.collapsed,no.margin=TRUE,show.tip.label=FALSE)

## End(Not run)

RRphylo documentation built on May 9, 2022, 9:08 a.m.