Primary Phylogenetic Data Objects¶
Phylogenetic data in DendroPy is represented by one or more objects of the following classes:
TaxonA representation of an operational taxonomic unit, with an attribute,
label, corresponding to the taxon label.TaxonNamespaceA collection of
Taxonobjects representing a distinct definition of taxa (for example, as specified explicitly in a NEXUS “TAXA” block, or implicitly in the set of all taxon labels used across a Newick tree file).TreeA collection of
NodeandEdgeobjects representing a phylogenetic tree. EachTreeobject maintains a reference to aTaxonNamespaceobject in its attribute,taxon_namespace, which specifies the set of taxa that are referenced by the tree and its nodes. EachNodeobject has ataxonattribute (which points to a particularTaxonobject if there is an operational taxonomic unit associated with this node, or isNoneif not), aparent_nodeattribute (which will beNoneif theNodehas no parent, e.g., a root node), aEdgeattribute, as well as a list of references to child nodes, a copy of which can be obtained by callingchild_nodes. In addition, advanced operations with tree data often make use of aBipartitionobject associated with eachEdgeon aTree(see “Bipartitions” for more information).TreeListA
listofTreeobjects. ATreeListobject has an attribute,taxon_namespace, which specifies the set of taxa that are referenced by all memberTreeelements. This is enforced when aTreeobject is added to aTreeList, with theTaxonNamespaceof theTreeobject and allTaxonreferences of theNodeobjects in theTreemapped to theTaxonNamespaceof theTreeList.CharacterMatrixRepresentation of character data, with specializations for different data types:
DnaCharacterMatrix,RnaCharacterMatrix,ProteinCharacterMatrix,StandardCharacterMatrix,ContinuousCharacterMatrix, etc. ACharacterMatrixcan treated very much like adictobject, withTaxonobjects as keys and character data as values associated with those keys.DataSetA meta-collection of phylogenetic data, consisting of lists of multiple
TaxonNamespaceobjects (DataSet.taxon_namespaces),TreeListobjects (DataSet.tree_lists), andCharacterMatrixobjects (DataSet.char_matrices).TreeArrayA high-performance container designed to efficiently store and manage (potentially) large collections of structures of (potentially) large trees for processing.


