Learn R Programming

⚠️There's a newer version (1.1.4) of this package.Take me there.

treeman

An R package for manipulating phylogentic trees using an intuitive S4 class structure.

The treeman R package provides a list based class for encoding phylogenetic trees in R, making manipulating phylogenetic trees easier to code and more efficient to run. treeman is aimed to be fast, simple and intuitive.

Installation

With CRAN:

install.packages('treeman')

Installing the development copy via GitHub

library(devtools)
install_github('dombennett/treeman')

Quick guide

# working with the TreeMan class
library(treeman)
?TreeMan  # check the documentation
tree <- randTree(10)  # generate a random tree of 10 tips
summary(tree)  # check key stats
tree["tips"]  # extract key stats

For more details check out the wiki.

Licence

GPL-2

Status

Version 1.1 released.

Reference

Bennett, D.J., Sutton, M.D. & Turvey, S.T., 2017. treeman: an R package for efficient and intuitive manipulation of phylogenetic trees. BMC Research Notes, 10(1), p.30. Available online

Author

D.J. Bennett (but I welcome pull requests!)

Copy Link

Version

Install

install.packages('treeman')

Monthly Downloads

24

Version

1.1.3

License

GPL-2

Maintainer

DJ Bennett

Last Published

September 17th, 2018

Functions in treeman (1.1.3)

TreeMan-to-phylo

Convert TreeMan to phylo
TreeMen-class

TreeMen-class
calcOvrlp

Calculate phylogenetic overlap
calcPhyDv

Calculate phylogenetic diversity
checkTreeMen

Check if trees are correct
fastCheckTreeMan

Check if tree is correct, fast!
getNdKids

Get children IDs
getNdLng

Get lineage
getOtgrp

Get outgroup
getPath

Get path between nodes
list-to-TreeMen

Convert list to a TreeMen
loadTreeMan

Load a TreeMan object in serialization format
multiPhylo-to-TreeMen

Convert multiPhylo to TreeMen
birds

Phylogenetic tree of Aves
phylo-class

phylo class
blncdTree

Generate a balanced tree
calcDstTrp

Calculate the triplet distance between two trees
calcFrPrp

Calculate evolutionary distinctness
getAge

Get age of tree
getBiprts

Get the sets of labels for each bipartition in tree
getNdsKids

Get children IDs for multiple nodes
TreeMen-to-multiPhylo

Convert TreeMen to multiPhylo
rmNdmtrx

Remove node matrix
cTrees

cTrees
getNdsLng

Get lineage for multiple nodes
getPrnt

Get parent
calcDstBLD

Calculate the BLD between two trees
addClade

Add clade to tree
getCnnctdNds

Get all nodes connected by given tips
rmNodes

Remove nodes from a tree
calcDstMtrx

Calculate the distance matrix
getDcsd

Get extinct tips from a tree
calcDstRF

Calculate the Robinson-Foulds distance between two trees
getSpnAge

Get age range
getNdSlt

Get a node slot
setTxnyms

Set the txnym slots in a tree
getNdSstr

Get sister id
getNdsAge

Get ages for multiple nodes
getNdsFrmTxnyms

Get IDs for nodes represented txnyms
phylo-to-TreeMan

Convert phylo to TreeMan
getNdsPD

Get phylogenetic diversities of nodes
pinTips

Pin tips to a tree
getNdsPrdst

Get pre-distances
plants

Phylogenetic tree of European Flora
getSubtree

Get subtree
setNdOther

Set a user defined slot
getSpnsAge

Get age ranges for multiple nodes
taxaResolve

Resolve taxonmic names online
pstMnp

Update prinds and tinds
writeTrmn

Write a .trmn tree
rmTips

Remove tips from a tree
rmOtherSlt

Remove a user-defined slot
calcNdBlnc

Calculate the balance of a node
TreeMan-class

TreeMan-class
Node-class

Node-class
calcNdsBlnc

Calculate the balances of all nodes
mammals

Phylogenetic tree of Mammalia
addNdmtrx

Add node matrix to a tree
setNdSpn

Set the branch length of a specific node
ultrTree

Make tree ultrametric
unblncdTree

Generate an unbalanced tree
addTip

Add tip to a tree
calcPrtFrPrp

Calculate evolutionary distinctness for part of tree
checkNdlst

Check if ndlst is correct
getNdPrids

Get pre-nodes to root
updateSlts

Update tree slots after manipulation
writeTree

Write a Newick tree
multiPhylo-class

multiPhylo class
randTree

Generate a random tree
getNdPtids

Get post-nodes to tips
readTree

Read a Newick tree
getLvng

Get extant tips from a tree
getNdsSlt

Get a node slot for multiple nodes
getNdAge

Get age
getNdPD

Get phylogenetic diversity of node
getNdPrdst

Get pre-distance
getNdsSstr

Get sister id
getNdsPrids

Get pre-nodes for multiple nodes
setAge

Set the age of a tree
getNdsPtids

Get post-nodes to tips for multiple nodes
setNdID

Set the ID of a node
getUnqNds

Get unique nodes represented by tips
isUltrmtrc

Is tree ultrametric?
readTrmn

Read a .trmn tree
rmClade

Remove a clade from a tree
saveTreeMan

Save a TreeMan object in serialization format
setNdsID

Set the IDs of multiple nodes
setNdsSpn

Set the branch lengths of specific nodes
setPD

Set the phylogenetic diversity
searchTxnyms

Get node labels based on online taxonomic database
setNdsOther

Set a user defined slot for multiple nodes
treeman-package

Phylogenetic Tree Manipulation
twoer

Generate a tree of two tips