MetaPhylo
Documentation for MetaPhylo.
AbstractTrees.treebreadth
AbstractTrees.treeheight
AbstractTrees.treesize
MetaPhylo.add_child!
MetaPhylo.ancestors
MetaPhylo.common_ancestor
MetaPhylo.distance
MetaPhylo.distance_matrix
MetaPhylo.findbranches
MetaPhylo.findnodes
MetaPhylo.freeze
MetaPhylo.isinternal
MetaPhylo.isinternal
MetaPhylo.isleaf
MetaPhylo.isleaf
MetaPhylo.isrerootable
MetaPhylo.isrooted
MetaPhylo.ladderize!
MetaPhylo.leafedges
MetaPhylo.leaves
MetaPhylo.parent_branch
MetaPhylo.reindex!
MetaPhylo.rem_descendants!
MetaPhylo.reroot!
MetaPhylo.swap!
MetaPhylo.swapchildren!
MetaPhylo.treelength
AbstractTrees.treebreadth
— MethodAbstractTrees.treebreadth(tree::AbstractPhyloTree)
Return the number of leaves in the tree
.
AbstractTrees.treeheight
— MethodAbstractTrees.treeheight(tree::AbstractPhyloTree)
Return the maximum depth from the root to the leaves in the tree. See also treelength
.
AbstractTrees.treesize
— MethodAbstractTrees.treesize(tree::AbstractPhyloTree)
Return the size og the tree.
MetaPhylo.add_child!
— Methodadd_child!(tree::Tree, idx::Integer, branch_data::Dict{Symbol, Any}, node_data::Dict{Symbol, Any})
Add a child node to the specified node with branch and node data. Return true
on success.
MetaPhylo.ancestors
— Methodancestors(tree::AbstractPhyloTree, idx::Integer)
Return the indices of all ancestor nodes of the specified idx
node.
MetaPhylo.common_ancestor
— Methodcommon_ancestor(tree::AbstractPhyloTree, idx::Integer...)
Return the lowest common ancestor index among specified nodes.
MetaPhylo.distance
— Methoddistance(tree::AbstractPhyloTree, idx1::Integer, idx2::Integer)
Return distance between two nodes on a tree.
MetaPhylo.distance_matrix
— Methoddistance_matrix(tree::AbstractPhyloTree, [indices::Vector{<:Integer}])
Return pairwise distances between all indices on the tree
as an AxisArray
. If not indices are specified, all leaves are used as input.
MetaPhylo.findbranches
— Methodfindbranches(tree::AbstractPhyloTree, args...; ifnot_haskey::Bool=false)
Return indices of tree branch which all values proceed by transformation(s) args
for a given attribute are true.
MetaPhylo.findnodes
— Methodfindnodes(tree::AbstractPhyloTree, args...; ifnot_haskey::Bool=false)
Return indices of tree node which all values proceed by transformation(s) args
for a given attribute are true.
MetaPhylo.freeze
— Methodfreeze(tree::MetaPhylo.Tree)
Generate a StaticTree
from a tree. NamedTuple
stores only the keys that are common to all data among the node and branch data of previous tree.
MetaPhylo.isinternal
— Methodisinternal(tree::AbstractPhyloTree, idx::Integer)
Return true
if the edge
is both connected to internal nodes of the tree
.
MetaPhylo.isinternal
— Methodisinternal(tree::AbstractPhyloTree, idx::Integer)
Return true
if the idx
is contained in an internal node of the tree
.
MetaPhylo.isleaf
— Methodisleaf(tree::AbstractPhyloTree, edge::Edge)
Return true
if the edge
is connected to a leaf node of the tree
.
MetaPhylo.isleaf
— Methodisleaf(tree::AbstractPhyloTree, idx::Integer)
Return true
if the idx
is contained in a leaf node of the tree
.
MetaPhylo.isrerootable
— Methodisrerootable(tree::AbstractPhyloTree)
Return true if tree is rerootable.
MetaPhylo.isrooted
— Methodisrooted(tree::AbstractPhyloTree)
Return true if tree is rooted.
MetaPhylo.ladderize!
— Methodladderize!(tree::Tree; left=false)
Ladderize the tree structure. By default, the smallest clade is on the right side; if left=true, on the left side.
MetaPhylo.leafedges
— Methodleafedges(tree::AbstractPhyloTree, [idx::Integer])
Return the edges of all edges connected to the leaves in the tree
. If the index is specified, this returns the edges connected to its leaves in the tree
.
MetaPhylo.leaves
— Methodleaves(tree::AbstractPhyloTree, [idx::Integer])
Return the indices of all leaves in the tree
. If the index is specified, this returns the indices of leaves in its subtree.
MetaPhylo.parent_branch
— Methodparent_branch(tree::AbstractPhyloTree, idx::Integer)
Return the baranch (edge) between the specified idx
node and its parent node. If the node is root, this returns nothing
MetaPhylo.reindex!
— Methodreindex!(tree::Tree)
Reindex the tree
in PreOderDFS
order from the root.
MetaPhylo.rem_descendants!
— Methodrem_descendants(tree::Tree, idx::Integer)
Remove all descendants of the specified node. Return true
on success.
MetaPhylo.reroot!
— Methodreroot!(tree::Tree, idx::Integer)
Reroot the tree
at the specified node. Return true
if rerooting success.
MetaPhylo.swap!
— Methodswap!(tree::Tree, idx::Integer, old_new::Pair{<:Integer, <:Integer})
Swap the two child elements of the specified idx
node. The old
and new
in old_new
must be child of idx
node. Return ture
if swapping fails; true otherwise.
MetaPhylo.swapchildren!
— Methodswapchildren!(tree::Tree, idx::Integer, newchildren)
Swap the child indices of the specified idx
node to the given newchildren
. The elements of children and newchildren
must be match. Return false
if swapping fails; true otherwise.
MetaPhylo.treelength
— Methodtreelength(tree::AbstractPhyloTree, [idx::Integer])
Return maximum distance from the root to the leaves in the tree
. If the index is specified, this returns maximum distance from the specified idx
to its leaves in the tree
.