Class: Bio::NeXML::FloatTree

Inherits:
Tree
  • Object
show all
Defined in:
lib/bio/db/nexml/trees.rb

Instance Attribute Summary

Attributes inherited from Tree

#id, #label, #rootedge

Instance Method Summary collapse

Methods inherited from Tree

#<<, #[], #__add_edge__, #__add_node__, #add_node, #add_rootedge, #ancestors, #children, #create_node, #descendents, #each_node, #get_edge_by_id, #get_node_by_id, #has_edge?, #has_node?, #include?, #lowest_common_ancestor, #parent, #remove_edge, #remove_node, #roots, #to_xml

Methods included from Mapper

#properties

Constructor Details

#initialize(id = nil, options = {}, &block) ⇒ FloatTree

Returns a new instance of FloatTree.



452
453
454
# File 'lib/bio/db/nexml/trees.rb', line 452

def initialize( id = nil, options = {}, &block )
  super
end

Instance Method Details

#add_edge(edge) ⇒ Object



456
457
458
459
# File 'lib/bio/db/nexml/trees.rb', line 456

def add_edge( edge )
  edge.length = edge.length.to_f
  super
end

#create_edge(options = {}) ⇒ Object



461
462
463
464
465
# File 'lib/bio/db/nexml/trees.rb', line 461

def create_edge( options = {} )
  edge = FloatEdge.new( Bio::NeXML.generate_id( FloatEdge ), options )
  self << edge
  edge        
end

#create_rootedge(options = {}) ⇒ Object



467
468
469
470
471
# File 'lib/bio/db/nexml/trees.rb', line 467

def create_rootedge( options = {} )
  rootedge = FloatRootEdge.new( Bio::NeXML.generate_id( FloatRootEdge ), options )
  self << rootedge
  rootedge
end