]> git.donarmstrong.com Git - biopieces.git/commitdiff
did something to findsim.rb
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 16 Aug 2012 11:19:00 +0000 (11:19 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 16 Aug 2012 11:19:00 +0000 (11:19 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1898 74ccb610-7750-0410-82ae-013aeee3265d

code_ruby/lib/maasha/findsim.rb

index 7e5d100f4c4f03b78d6c6d987b2b6103785ba7a1..360bd9cf495bbe7c1c010a2f4bfed4e5541e8ebd 100644 (file)
@@ -149,6 +149,8 @@ class FindSim
         max = hit_ary_size
       end
 
+      best_score = 0
+
       (0 ... max).each do |i|
         q_index, s_index, score = hit_ary[BYTES_IN_HIT * i ... BYTES_IN_HIT * i + BYTES_IN_HIT].unpack("IIF")
 
@@ -160,11 +162,10 @@ class FindSim
           score     = new_score if new_score > score
         end
 
-        best_score = 0
-
         if @opt_hash[:max_diversity]
           best_score = score if i == 0
-          break if best_score - score > @opt_hash[:max_diversity]
+
+          break if best_score - score > (@opt_hash[:max_diversity] / 100)
         end
 
         yield Hit.new(q_id, s_id, score)