Class | Bio::Tree::Node
In: | lib/bio/tree.rb
Parent: | Object

Node object.

### Methods

bootstrap= bootstrap_string= events inspect new nhx_parameters to_s

### Attributes

bootstrap | [R] | bootstrap value
bootstrap_string | [R] | bootstrap value as a string
ec_number | [RW] | EC number (EC_number in PhyloXML, or :E in NHX)
name | [RW] | name of the node
order_number | [RW] | the order of the node (lower value, high priority)
scientific_name | [RW] | scientific name (scientific_name in PhyloXML, or :S in NHX)
taxonomy_id | [RW] | taxonomy identifier (taxonomy_identifier in PhyloXML, or :T in NHX)

### Public Class methods

new(name = nil)

Creates a new node.

[Source]

         # File lib/bio/tree.rb, line 140
    140:       def initialize(name = nil)
    141:         @name = name if name
    142:       end

### Public Instance methods

bootstrap=(num)

sets a bootstrap value

[Source]

         # File lib/bio/tree.rb, line 154
    154:       def bootstrap=(num)
    155:         @bootstrap_string = (num ? num.to_s : num)
    156:         @bootstrap = num
    157:       end

bootstrap_string=(str)

sets a bootstrap value from a string

[Source]

         # File lib/bio/tree.rb, line 160
    160:       def bootstrap_string=(str)
    161:         if str.to_s.strip.empty?
    162:           @bootstrap = nil
    163:           @bootstrap_string = str
    164:         else
    165:           i = str.to_i
    166:           f = str.to_f
    167:           @bootstrap = (i == f ? i : f)
    168:           @bootstrap_string = str
    169:         end
    170:       end

events()

Phylogenetic events. Returns an Array of one (or more?) of the following symbols

      :gene_duplication
      :speciation

[Source]

         # File lib/bio/tree.rb, line 203
    203:       def events
    204:         @events ||= []
    205:         @events
    206:       end

inspect()

visualization of this object

[Source]

         # File lib/bio/tree.rb, line 173
    173:       def inspect
    174:         if @name and !@name.empty? then
    175:           str = "(Node:#{@name.inspect}"
    176:         else
    177:           str = sprintf('(Node:%x', (self.__id__ << 1) & 0xffffffff)
    178:         end
    179:         if defined?(@bootstrap) and @bootstrap then
    180:           str += " bootstrap=#{@bootstrap.inspect}"
    181:         end
    182:         str += ")"
    183:         str
    184:       end

nhx_parameters()

Other NHX parameters. Returns a Hash. Note that :D, :E, :S, and :T are not stored here but stored in the proper attributes in this class. However, if you force to set these parameters in this hash, the parameters in this hash are preferred when generating NHX.

[Source]

         # File lib/bio/tree.rb, line 222
    222:       def nhx_parameters
    223:         @nhx_parameters ||= {}
    224:         @nhx_parameters
    225:       end

to_s()

string representation of this object

[Source]

         # File lib/bio/tree.rb, line 187
    187:       def to_s
    188:         @name.to_s
    189:       end

[Validate]