Method: Bio::Tree#concat
- Defined in:
- lib/bio/tree.rb
#concat(other) ⇒ Object
Concatenates the other tree. If the same edge exists, the edge in other is used. Returns self. The result is unspecified if other isn’t a Tree object. Note that the Node and Edge objects in the other tree are shared in the concatinated tree.
595 596 597 598 599 600 601 602 603 604 605 |
# File 'lib/bio/tree.rb', line 595 def concat(other) #raise TypeError unless other.kind_of?(self.class) _clear_cache other.each_node do |node| self.add_node(node) end other.each_edge do |node1, node2, edge| self.add_edge(node1, node2, edge) end self end |