]> git.donarmstrong.com Git - biopieces.git/commitdiff
fixed nasty bug in classify_taxonomy
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 22 Oct 2012 13:07:55 +0000 (13:07 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 22 Oct 2012 13:07:55 +0000 (13:07 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1969 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/classify_taxonomy

index 7a9eae49f0c4b48a4de42534aa77be75b465e2c9..958ecb94be360c0ca9c8d363db7968b4b4057775 100755 (executable)
@@ -68,13 +68,13 @@ class TaxNode
   def merge(node_new, node_old = self)
     node_new.children.each do |name, child|
       if node_old.children[name]
-        node_old.count += node_new.count
-        node_old.score += node_new.score
+        node_old.count += child.count
+        node_old.score += child.score
+
+        merge(child, node_old.children[name])
       else
         node_old.children[name] = child
       end
-
-      merge(child, node_old.children[name])
     end
   end