module Bio::BioAlignment::Tree

The Tree module turns a tree into a traversable object, by wrapping BioRuby's basic tree objects. The Bio::Tree object can always be fetched using to_bioruby_tree.

Public Class Methods

init(tree, alignment) click to toggle source

Make all nodes in the Bio::Tree aware of the tree object, and the alignment, so get a more intuitive API

# File lib/bio-alignment/tree.rb, line 16
def Tree::init tree, alignment
  if tree.kind_of?(Bio::Tree)
    # walk all nodes and infect the tree info
    tree.each_node do | node |
      node.inject_tree(tree, alignment)
    end
    # tree.root.set_tree(tree)
  else
    raise "BioAlignment::Tree does not understand tree type "+tree.class.to_s
  end
  return tree
end

Public Instance Methods

root() click to toggle source
# File lib/bio-alignment/tree.rb, line 29
def root
  @tree.root
end