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



21
22
23
24
25
26
27
# File 'lib/tree_clusters.rb', line 21

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

#unquoted_taxaObject



29
30
31
# File 'lib/tree_clusters.rb', line 29

def unquoted_taxa
  self.taxa.map { |str| str.tr %q{"'}, "" }
end