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.
139 140 141 |
# File 'lib/bio/tree.rb', line 139 def initialize(name = nil) @name = name if name end |
Instance Attribute Details
#bootstrap ⇒ Object
bootstrap value
147 148 149 |
# File 'lib/bio/tree.rb', line 147 def bootstrap @bootstrap end |
#bootstrap_string ⇒ Object
bootstrap value as a string
150 151 152 |
# File 'lib/bio/tree.rb', line 150 def bootstrap_string @bootstrap_string end |
#ec_number ⇒ Object
EC number (EC_number in PhyloXML, or :E in NHX)
208 209 210 |
# File 'lib/bio/tree.rb', line 208 def ec_number @ec_number end |
#order_number ⇒ Object
the order of the node (lower value, high priority)
192 193 194 |
# File 'lib/bio/tree.rb', line 192 def order_number @order_number end |
#scientific_name ⇒ Object
scientific name (scientific_name in PhyloXML, or :S in NHX)
211 212 213 |
# File 'lib/bio/tree.rb', line 211 def scientific_name @scientific_name end |
#taxonomy_id ⇒ Object
taxonomy identifier (taxonomy_identifier in PhyloXML, or :T in NHX)
214 215 216 |
# File 'lib/bio/tree.rb', line 214 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
202 203 204 205 |
# File 'lib/bio/tree.rb', line 202 def events @events ||= [] @events end |
#inspect ⇒ Object
visualization of this object
172 173 174 175 176 177 178 179 180 181 182 183 |
# 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 |
#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.
221 222 223 224 |
# File 'lib/bio/tree.rb', line 221 def nhx_parameters @nhx_parameters ||= {} @nhx_parameters end |
#to_s ⇒ Object
string representation of this object
186 187 188 |
# File 'lib/bio/tree.rb', line 186 def to_s @name.to_s end |