Class: Bio::PhyloXML::Events

Inherits:
Object
  • Object
show all
Defined in:
lib/bio/phyloxml/elements.rb

Overview

Description

Events at the root node of a clade (e.g. one gene duplication).

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#confidenceObject

Confidence object



323
324
325
# File 'lib/bio/phyloxml/elements.rb', line 323

def confidence
  @confidence
end

#duplicationsObject

Integer



320
321
322
# File 'lib/bio/phyloxml/elements.rb', line 320

def duplications
  @duplications
end

#lossesObject

Integer



320
321
322
# File 'lib/bio/phyloxml/elements.rb', line 320

def losses
  @losses
end

#speciationsObject

Integer



320
321
322
# File 'lib/bio/phyloxml/elements.rb', line 320

def speciations
  @speciations
end

#typeObject

value comes from list: transfer, fusion, speciation_or_duplication, other, mixed, unassigned



317
318
319
# File 'lib/bio/phyloxml/elements.rb', line 317

def type
  @type
end

Instance Method Details

#to_xmlObject

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



354
355
356
357
358
359
360
361
362
363
364
# File 'lib/bio/phyloxml/elements.rb', line 354

def to_xml
  #@todo add unit test
  events = LibXML::XML::Node.new('events')
  PhyloXML::Writer.generate_xml(events, self, [
    [:simple, 'type', @type],
    [:simple, 'duplications', @duplications],
    [:simple, 'speciations', @speciations],
    [:simple, 'losses', @losses],
    [:complex, 'confidence', @confidence]])
  return events
end