API
The Phylo.API submodule provides the API that must be extended for new AbstractTree
, AbstractNode
and AbstractBranch
subtypes.
Usage
Providing additional code to extend the functionality of the system is simple:
using Phylo importall Phylo.API type SimplestTree <: AbstractTree{Int, Int} nodes::OrderedDict{Int, BinaryNode{Int}} branches::Dict{Int, Branch{Int}} end function _addnode!(tree::SimplestTree, num) _setnode!(tree, num, BinaryNode{Int}()) return num end
creates a new SimplestTree
type (a subtype of AbstractTree
) and extends Phylo.API._addnode!()
(and therefore the directly accessible addnode!()
interface) to handle the SimplestTree
subtype of AbstractTree
. See docs here to see which Phylo.API
functions have to be extended for any new subtype, and which have default implementations.
#
Phylo.API
— Module.
Phylo.API submodule
The Phylo.API
submodule should be import[all]
ed if you want to create a new phylogeny, node or branch subtype. Otherwise it can be ignored.
#
Phylo.API._addbranch!
— Function.
_addbranch!(tree::AbstractTree, source, destination; length::Float64 = NaN, branchname = _newbranchlabel(tree))
Must be implemented for any AbstractTree subtype.
#
Phylo.API._addnode!
— Function.
_addnode!(tree::AbstractTree, nodename)
Must be implemented for any AbstractTree subtype.
#
Phylo.API._addnodes!
— Function.
_addnodes!(tree::AbstractTree, nodenames::AbstractVector) _addnodes!(tree:AbstractTree, count::Integer)
#
Phylo.API._addoutbound!
— Function.
_addinbound!(node::AbstractNode, outbound)
Must be implemented for any AbstractNode subtype.
#
Phylo.API._branch!
— Method.
_branch!(tree::AbstractTree, source, length::Float64, destination, branchname)
#
Phylo.API._branchtype
— Function.
_branchtype(::AbstractTree)
Returns type of branches in a tree.
#
Phylo.API._deletebranch!
— Function.
_deletebranch!(tree::AbstractTree, branchname)
Must be implemented for any AbstractTree subtype.
#
Phylo.API._deletenode!
— Function.
_deletenode!(tree::AbstractTree, nodename)
Must be implemented for any AbstractTree subtype.
#
Phylo.API._deleteoutbound!
— Function.
_deleteoutbound!(node::AbstractNode, outbound)
Must be implemented for any AbstractNode subtype.
#
Phylo.API._dst
— Function.
_dst
Return destination node for a branch. Must be implemented for any AbstractBranch subtype.
#
Phylo.API._getbranch
— Function.
_getbranch(tree::AbstractTree, branchname)
Must be implemented for any AbstractTree subtype.
#
Phylo.API._getbranches
— Function.
_getbranches(tree::AbstractTree)
Must be implemented for any AbstractTree subtype.
#
Phylo.API._getbranchnames
— Function.
_getbranchnames(tree::AbstractTree)
Must be implemented for any AbstractTree subtype.
#
Phylo.API._getheight
— Method.
_getheight(tree::AbstractTree, nodename)
#
Phylo.API._getinbound
— Function.
_getinbound(node::AbstractNode)
Must be implemented for any AbstractNode subtype.
#
Phylo.API._getlength
— Function.
_getlength
Return length of a branch. May be implemented for any AbstractBranch subtype.
#
Phylo.API._getnode
— Function.
_getnode(tree::AbstractTree, nodename)
Must be implemented for any AbstractTree subtype.
#
Phylo.API._getnodenames
— Function.
_getnodenames(tree::AbstractTree)
Must be implemented for any AbstractTree subtype.
#
Phylo.API._getnodes
— Function.
_getnodes(tree::AbstractTree)
Must be implemented for any AbstractTree subtype.
#
Phylo.API._getoutbounds
— Function.
_getoutbounds(node::AbstractNode)
Must be implemented for any AbstractNode subtype.
#
Phylo.API._getrootheight
— Method.
_getrootheight(::AbstractTree)
#
Phylo.API._hasbranch
— Function.
_hasbranch(tree::AbstractTree, branchname)
Must be implemented for any AbstractTree subtype.
#
Phylo.API._hasheight
— Method.
_hasheight(tree::AbstractTree, nodename)
#
Phylo.API._hasinbound
— Function.
_hasinbound(node::AbstractNode)
Must be implemented for any AbstractNode subtype.
#
Phylo.API._hasinboundspace
— Method.
_hasinboundspace(node::AbstractNode)
#
Phylo.API._hasnode
— Function.
_hasnode(tree::AbstractTree, nodename)
Must be implemented for any AbstractTree subtype.
#
Phylo.API._hasoutboundspace
— Function.
_hasoutboundspace(node::AbstractNode)
#
Phylo.API._hasrootheight
— Method.
_hasrootheight(::AbstractTree)
#
Phylo.API._indegree
— Method.
_indegree(node::AbstractNode)
#
Phylo.API._isinternal
— Method.
_isinternal(node::AbstractNode)
#
Phylo.API._isleaf
— Method.
_isleaf(node::AbstractNode)
#
Phylo.API._isroot
— Method.
_isroot(node::AbstractNode)
#
Phylo.API._isunattached
— Method.
_isunattached(node::AbstractNode)
#
Phylo.API._newbranchlabel
— Function.
_newbranchlabel(tree::AbstractTree)
#
Phylo.API._newnodelabel
— Function.
_newnodelabel(tree::AbstractTree)
#
Phylo.API._nodetype
— Function.
_nodetype(::AbstractTree)
Returns type of nodes in a tree.
#
Phylo.API._outdegree
— Function.
_outdegree(node::AbstractNode)
Must be implemented for any AbstractNode subtype.
#
Phylo.API._setdst!
— Function.
_setdst!
Set destination node for a graph. Must be implemented for any AbstractBranch subtype.
#
Phylo.API._setheight!
— Method.
_setheight!(::AbstractTree, nodename, value)
#
Phylo.API._setinbound!
— Function.
_setinbound!(node::AbstractNode, inbound)
Must be implemented for any AbstractNode subtype.
#
Phylo.API._setrootheight!
— Method.
_setrootheight!(::AbstractTree, value)
#
Phylo.API._setsrc!
— Function.
_setsrc!
Set source node for a branch. Must be implemented for any AbstractBranch subtype.
#
Phylo.API._src
— Function.
_src
Return source node for a branch. Must be implemented for any AbstractBranch subtype.
#
Phylo.API._validate
— Method.
_validate(::AbstractTree)
Phylo
Phylo.API
Phylo.BinaryNode
Phylo.BinaryTree
Phylo.Branch
Phylo.NamedTree
Phylo.Nonultrametric
Phylo.Ultrametric
Phylo.API._addbranch!
Phylo.API._addnode!
Phylo.API._addnodes!
Phylo.API._addoutbound!
Phylo.API._branch!
Phylo.API._branchtype
Phylo.API._deletebranch!
Phylo.API._deletenode!
Phylo.API._deleteoutbound!
Phylo.API._dst
Phylo.API._getbranch
Phylo.API._getbranches
Phylo.API._getbranchnames
Phylo.API._getheight
Phylo.API._getinbound
Phylo.API._getlength
Phylo.API._getnode
Phylo.API._getnodenames
Phylo.API._getnodes
Phylo.API._getoutbounds
Phylo.API._getrootheight
Phylo.API._hasbranch
Phylo.API._hasheight
Phylo.API._hasinbound
Phylo.API._hasinboundspace
Phylo.API._hasnode
Phylo.API._hasoutboundspace
Phylo.API._hasrootheight
Phylo.API._indegree
Phylo.API._isinternal
Phylo.API._isleaf
Phylo.API._isroot
Phylo.API._isunattached
Phylo.API._newbranchlabel
Phylo.API._newnodelabel
Phylo.API._nodetype
Phylo.API._outdegree
Phylo.API._setdst!
Phylo.API._setheight!
Phylo.API._setinbound!
Phylo.API._setrootheight!
Phylo.API._setsrc!
Phylo.API._src
Phylo.API._validate
Phylo.addbranch!
Phylo.addnode!
Phylo.addnodes!
Phylo.branch!
Phylo.branchfilter
Phylo.branchhistory
Phylo.branchiter
Phylo.branchnamefilter
Phylo.branchnameiter
Phylo.branchnametype
Phylo.branchroute
Phylo.branchtype
Phylo.changedst!
Phylo.changesrc!
Phylo.clearrootheight!
Phylo.deletebranch!
Phylo.deletenode!
Phylo.distance
Phylo.distances
Phylo.dst
Phylo.getancestors
Phylo.getbranch
Phylo.getbranchnames
Phylo.getchildren
Phylo.getdescendants
Phylo.getheight
Phylo.getinbound
Phylo.getleafinfo
Phylo.getleafnames
Phylo.getlength
Phylo.getnode
Phylo.getnodenames
Phylo.getnoderecord
Phylo.getoutbounds
Phylo.getparent
Phylo.getrootheight
Phylo.hasbranch
Phylo.hasheight
Phylo.hasinbound
Phylo.hasinboundspace
Phylo.hasnode
Phylo.hasoutboundspace
Phylo.hasrootheight
Phylo.heightstoroot
Phylo.heighttoroot
Phylo.indegree
Phylo.isinternal
Phylo.isleaf
Phylo.isroot
Phylo.isunattached
Phylo.nodefilter
Phylo.nodehistory
Phylo.nodeiter
Phylo.nodenamefilter
Phylo.nodenameiter
Phylo.nodenametype
Phylo.noderoute
Phylo.nodetype
Phylo.outdegree
Phylo.setheight!
Phylo.setleafinfo!
Phylo.setnoderecord!
Phylo.setrootheight!
Phylo.src
Phylo.validate