class Bio::PhyloXML::Events
Description¶ ↑
Events
at the root node of a clade (e.g. one gene duplication).
Attributes
confidence[R]
Confidence
object
duplications[R]
Integer
losses[R]
Integer
speciations[R]
Integer
type[R]
value comes from list: transfer, fusion, speciation_or_duplication, other, mixed, unassigned
Public Instance Methods
confidence=(conf)
click to toggle source
Confidence
object
# File lib/bio-phyloxml/phyloxml_elements.rb 328 def confidence=(conf) 329 @confidence = conf 330 end
duplications=(str)
click to toggle source
Integer
# File lib/bio-phyloxml/phyloxml_elements.rb 333 def duplications=(str) 334 @duplications = str.to_i 335 end
losses=(str)
click to toggle source
Integer
# File lib/bio-phyloxml/phyloxml_elements.rb 338 def losses=(str) 339 @losses = str.to_i 340 end
speciations=(str)
click to toggle source
Integer
# File lib/bio-phyloxml/phyloxml_elements.rb 343 def speciations=(str) 344 @speciations=str.to_i 345 end
to_xml()
click to toggle source
Converts elements to xml representation. Called by PhyloXML::Writer
class.
# File lib/bio-phyloxml/phyloxml_elements.rb 357 def to_xml 358 #@todo add unit test 359 events = LibXML::XML::Node.new('events') 360 PhyloXML::Writer.generate_xml(events, self, [ 361 [:simple, 'type', (defined? @type) ? @type : nil], 362 [:simple, 'duplications', (defined? @duplications) ? @duplications : nil], 363 [:simple, 'speciations', (defined? @speciations) ? @speciations : nil], 364 [:simple, 'losses', (defined? @losses) ? @losses : nil], 365 [:complex, 'confidence', (defined? @confidence) ? @confidence : nil]]) 366 return events 367 end
type=(str)
click to toggle source
value comes from list: transfer, fusion, speciation_or_duplication, other, mixed, unassigned
# File lib/bio-phyloxml/phyloxml_elements.rb 348 def type=(str) 349 @type = str 350 #@todo add unit test for this 351 if not ['transfer','fusion','speciation_or_duplication','other','mixed', 'unassigned'].include?(str) 352 raise "Warning #{str} is not one of the allowed values" 353 end 354 end