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

Node object.

Methods

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

Creates a new node.

[Source]

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

Public Instance methods

sets a bootstrap value

[Source]

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

sets a bootstrap value from a string

[Source]

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

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

  :gene_duplication
  :speciation

[Source]

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

visualization of this object

[Source]

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

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 221
221:       def nhx_parameters
222:         @nhx_parameters ||= {}
223:         @nhx_parameters
224:       end

string representation of this object

[Source]

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

[Validate]