Learn R Programming

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

74

Version

1.1.4

License

GPL-2

Maintainer

Last Published

May 26th, 2020

Functions in treeman (1.1.4)

TreeMan-to-phylo

Convert TreeMan to phylo
addTip

Add tip to a tree
Node-class

Node-class
TreeMen-to-multiPhylo

Convert TreeMen to multiPhylo
birds

Phylogenetic tree of Aves
TreeMen-class

TreeMen-class
TreeMan-class

TreeMan-class
addClade

Add clade to tree
blncdTree

Generate a balanced tree
addNdmtrx

Add node matrix to a tree
cTrees

cTrees
getLvng

Get extant tips from a tree
calcPhyDv

Calculate phylogenetic diversity
getDcsd

Get extinct tips from a tree
getNdSlt

Get a node slot
getCnnctdNds

Get all nodes connected by given tips
calcOvrlp

Calculate phylogenetic overlap
calcDstBLD

Calculate the BLD between two trees
getNdPrids

Get pre-nodes to root
getNdAge

Get age
calcDstMtrx

Calculate the distance matrix
getNdsSlt

Get a node slot for multiple nodes
getNdPtids

Get post-nodes to tips
getNdsSstr

Get sister id
calcDstTrp

Calculate the triplet distance between two trees
calcPrtFrPrp

Calculate evolutionary distinctness for part of tree
getPath

Get path between nodes
calcNdsBlnc

Calculate the balances of all nodes
calcNdBlnc

Calculate the balance of a node
getOtgrp

Get outgroup
checkNdlst

Check if ndlst is correct
getNdsAge

Get ages for multiple nodes
getNdsFrmTxnyms

Get IDs for nodes represented txnyms
getNdsKids

Get children IDs for multiple nodes
calcFrPrp

Calculate evolutionary distinctness
getNdSstr

Get sister id
multiPhylo-to-TreeMen

Convert multiPhylo to TreeMen
getUnqNds

Get unique nodes represented by tips
writeTrmn

Write a .trmn tree
checkTreeMen

Check if trees are correct
saveTreeMan

Save a TreeMan object in serialization format
phylo-class

phylo class
calcDstRF

Calculate the Robinson-Foulds distance between two trees
fastCheckTreeMan

Check if tree is correct, fast!
searchTxnyms

Get node labels based on online taxonomic database
getNdKids

Get children IDs
isUltrmtrc

Is tree ultrametric?
list-to-TreeMen

Convert list to a TreeMen
getNdPD

Get phylogenetic diversity of node
getNdPrdst

Get pre-distance
loadTreeMan

Load a TreeMan object in serialization format
getBiprts

Get the sets of labels for each bipartition in tree
phylo-to-TreeMan

Convert phylo to TreeMan
rmNdmtrx

Remove node matrix
pinTips

Pin tips to a tree
getAge

Get age of tree
getNdLng

Get lineage
setAge

Set the age of a tree
getNdsPtids

Get post-nodes to tips for multiple nodes
getSpnAge

Get age range
getNdsPrids

Get pre-nodes for multiple nodes
getPrnt

Get parent
getSubtree

Get subtree
getNdsPrdst

Get pre-distances
getSpnsAge

Get age ranges for multiple nodes
getNdsPD

Get phylogenetic diversities of nodes
setNdID

Set the ID of a node
getNdsLng

Get lineage for multiple nodes
readTrmn

Read a .trmn tree
plants

Phylogenetic tree of European Flora
pstMnp

Update prinds and tinds
rmClade

Remove a clade from a tree
mammals

Phylogenetic tree of Mammalia
setNdsSpn

Set the branch lengths of specific nodes
setPD

Set the phylogenetic diversity
rmNodes

Remove nodes from a tree
treeman-package

Phylogenetic Tree Manipulation
updateSlts

Update tree slots after manipulation
twoer

Generate a tree of two tips
setNdsID

Set the IDs of multiple nodes
setNdsOther

Set a user defined slot for multiple nodes
writeTree

Write a Newick tree
multiPhylo-class

multiPhylo class
unblncdTree

Generate an unbalanced tree
setNdSpn

Set the branch length of a specific node
ultrTree

Make tree ultrametric
setNdOther

Set a user defined slot
rmOtherSlt

Remove a user-defined slot
randTree

Generate a random tree
rmTips

Remove tips from a tree
readTree

Read a Newick tree
setTxnyms

Set the txnym slots in a tree
taxaResolve

Resolve taxonmic names online