The names and/or counts of binary characters present, gained, and lost at the root of a clade.
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 1053 def absent_count=(str) @absent_count = str.to_i end
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 1041 def gained_count=(str) @gained_count = str.to_i end
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 1045 def lost_count=(str) @lost_count = str.to_i end
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 1049 def present_count=(str) @present_count = str.to_i end
Converts elements to xml representation. Called by PhyloXML::Writer class.
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 1065 def to_xml bc = LibXML::XML::Node.new('binary_characters') bc['type'] = @bc_type PhyloXML::Writer.generate_xml(bc, self, [ [:attr, 'gained_count'], [:attr, 'lost_count'], [:attr, 'present_count'], [:attr, 'absent_count']]) if not @gained.empty? gained_xml = LibXML::XML::Node.new('gained') PhyloXML::Writer.generate_xml(gained_xml, self, [[:simplearr, 'bc', @gained]]) bc << gained_xml end if not @lost.empty? lost_xml = LibXML::XML::Node.new('lost') PhyloXML::Writer.generate_xml(lost_xml, self, [[:simplearr, 'bc', @lost]]) bc << lost_xml end if not @present.empty? present_xml = LibXML::XML::Node.new('present') PhyloXML::Writer.generate_xml(present_xml, self, [[:simplearr, 'bc', @present]]) bc << present_xml end if not @absent.empty? absent_xml = LibXML::XML::Node.new('absent') PhyloXML::Writer.generate_xml(absent_xml, self, [[:simplearr, 'bc', @absent]]) bc << absent_xml end return bc end
Generated with the Darkfish Rdoc Generator 2.