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]
String
Public Instance Methods
distance=(str)
click to toggle source
Float
# File lib/bio-phyloxml/phyloxml_elements.rb 1013 def distance=(str) 1014 @distance = str.to_f 1015 end
to_xml()
click to toggle source
Converts elements to xml representation. Called by PhyloXML::Writer
class.
# File lib/bio-phyloxml/phyloxml_elements.rb 1018 def to_xml 1019 if @id_ref_0 == nil or @id_ref_1 == nil or @type == nil 1020 raise "Attributes id_ref_0, id_ref_1, type are required elements by SequenceRelation element." 1021 else 1022 cr = LibXML::XML::Node.new('clade_relation') 1023 Writer.generate_xml(cr, self, [ 1024 [:attr, 'id_ref_0'], 1025 [:attr, 'id_ref_1'], 1026 [:attr, 'distance'], 1027 [:attr, 'type'], 1028 [:complex, 'confidence', (defined? @confidnece) ? @confidnece : nil]]) 1029 1030 return cr 1031 end 1032 end