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.
33 34 35 36 37 38 39 |
# File 'lib/bio/tree.rb', line 33 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
42 43 44 |
# File 'lib/bio/tree.rb', line 42 def distance @distance end |
#distance_string ⇒ Object
evolutionary distance represented as a string
45 46 47 |
# File 'lib/bio/tree.rb', line 45 def distance_string @distance_string end |
#log_likelihood ⇒ Object
log likelihood value (:L in NHX)
79 80 81 |
# File 'lib/bio/tree.rb', line 79 def log_likelihood @log_likelihood end |
#width ⇒ Object
width of the edge (<branch width=“w”> of PhyloXML, or :W=“w” in NHX)
83 84 85 |
# File 'lib/bio/tree.rb', line 83 def width @width end |
Instance Method Details
#inspect ⇒ Object
visualization of this object
65 66 67 |
# File 'lib/bio/tree.rb', line 65 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.
92 93 94 95 |
# File 'lib/bio/tree.rb', line 92 def nhx_parameters @nhx_parameters ||= {} @nhx_parameters end |
#to_s ⇒ Object
string representation of this object
70 71 72 |
# File 'lib/bio/tree.rb', line 70 def to_s @distance_string.to_s end |