Class: Bio::Tree::Edge
Overview
Edge object of each node. By default, the object doesn’t contain any node information.
Instance Attribute Summary collapse
-
#distance ⇒ Object
evolutionary distance.
-
#distance_string ⇒ Object
evolutionary distance represented as a string.
-
#log_likelihood ⇒ Object
log likelihood value (:L in NHX).
-
#width ⇒ Object
width of the edge (<branch width=“w”> of PhyloXML, or :W=“w” in NHX).
Instance Method Summary collapse
-
#initialize(distance = nil) ⇒ Edge
constructor
creates a new edge.
-
#inspect ⇒ Object
visualization of this object.
-
#nhx_parameters ⇒ Object
Other NHX parameters.
-
#to_s ⇒ Object
string representation of this object.
Constructor Details
#initialize(distance = nil) ⇒ Edge
creates a new edge.
32 33 34 35 36 37 38 |
# File 'lib/bio/tree.rb', line 32 def initialize(distance = nil) if distance.kind_of?(Numeric) self.distance = distance elsif distance self.distance_string = distance end end |
Instance Attribute Details
#distance ⇒ Object
evolutionary distance
41 42 43 |
# File 'lib/bio/tree.rb', line 41 def distance @distance end |
#distance_string ⇒ Object
evolutionary distance represented as a string
44 45 46 |
# File 'lib/bio/tree.rb', line 44 def distance_string @distance_string end |
#log_likelihood ⇒ Object
log likelihood value (:L in NHX)
78 79 80 |
# File 'lib/bio/tree.rb', line 78 def log_likelihood @log_likelihood end |
#width ⇒ Object
width of the edge (<branch width=“w”> of PhyloXML, or :W=“w” in NHX)
82 83 84 |
# File 'lib/bio/tree.rb', line 82 def width @width end |
Instance Method Details
#inspect ⇒ Object
visualization of this object
64 65 66 |
# File 'lib/bio/tree.rb', line 64 def inspect "<Edge distance=#{@distance.inspect}>" end |
#nhx_parameters ⇒ Object
Other NHX parameters. Returns a Hash. Note that :L and :W 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. In addition, If the same parameters are defined at Node object, the parameters in the node are preferred.
91 92 93 94 |
# File 'lib/bio/tree.rb', line 91 def nhx_parameters @nhx_parameters ||= {} @nhx_parameters end |
#to_s ⇒ Object
string representation of this object
69 70 71 |
# File 'lib/bio/tree.rb', line 69 def to_s @distance_string.to_s end |