Class: Bio::PhyloXML::CladeRelation
- Defined in:
- lib/bio/db/phyloxml/phyloxml_elements.rb
Overview
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.
Instance Attribute Summary collapse
-
#confidence ⇒ Object
Confidence object.
-
#distance ⇒ Object
Float.
-
#id_ref_0 ⇒ Object
String.
-
#id_ref_1 ⇒ Object
String.
-
#type ⇒ Object
String.
Instance Method Summary collapse
-
#to_xml ⇒ Object
Converts elements to xml representation.
Instance Attribute Details
#confidence ⇒ Object
Confidence object
1021 1022 1023 |
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 1021 def confidence @confidence end |
#distance ⇒ Object
Float
1015 1016 1017 |
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 1015 def distance @distance end |
#id_ref_0 ⇒ Object
String. Id of the referenced parents of a clade.
1017 1018 1019 |
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 1017 def id_ref_0 @id_ref_0 end |
#id_ref_1 ⇒ Object
String. Id of the referenced parents of a clade.
1017 1018 1019 |
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 1017 def id_ref_1 @id_ref_1 end |
#type ⇒ Object
String
1019 1020 1021 |
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 1019 def type @type end |
Instance Method Details
#to_xml ⇒ Object
Converts elements to xml representation. Called by PhyloXML::Writer class.
1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 |
# 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 |