Module: Bio::BioAlignment::Tree

Defined in:
lib/bio-alignment/tree.rb

Overview

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.

Defined Under Namespace

Classes: Node

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.init(tree, alignment) ⇒ Object

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



16
17
18
19
20
21
22
23
24
25
26
27
# 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

Instance Method Details

#rootObject



29
30
31
# File 'lib/bio-alignment/tree.rb', line 29

def root
  @tree.root
end