


skbio.tree.TreeNode
===================







   
      
   

   
      
   

   

   

   
      
   

   

   
      
   

   

   
      
   

   
      
   

   
      
   

   
      
   

   

   

   
      
   

   
      
   

   
      
   

   
      
   

   
      
   

   

   

   

   

   

   

   
      
   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   








   
      
   





   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   

   
      
         
      
   





   
      
   

   
      
   

   
      
   

   
      
   

   
      
   

   
      
   

   
      
   

   
      
   

   
      
   

   
      
   

   
      
   

   
      
   

   
      
   

   
      
   





.. currentmodule:: skbio.tree

.. autoclass:: TreeNode




   
   
   .. rubric:: Attributes

   .. autosummary::
   
      ~TreeNode.default_write_format
   

   
   

   

   .. rubric:: Tree IO
      
   .. autosummary::
      :toctree:

      ~TreeNode.read
      ~TreeNode.write

   .. rubric:: Tree navigation

   .. autosummary::
      :toctree:

      ~TreeNode.ancestors
      ~TreeNode.has_children
      ~TreeNode.is_root
      ~TreeNode.is_tip
      ~TreeNode.lca
      ~TreeNode.neighbors
      ~TreeNode.path
      ~TreeNode.root
      ~TreeNode.siblings

   .. rubric:: Tree traversal

   .. autosummary::
      :toctree:

      ~TreeNode.levelorder
      ~TreeNode.non_tips
      ~TreeNode.postorder
      ~TreeNode.pre_and_postorder
      ~TreeNode.preorder
      ~TreeNode.tips
      ~TreeNode.traverse

   .. rubric:: Tree copying

   .. autosummary::
      :toctree:

      ~TreeNode.copy

   .. rubric:: Tree manipulation

   .. autosummary::
      :toctree:

      ~TreeNode.append
      ~TreeNode.bifurcate
      ~TreeNode.extend
      ~TreeNode.insert
      ~TreeNode.pop
      ~TreeNode.prune
      ~TreeNode.remove
      ~TreeNode.remove_by_func
      ~TreeNode.shear
      ~TreeNode.shuffle
      ~TreeNode.unpack
      ~TreeNode.unpack_by_func

   .. rubric:: Tree rerooting

   .. autosummary::
      :toctree:

      ~TreeNode.root_at
      ~TreeNode.root_at_midpoint
      ~TreeNode.root_by_outgroup
      ~TreeNode.unroot
      ~TreeNode.unrooted_copy
      ~TreeNode.unrooted_move

   .. rubric:: Tree searching

   .. autosummary::
      :toctree:

      ~TreeNode.assign_ids
      ~TreeNode.cache_attr
      ~TreeNode.clear_caches
      ~TreeNode.create_caches
      ~TreeNode.has_caches
      ~TreeNode.find
      ~TreeNode.find_all
      ~TreeNode.find_by_func
      ~TreeNode.find_by_id
      ~TreeNode.index_tree

   .. rubric:: Tree analysis

   .. autosummary::
      :toctree:

      ~TreeNode.bipart
      ~TreeNode.biparts
      ~TreeNode.cophenet
      ~TreeNode.count
      ~TreeNode.depth
      ~TreeNode.distance
      ~TreeNode.height
      ~TreeNode.is_bifurcating
      ~TreeNode.maxdist
      ~TreeNode.observed_node_counts
      ~TreeNode.subset
      ~TreeNode.subsets
      ~TreeNode.total_length

   .. rubric:: Tree comparison

   .. autosummary::
      :toctree:

      ~TreeNode.compare_biparts
      ~TreeNode.compare_cophenet
      ~TreeNode.compare_rfd
      ~TreeNode.compare_subsets
      ~TreeNode.compare_wrfd

   .. rubric:: Tree visualization

   .. autosummary::
      :toctree:

      ~TreeNode.ascii_art

   .. rubric:: Format conversion

   .. autosummary::
      :toctree:

      ~TreeNode.assign_supports
      ~TreeNode.from_linkage_matrix
      ~TreeNode.from_taxdump
      ~TreeNode.from_taxonomy
      ~TreeNode.to_array
      ~TreeNode.to_taxonomy

   

   
   
   .. rubric:: Special methods

   .. autosummary::
   
      ~TreeNode.__copy__
      ~TreeNode.__deepcopy__
      ~TreeNode.__getitem__
      ~TreeNode.__iter__
      ~TreeNode.__len__
      ~TreeNode.__str__
   

   
   .. rubric:: Special methods (inherited)

   .. autoinherit::
   
      ~TreeNode.__eq__
      ~TreeNode.__ge__
      ~TreeNode.__getstate__
      ~TreeNode.__gt__
      ~TreeNode.__hash__
      ~TreeNode.__le__
      ~TreeNode.__lt__
      ~TreeNode.__ne__
   
   




   
   .. rubric:: Details

   
   
   .. autoattribute:: TreeNode.default_write_format
   
   

   
   
   .. automethod:: TreeNode.__copy__
   
   
   
   .. automethod:: TreeNode.__deepcopy__
   
   
   
   .. automethod:: TreeNode.__getitem__
   
   
   
   .. automethod:: TreeNode.__iter__
   
   
   
   .. automethod:: TreeNode.__len__
   
   
   
   .. automethod:: TreeNode.__str__
   
   
   