Class: Bio::Tree::Node
Overview
Node object.
Instance Attribute Summary collapse
-
#bootstrap ⇒ Object
bootstrap value.
-
#bootstrap_string ⇒ Object
bootstrap value as a string.
-
#ec_number ⇒ Object
EC number (EC_number in PhyloXML, or :E in NHX).
-
#name ⇒ Object
name of the node.
-
#order_number ⇒ Object
the order of the node (lower value, high priority).
-
#scientific_name ⇒ Object
scientific name (scientific_name in PhyloXML, or :S in NHX).
-
#taxonomy_id ⇒ Object
taxonomy identifier (taxonomy_identifier in PhyloXML, or :T in NHX).
Instance Method Summary collapse
-
#events ⇒ Object
Phylogenetic events.
-
#initialize(name = nil) ⇒ Node
constructor
Creates a new node.
-
#inspect ⇒ Object
visualization of this object.
-
#nhx_parameters ⇒ Object
Other NHX parameters.
-
#to_s ⇒ Object
string representation of this object.
Constructor Details
#initialize(name = nil) ⇒ Node
Creates a new node.
140 141 142 |
# File 'lib/bio/tree.rb', line 140 def initialize(name = nil) @name = name if name end |
Instance Attribute Details
#bootstrap ⇒ Object
bootstrap value
148 149 150 |
# File 'lib/bio/tree.rb', line 148 def bootstrap @bootstrap end |
#bootstrap_string ⇒ Object
bootstrap value as a string
151 152 153 |
# File 'lib/bio/tree.rb', line 151 def bootstrap_string @bootstrap_string end |
#ec_number ⇒ Object
EC number (EC_number in PhyloXML, or :E in NHX)
207 208 209 |
# File 'lib/bio/tree.rb', line 207 def ec_number @ec_number end |
#order_number ⇒ Object
the order of the node (lower value, high priority)
191 192 193 |
# File 'lib/bio/tree.rb', line 191 def order_number @order_number end |
#scientific_name ⇒ Object
scientific name (scientific_name in PhyloXML, or :S in NHX)
210 211 212 |
# File 'lib/bio/tree.rb', line 210 def scientific_name @scientific_name end |
#taxonomy_id ⇒ Object
taxonomy identifier (taxonomy_identifier in PhyloXML, or :T in NHX)
213 214 215 |
# File 'lib/bio/tree.rb', line 213 def taxonomy_id @taxonomy_id end |
Instance Method Details
#events ⇒ Object
Phylogenetic events. Returns an Array of one (or more?) of the following symbols
:gene_duplication
:speciation
201 202 203 204 |
# File 'lib/bio/tree.rb', line 201 def events @events ||= [] @events end |
#inspect ⇒ Object
visualization of this object
173 174 175 176 177 178 179 180 181 182 |
# File 'lib/bio/tree.rb', line 173 def inspect if @name and !@name.empty? then str = "(Node:#{@name.inspect}" else str = sprintf('(Node:%x', (self.__id__ << 1) & 0xffffffff) end str += " bootstrap=#{@bootstrap.inspect}" if @bootstrap str += ")" str end |
#nhx_parameters ⇒ Object
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.
220 221 222 223 |
# File 'lib/bio/tree.rb', line 220 def nhx_parameters @nhx_parameters ||= {} @nhx_parameters end |
#to_s ⇒ Object
string representation of this object
185 186 187 |
# File 'lib/bio/tree.rb', line 185 def to_s @name.to_s end |