Class | Bio::Tree::Edge
In: | lib/bio/tree.rb
Parent: | Object

Edge object of each node. By default, the object doesn‘t contain any node information.

### Methods

distance= distance_string= inspect new nhx_parameters to_s

### Attributes

distance | [R] | evolutionary distance
distance_string | [R] | evolutionary distance represented as a string
log_likelihood | [RW] | log likelihood value (:L in NHX)
width | [RW] | width of the edge (<branch width="w"> of PhyloXML, or :W="w" in NHX)

### Public Class methods

new(distance = nil)

creates a new edge.

[Source]

        # File lib/bio/tree.rb, line 33
    33:       def initialize(distance = nil)
    34:         if distance.kind_of?(Numeric)
    35:           self.distance = distance
    36:         elsif distance
    37:           self.distance_string = distance
    38:         end
    39:       end

### Public Instance methods

distance=(num)

set evolutionary distance value

[Source]

        # File lib/bio/tree.rb, line 48
    48:       def distance=(num)
    49:         @distance = num
    50:         @distance_string = (num ? num.to_s : num)
    51:       end

distance_string=(str)

set evolutionary distance value from a string

[Source]

        # File lib/bio/tree.rb, line 54
    54:       def distance_string=(str)
    55:         if str.to_s.strip.empty?
    56:           @distance = nil
    57:           @distance_string = str
    58:         else
    59:           @distance = str.to_f
    60:           @distance_string = str
    61:         end
    62:       end

inspect()

visualization of this object

[Source]

        # File lib/bio/tree.rb, line 65
    65:       def inspect
    66:         "<Edge distance=#{@distance.inspect}>"
    67:       end

nhx_parameters()

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.

[Source]

        # File lib/bio/tree.rb, line 92
    92:       def nhx_parameters
    93:         @nhx_parameters ||= {}
    94:         @nhx_parameters
    95:       end

to_s()

string representation of this object

[Source]

        # File lib/bio/tree.rb, line 70
    70:       def to_s
    71:         @distance_string.to_s
    72:       end

[Validate]