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-phyloxml/phyloxml_elements.rb
380 def initialize(type, value)
381   @type = type
382   @value = value.to_f
383 end

Public Instance Methods

to_xml() click to toggle source

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

    # File lib/bio-phyloxml/phyloxml_elements.rb
386 def to_xml
387   if @type == nil
388     raise "Type is a required attribute for confidence."
389   else
390     confidence = LibXML::XML::Node.new('confidence', @value.to_s)
391     confidence["type"] = @type          
392     return confidence
393   end
394 end