Class: NewickTree

Inherits:
Object
  • Object
show all
Defined in:
lib/tree_clusters.rb

Overview

Monkey patch of the NewickTree class

Instance Method Summary collapse

Instance Method Details

#clade_nodesArray<NewickNode>

Like NewickTree.clades but returns NewickNodes instead of taxa names.

Returns:

  • (Array<NewickNode>)

    array of NewickNodes representing the tree clades



18
19
20
21
22
23
24
# File 'lib/tree_clusters.rb', line 18

def clade_nodes
  clades = []
  @root.descendants.each do |clade|
    clades.push(clade) if (!clade.children.empty?)
  end
  return clades
end