Class | Bio::PhyloXML::Confidence |
In: |
lib/bio/db/phyloxml/phyloxml_elements.rb
|
Parent: | Object |
A general purpose confidence element. For example this can be used to express the bootstrap support value of a clade (in which case the ‘type’ attribute is ‘bootstrap’).
type | [RW] | String. The type of confidence measure, for example, bootstrap. |
value | [RW] | Float. The value of confidence measure. |
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 385 385: def initialize(type, value) 386: @type = type 387: @value = value.to_f 388: end
Converts elements to xml representation. Called by PhyloXML::Writer class.
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 391 391: def to_xml 392: if @type == nil 393: raise "Type is a required attribute for confidence." 394: else 395: confidence = LibXML::XML::Node.new('confidence', @value.to_s) 396: confidence["type"] = @type 397: return confidence 398: end 399: end