class Bio::PhyloXML::Confidence
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').
Attributes
type[RW]
String. The type of confidence measure, for example, bootstrap.
value[RW]
Float. The value of confidence measure.
Public Class Methods
new(type, value)
click to toggle source
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 385 def initialize(type, value) @type = type @value = value.to_f end
Public Instance Methods
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 391 def to_xml if @type == nil raise "Type is a required attribute for confidence." else confidence = LibXML::XML::Node.new('confidence', @value.to_s) confidence["type"] = @type return confidence end end