Method: Bio::Tree#output_nhx

Defined in:
lib/bio/tree/output.rb

#output_nhx(options = {}, &block) ⇒ Object

Returns a NHX (New Hampshire eXtended) formatted string. If block is given, the order of the node is sorted (as the same manner as Enumerable#sort).

Available options:

:indent

indent string; set false to disable (default: ‘ ’)



218
219
220
221
222
223
224
225
226
# File 'lib/bio/tree/output.rb', line 218

def output_nhx(options = {}, &block) #:yields: node1, node2
  root = @root
  root ||= self.nodes.first
  return '();' unless root
  __to_newick([], root, 0,
              :__to_newick_format_leaf_NHX, options, &block) +
    __to_newick_format_leaf_NHX(root, Edge.new, options) +
    ";\n"
end