class Bio::PhyloXML::Distribution

Description

The geographic distribution of the items of a clade (species, sequences), intended for phylogeographic applications.

Attributes

desc[RW]

String. Free text description of location.

points[RW]

Array of Point objects. Holds coordinates of the location.

polygons[RW]

Array of Polygon objects.

Public Class Methods

new() click to toggle source
    # File lib/bio-phyloxml/phyloxml_elements.rb
409 def initialize
410   @points = []
411   @polygons = []
412 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
416 def to_xml
417   distr = LibXML::XML::Node.new('distribution')
418   PhyloXML::Writer.generate_xml(distr, self, [
419       [:simple, 'desc', @desc],
420       [:objarr, 'point', 'points'],
421       [:objarr, 'polygon', 'polygons']])
422   return distr
423 end