class Bio::Tree::Node
Node object.
Attributes
bootstrap value
bootstrap value as a string
EC number (EC_number in PhyloXML, or :E in NHX)
name of the node
the order of the node (lower value, high priority)
scientific name (scientific_name in PhyloXML, or :S in NHX)
taxonomy identifier (taxonomy_identifier in PhyloXML, or :T in NHX)
Public Class Methods
Creates a new node.
# File lib/bio/tree.rb, line 139 def initialize(name = nil) @name = name if name end
Public Instance Methods
sets a bootstrap value
# File lib/bio/tree.rb, line 153 def bootstrap=(num) @bootstrap_string = (num ? num.to_s : num) @bootstrap = num end
sets a bootstrap value from a string
# File lib/bio/tree.rb, line 159 def bootstrap_string=(str) if str.to_s.strip.empty? @bootstrap = nil @bootstrap_string = str else i = str.to_i f = str.to_f @bootstrap = (i == f ? i : f) @bootstrap_string = str end end
Phylogenetic events. Returns an Array of one (or more?) of the following symbols
:gene_duplication :speciation
# File lib/bio/tree.rb, line 202 def events @events ||= [] @events end
visualization of this object
# File lib/bio/tree.rb, line 172 def inspect if @name and !@name.empty? then str = "(Node:#{@name.inspect}" else str = sprintf('(Node:%x', (self.__id__ << 1) & 0xffffffff) end if defined?(@bootstrap) and @bootstrap then str += " bootstrap=#{@bootstrap.inspect}" end str += ")" str 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.
# File lib/bio/tree.rb, line 221 def nhx_parameters @nhx_parameters ||= {} @nhx_parameters end
string representation of this object
# File lib/bio/tree.rb, line 186 def to_s @name.to_s end