Class: Bio::NeXML::IntTree

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

Overview

end class Tree

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) ⇒ IntTree

Returns a new instance of IntTree.



428
429
430
# File 'lib/bio/db/nexml/trees.rb', line 428

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

Instance Method Details

#add_edge(edge) ⇒ Object



432
433
434
435
# File 'lib/bio/db/nexml/trees.rb', line 432

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

#create_edge(options = {}) ⇒ Object



437
438
439
440
441
# File 'lib/bio/db/nexml/trees.rb', line 437

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

#create_rootedge(options = {}) ⇒ Object



443
444
445
446
447
# File 'lib/bio/db/nexml/trees.rb', line 443

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