Package: TreeTools 2.1.0.9001
TreeTools: Create, Modify and Analyse Phylogenetic Trees
Efficient implementations of functions for the creation, modification and analysis of phylogenetic trees. Applications include: generation of trees with specified shapes; tree rearrangement; analysis of tree shape; rooting of trees and extraction of subtrees; calculation and depiction of split support; plotting the position of rogue taxa (Klopfstein & Spasojevic 2019) <doi:10.1371/journal.pone.0212942>; calculation of ancestor-descendant relationships, of 'stemwardness' (Asher & Smith, 2022) <doi:10.1093/sysbio/syab072>, and of tree balance (Mir et al. 2013, Lemant et al. 2022) <doi:10.1016/j.mbs.2012.10.005>, <doi:10.1093/sysbio/syac027>; artificial extinction (Asher & Smith, 2022) <doi:10.1093/sysbio/syab072>; import and export of trees from Newick, Nexus (Maddison et al. 1997) <doi:10.1093/sysbio/46.4.590>, and TNT <https://www.lillo.org.ar/phylogeny/tnt/> formats; and analysis of splits and cladistic information.
Authors:
TreeTools_2.1.0.9001.tar.gz
TreeTools_2.1.0.9001.zip(r-4.6)TreeTools_2.1.0.9001.zip(r-4.5)TreeTools_2.1.0.9001.zip(r-4.4)
TreeTools_2.1.0.9001.tgz(r-4.6-x86_64)TreeTools_2.1.0.9001.tgz(r-4.6-arm64)TreeTools_2.1.0.9001.tgz(r-4.5-x86_64)TreeTools_2.1.0.9001.tgz(r-4.5-arm64)
TreeTools_2.1.0.9001.tar.gz(r-4.6-arm64)TreeTools_2.1.0.9001.tar.gz(r-4.6-x86_64)TreeTools_2.1.0.9001.tar.gz(r-4.5-arm64)TreeTools_2.1.0.9001.tar.gz(r-4.5-x86_64)
TreeTools_2.1.0.9001.tgz(r-4.5-emscripten)
TreeTools.pdf |TreeTools.html✨
TreeTools/json (API)
NEWS
| # Install 'TreeTools' in R: |
| install.packages('TreeTools', repos = c('https://ms609.r-universe.dev', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/ms609/treetools/issues
Pkgdown/docs site:https://ms609.github.io
- Lobo.data - Data from Zhang et al. 2016
- Lobo.phy - Data from Zhang et al. 2016
- brewer - Brewer palettes
- nRootedShapes - Number of rooted / unrooted tree shapes
- nUnrootedShapes - Number of rooted / unrooted tree shapes
cladisticsevolutionary-biologyphylogenetic-treesphylogeneticscpp
Last updated from:080d73a08c. Checks:13 OK. Indexed: yes.
| Target | Result | Total time | Artifact |
|---|---|---|---|
| linux-devel-arm64 | OK | 203 | |
| linux-devel-x86_64 | OK | 199 | |
| source / vignettes | OK | 299 | |
| linux-release-arm64 | OK | 209 | |
| linux-release-x86_64 | OK | 204 | |
| macos-devel-arm64 | OK | 135 | |
| macos-devel-x86_64 | OK | 326 | |
| macos-release-arm64 | OK | 197 | |
| macos-release-x86_64 | OK | 395 | |
| windows-devel | OK | 257 | |
| windows-release | OK | 225 | |
| windows-oldrel | OK | 241 | |
| wasm-release | OK | 136 |
Exports:.CompatibleRaws.CompatibleSplit.RandomParent.UnrootedKeys%in%AddTipAddTipEverywhereAddUnconstrainedAllAncestorsAllTipLabelsAncestorEdgeApePostorderApeTimeArtExArtificialExtinctionas.ClusterTableas.MixedBaseas.multiPhyloas.Newickas.Splitsas.TreeNumberBalancedTreeCharacterInformationCherriesCladeSizesCladewiseCladisticInfoCladisticInformationCollapseEdgeCollapseNodeCompatibleSplitsConsensusConsensusWithoutConstrainedNJDecomposeDescendantEdgesDescendantTipsDoubleFactorialDoubleFactorial64doubleFactorialsDropTipDropTipPhyloedge_to_splitsEdgeAncestryEdgeDistancesEdgeRatioEndSentenceExtractTaxaFirstMatchingSplitHammingIC1SprImposeConstraintis.TreeNumberJ1IndexJQIndexKeepTipKeepTipPostorderKeepTipPreorderKeptPathsKeptVertsLabelSplitsLeafLabelInterchangeListAncestorsLnDoubleFactorialLnDoubleFactorial.intLnRootedLnRooted.intLnSplitMatchProbabilityLnTreesMatchingSplitLnTreesMatchingTreeLnUnrootedLnUnrooted.intLnUnrootedMultLnUnrootedSplitsLnUnrootedTreesMatchingSplitLog2DoubleFactorialLog2RootedLog2Rooted.intLog2TreesMatchingSplitLog2TreesMatchingTreeLog2UnrootedLog2Unrooted.intLog2UnrootedMultLog2UnrootedSplitsLog2UnrootedTreesMatchingSplitLogDoubleFactorialLogDoubleFactorial.intlogDoubleFactorialsLongBranchMakeTreeBinaryMarkMissingmatchMatchEdgesMatchNodesMatchStringsMatrixToPhyDatMorphoBankDecodeMrBayesTreesMRCAMSTEdgesMSTLengthMultiSplitInformationN1SprNDescendantsNewickTreeNeworderPhyloNeworderPruningwiseNexusTokensNJTreeNodeDepthNodeNumbersNodeOrderNPartitionPairsNPartitionsNRootedNRooted64NRootedShapesNSplitsNTipNUnrootedNUnrooted64NUnrootedMultNUnrootedShapesNUnrootedSplitsPairwiseDistancesPathLengthsPectinateTreePhyDatPhyDatToMatrixPhydatToStringPhyDatToStringPhyToStringPolarizeSplitsPostorderPostorderOrderPreorderPruningwiseRandomTreeReadAsPhyDatReadCharactersReadMrBayesReadMrBayesTreesReadNotesReadTntAsPhyDatReadTNTAsPhyDatReadTntCharactersReadTNTCharactersReadTntTreeRenumberRenumberEdgesRenumberTipsRenumberTreereplicate64ReweightRightmostCharacterRoguePlotroot_on_nodeRootedTreeShapeRootedTreeWithShapeRootNodeRootNodeDistRootNodeDistanceRootOnNodeRootTreeSampleOnesapply64SingleTaxonTreeSisterSizeSortTreeSplitConflictsSplitConsistentSplitFrequencySplitImbalanceSplitInformationSplitMatchProbabilitySplitsInBinaryTreeStarTreeStemminessStringToPhyDatSubsplitSubtreeSupportColorSupportColourTCIContextTipLabelsTipsInSplitsTipTimedTreeTntOrderTNTOrderTntText2TreeTNTText2TreeTopologyOnlyTotalCopheneticIndexTreeIsRootedTreenessTreesMatchingSplitTreesMatchingTreeTrivialSplitsUnquoteUnrootedKeysUnrootedTreeKeyUnrootedTreeShapeUnrootedTreesMatchingSplitUnrootedTreeWithKeyUnrootedTreeWithShapeUnrootTreeUnshiftTreevapply64WithoutTrivialSplitsWriteTntCharactersxorYuleTreeZeroTaxonTree
Dependencies:apebitbit64bitopsdigestfastmatchlatticenlmePlotToolsrbibutilsRcppRCurlRdpackstringi
File system navigation in R
Rendered fromfilesystem-navigation.Rmdusingknitr::rmarkdownon Feb 19 2026.Last update: 2025-01-10
Started: 2019-10-18
Loading phylogenetic data into R
Rendered fromload-data.Rmdusingknitr::rmarkdownon Feb 19 2026.Last update: 2025-05-13
Started: 2019-10-18
Loading phylogenetic trees into R
Rendered fromload-trees.Rmdusingknitr::rmarkdownon Feb 19 2026.Last update: 2023-07-03
Started: 2019-10-18
Readme and manuals
Help Manual
| Help page | Topics |
|---|---|
| Add a tip to a phylogenetic tree | AddTip AddTipEverywhere |
| Read modification time from "ape" Nexus file | ApeTime |
| Artificial Extinction | ArtEx ArtificialExtinction ArtificialExtinction.matrix ArtificialExtinction.phyDat |
| Convert object to 'multiPhylo' class | as.multiPhylo as.multiPhylo.list as.multiPhylo.phyDat as.multiPhylo.phylo as.multiPhylo.Splits |
| Write a phylogenetic tree in Newick format | as.Newick as.Newick.list as.Newick.multiPhylo as.Newick.phylo |
| Brewer palettes | brewer |
| Character information content | CharacterInformation |
| Count cherries in a tree | Cherries Cherries.numeric Cherries.phylo |
| Clade sizes | CladeSizes |
| Cladistic information content of a tree | CladisticInfo CladisticInfo.list CladisticInfo.multiPhylo CladisticInfo.phylo CladisticInfo.Splits CladisticInformation |
| Convert phylogenetic tree to 'ClusterTable' | as.ClusterTable as.ClusterTable.list as.ClusterTable.multiPhylo as.ClusterTable.phylo ClusterTable |
| S3 methods for 'ClusterTable' objects | as.matrix.ClusterTable ClusterTable-methods print.ClusterTable summary.ClusterTable |
| Collapse nodes on a phylogenetic tree | CollapseEdge CollapseNode CollapseNode.phylo |
| Construct consensus trees | Consensus |
| Reduced consensus, omitting specified taxa | ConsensusWithout ConsensusWithout.list ConsensusWithout.multiPhylo ConsensusWithout.phylo MarkMissing |
| Constrained neighbour-joining tree | ConstrainedNJ |
| Decompose additive (ordered) phylogenetic characters | Decompose |
| Identify descendant edges | DescendantEdges DescendantTips |
| Double factorial | DoubleFactorial DoubleFactorial64 LnDoubleFactorial LnDoubleFactorial.int Log2DoubleFactorial LogDoubleFactorial LogDoubleFactorial.int |
| Double factorials | doubleFactorials |
| Drop leaves from tree | DropTip DropTip.list DropTip.multiPhylo DropTip.NULL DropTip.phylo DropTip.Splits DropTipPhylo KeepTip KeepTip.list KeepTip.multiPhylo KeepTip.NULL KeepTip.phylo KeepTip.Splits KeepTipPostorder KeepTipPreorder |
| Efficiently convert edge matrix to splits | edge_to_splits |
| Ancestors of an edge | EdgeAncestry |
| Distance between edges | EdgeDistances |
| Ratio of external:internal edge length | EdgeRatio EdgeRatio.phylo |
| Add full stop to end of a sentence | EndSentence |
| Generate pectinate, balanced or random trees | BalancedTree GenerateTree PectinateTree RandomTree StarTree YuleTree |
| Hamming distance between taxa in a phylogenetic dataset | Hamming |
| Force a tree to match a constraint | AddUnconstrained ImposeConstraint |
| Is an object a 'TreeNumber' object? | is.TreeNumber |
| Robust universal tree balance index | J1Index JQIndex |
| Paths present in reduced tree | KeptPaths KeptPaths.data.frame KeptPaths.matrix |
| Identify vertices retained when leaves are dropped | KeptVerts KeptVerts.numeric KeptVerts.phylo |
| Label splits | LabelSplits |
| Leaf label interchange | LeafLabelInterchange |
| List ancestors | AllAncestors ListAncestors |
| Data from Zhang et al. 2016 | Lobo.data Lobo.phy |
| Natural logarithms of double factorials | logDoubleFactorials |
| Identify taxa with long branches | LongBranch |
| Generate binary tree by collapsing polytomies | MakeTreeBinary |
| Tree matching | %in%,multiPhylo,multiPhylo-method %in%,multiPhylo,phylo-method %in%,phylo,multiPhylo-method %in%,phylo,phylo-method match,multiPhylo,multiPhylo-method match,multiPhylo,phylo-method match,phylo,multiPhylo-method match,phylo,phylo-method |
| Split matching | %in%,Splits,Splits-method FirstMatchingSplit match match,Splits,Splits-method |
| Match nodes and edges between trees | MatchEdges MatchNodes |
| Check for mismatch between character vectors | MatchStrings |
| Convert between matrices and 'phyDat' objects | MatrixToPhyDat PhyDatToMatrix |
| Decode MorphoBank text | MorphoBankDecode |
| Most recent common ancestor | MRCA |
| Minimum spanning tree | MSTEdges MSTLength |
| Number of trees one SPR step away | IC1Spr N1Spr |
| Count descendants for each node in a tree | NDescendants |
| Write Newick Tree | NewickTree |
| Generate a neighbour joining tree | NJTree |
| Distance of each node from tree exterior | NodeDepth |
| Numeric index of each node in a tree 'NodeNumbers()' returns a sequence corresponding to the nodes in a tree | NodeNumbers |
| Number of edges incident to each node in a tree | NodeOrder |
| Distributions of tips consistent with a partition pair | NPartitionPairs |
| Number of trees | LnRooted LnRooted.int LnUnrooted LnUnrooted.int LnUnrootedMult LnUnrootedSplits Log2Rooted Log2Rooted.int Log2Unrooted Log2Unrooted.int Log2UnrootedMult Log2UnrootedSplits NRooted NRooted64 NUnrooted NUnrooted64 NUnrootedMult NUnrootedSplits |
| Number of rooted / unrooted tree shapes | nRootedShapes nUnrootedShapes |
| Number of distinct splits | NPartitions NSplits NSplits.character NSplits.ClusterTable NSplits.list NSplits.multiPhylo NSplits.NULL NSplits.numeric NSplits.phylo NSplits.Splits |
| Number of leaves in a phylogenetic tree | NTip NTip.default NTip.list NTip.matrix NTip.multiPhylo NTip.phyDat NTip.phylo NTip.Splits |
| Distances between each pair of trees | PairwiseDistances |
| Calculate length of paths between each pair of vertices within tree | PathLengths |
| Polarize splits on a single taxon | PolarizeSplits |
| Print 'TreeNumber' object | print.TreeNumber |
| Read phylogenetic characters from file | PhyDat ReadAsPhyDat ReadCharacters ReadNotes ReadTNTAsPhyDat ReadTntAsPhyDat ReadTNTCharacters ReadTntCharacters |
| Read posterior tree sample produced by MrBayes | MrBayesTrees ReadMrBayes ReadMrBayesTrees |
| Parse TNT Tree | ReadTntTree TNTText2Tree TntText2Tree |
| Renumber a tree's nodes and tips | Renumber |
| Renumber a tree's tips | RenumberTips RenumberTips.list RenumberTips.multiPhylo RenumberTips.NULL RenumberTips.phylo RenumberTips.Splits |
| Reweight phylogenetic characters | Reweight |
| Rightmost character of string | RightmostCharacter |
| Visualize position of rogue taxa | RoguePlot |
| Which node is a tree's root? | RootNode |
| Root or unroot a phylogenetic tree | RootOnNode RootTree UnrootTree |
| Select element at random | SampleOne |
| Apply a function that returns 64-bit integers over a list or vector | replicate64 sapply64 vapply64 |
| Sort a list of phylogenetic trees | <.MixedBase <.phylo ==.MixedBase ==.phylo >.MixedBase >.phylo sort.multiPhylo |
| Sort tree | SortTree SortTree.list SortTree.multiPhylo SortTree.phylo |
| Identify consistent / conflicting splits | SplitConflicts SplitConsistent |
| Frequency of splits | SplitFrequency |
| Phylogenetic information content of splitting leaves into two partitions | MultiSplitInformation SplitInformation SplitInformation.numeric SplitInformation.phylo SplitInformation.Splits |
| Probability of matching this well | LnSplitMatchProbability SplitMatchProbability |
| Convert object to 'Splits' | as.logical.Splits as.Splits as.Splits.character as.Splits.integer as.Splits.list as.Splits.logical as.Splits.matrix as.Splits.multiPhylo as.Splits.numeric as.Splits.phylo as.Splits.Splits Splits |
| Maximum splits in an _n_-leaf tree | SplitsInBinaryTree SplitsInBinaryTree.default SplitsInBinaryTree.list SplitsInBinaryTree.multiPhylo SplitsInBinaryTree.NULL SplitsInBinaryTree.numeric SplitsInBinaryTree.phylo SplitsInBinaryTree.Splits |
| "Stemwardness" of a leaf | RootNodeDist RootNodeDistance RootNodeDistance.character RootNodeDistance.numeric SisterSize SisterSize.character SisterSize.numeric Stemwardness |
| Convert between strings and 'phyDat' objects | PhyDatToString PhydatToString PhyToString StringToPhyDat StringToPhydat |
| Subset of a split on fewer leaves | Subsplit |
| Extract a subtree | Subtree |
| Colour for node support value | SupportColor SupportColour |
| Extract tip labels | AllTipLabels AllTipLabels.list AllTipLabels.matrix AllTipLabels.multiPhylo AllTipLabels.phylo AllTipLabels.Splits AllTipLabels.TreeNumber TipLabels TipLabels.character TipLabels.default TipLabels.list TipLabels.logical TipLabels.matrix TipLabels.MixedBase TipLabels.multiPhylo TipLabels.numeric TipLabels.phyDat TipLabels.phylo TipLabels.Splits TipLabels.TreeNumber |
| Tips contained within splits | SplitImbalance SplitImbalance.phylo SplitImbalance.Splits TipsInSplits TipsInSplits.phylo TipsInSplits.Splits |
| Display time-calibrated tree using tip information only | TipTimedTree |
| Remove metadata from trees | TopologyOnly |
| Total Cophenetic Index | TCIContext TCIContext.numeric TotalCopheneticIndex |
| Is tree rooted? | TreeIsRooted |
| Relative length of internal branches | Stemminess Treeness |
| Unique integer indices for bifurcating tree topologies | as.MixedBase as.MixedBase.integer64 as.MixedBase.MixedBase as.MixedBase.multiPhylo as.MixedBase.numeric as.MixedBase.phylo as.MixedBase.TreeNumber as.phylo.MixedBase as.phylo.numeric as.phylo.TreeNumber as.TreeNumber as.TreeNumber.character as.TreeNumber.MixedBase as.TreeNumber.multiPhylo as.TreeNumber.phylo as.TreeNumber.TreeNumber TreeNumber |
| Number of trees matching a bipartition split | LnTreesMatchingSplit Log2TreesMatchingSplit TreesMatchingSplit |
| Number of trees containing a tree | LnTreesMatchingTree Log2TreesMatchingTree TreesMatchingTree |
| Identify and remove trivial splits | TrivialSplits WithoutTrivialSplits |
| Generate trivial trees | SingleTaxonTree TrivialTree ZeroTaxonTree |
| Remove quotation marks from a string | Unquote |
| Number of trees consistent with split | LnUnrootedTreesMatchingSplit Log2UnrootedTreesMatchingSplit UnrootedTreesMatchingSplit |
| Add tree to start of list | UnshiftTree |
| Write morphological character matrix to TNT file | WriteTntCharacters WriteTntCharacters.matrix WriteTntCharacters.phyDat |
| Exclusive OR operation | xor xor,Splits,Splits-method |
