class Bio::PhyloXML::CladeRelation

Description

This is used to express a typed relationship between two clades. For example it could be used to describe multiple parents of a clade.

Attributes

confidence[RW]

Confidence object

distance[R]

Float

id_ref_0[RW]

String. Id of the referenced parents of a clade.

id_ref_1[RW]

String. Id of the referenced parents of a clade.

type[RW]

Public Instance Methods

distance=(str) click to toggle source

Float

# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 1024
def distance=(str)
  @distance = str.to_f
end
to_xml() click to toggle source

Converts elements to xml representation. Called by PhyloXML::Writer class.

# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 1029
def to_xml
  if @id_ref_0 == nil or @id_ref_1 == nil or @type == nil
    raise "Attributes id_ref_0, id_ref_1, type are required elements by SequenceRelation element."
  else
    cr = LibXML::XML::Node.new('clade_relation')
    Writer.generate_xml(cr, self, [
        [:attr, 'id_ref_0'],
        [:attr, 'id_ref_1'],
        [:attr, 'distance'],
        [:attr, 'type'],
        [:complex, 'confidence', (defined? @confidnece) ? @confidnece : nil]])

    return cr
  end
end