Class Bio::PhyloXML::CladeRelation
In: lib/bio/db/phyloxml/phyloxml_elements.rb
Parent: Object

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.

Methods

distance=   to_xml  

Attributes

confidence  [RW]  Confidence object
distance  [RW]  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]  String

Public Instance methods

[Source]

      # File lib/bio/db/phyloxml/phyloxml_elements.rb, line 1010
1010:       def distance=(str)
1011:         @distance = str.to_f
1012:       end

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

[Source]

      # File lib/bio/db/phyloxml/phyloxml_elements.rb, line 1015
1015:       def to_xml
1016:         if @id_ref_0 == nil or @id_ref_1 == nil or @type == nil
1017:           raise "Attributes id_ref_0, id_ref_1, type are required elements by SequenceRelation element."
1018:         else
1019:           cr = LibXML::XML::Node.new('clade_relation')
1020:           Writer.generate_xml(cr, self, [
1021:               [:attr, 'id_ref_0'],
1022:               [:attr, 'id_ref_1'],
1023:               [:attr, 'distance'],
1024:               [:attr, 'type'],
1025:               [:complex, 'confidence', @confidnece]])         
1026: 
1027:           return cr
1028:         end
1029:       end

[Validate]