Class: Bio::Tree::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/bio-alignment/tree.rb

Instance Method Summary collapse

Instance Method Details

#childrenObject



48
49
50
# File 'lib/bio-alignment/tree.rb', line 48

def children
  @tree.children(self)
end

#distance(other) ⇒ Object

Get the distance to another node (FIXME: write test)



57
58
59
# File 'lib/bio-alignment/tree.rb', line 57

def distance other
  @tree.distance(self,other)
end

#inject_tree(tree) ⇒ Object



40
41
42
# File 'lib/bio-alignment/tree.rb', line 40

def inject_tree tree
  @tree = tree
end

#leaf?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/bio-alignment/tree.rb', line 44

def leaf?
  children.size == 0
end

#parentObject



52
53
54
# File 'lib/bio-alignment/tree.rb', line 52

def parent
  @tree.parent(self)
end