]> git.donarmstrong.com Git - biopieces.git/commitdiff
fixed bug in remove_mids
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 6 Sep 2011 08:19:10 +0000 (08:19 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 6 Sep 2011 08:19:10 +0000 (08:19 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1520 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/remove_mids
bp_test/out/remove_mids.out.4

index 39f575c688dc3fc80a80e39c5e37ea497565c3f0..74846c1fe4dcd56a67cc8604954e1737e2124fc5 100755 (executable)
@@ -213,8 +213,6 @@ pos        = options[:pos]
 mismatches = options[:mismatches]
 
 Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
-  aux_hash = {}
-
   input.each_record do |record|
     if record.has_key? :SEQ
       found_tag    = nil
@@ -230,12 +228,6 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
       end
 
       if mismatches > 0 and found_tag.nil?
-        if aux_hash.has_key? tag10
-          found_tag = tag10
-        elsif aux_hash.has_key? tag11
-          found_tag = tag11
-        end
-
         if found_tag.nil?
           gsmid_hash.each_pair do |mid, mid_name|
             hamming_dist = tag10.to_s.hamming_distance(mid.to_s)
@@ -243,8 +235,6 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
             if hamming_dist <= mismatches
               found_tag = mid
 
-              aux_hash[tag10] = mid_name
-
               break
             end
           end
@@ -257,8 +247,6 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
             if hamming_dist <= mismatches
               found_tag = mid
 
-              aux_hash[tag11] = mid_name
-
               break
             end
           end
index 319808ad99e498b51c670c0645e15791feb10be9..9dbc8fd7f623ecd26c8ca9b46ee97ec65a53b016 100644 (file)
@@ -28,11 +28,11 @@ MID_MISMATCHES: 2
 SEQ_NAME: test_RL12_2_mismatches_repeat
 SEQ: gtgactgact
 SEQ_LEN: 10
-MID: ACTCACCTCGT
-MID_NAME: 
+MID: ACTCGCGTCGT
+MID_NAME: RL12
 MID_POS: 4
 MID_LEN: 11
-MID_MISMATCHES: 0
+MID_MISMATCHES: 2
 ---
 SEQ_NAME: test_GS99_0_mismatches
 SEQ: gtagtagtagt
@@ -64,9 +64,9 @@ MID_MISMATCHES: 2
 SEQ_NAME: test_GS99_2_mismatches_repeat
 SEQ: gtagtagtagt
 SEQ_LEN: 11
-MID: CTGTTCAGAC
-MID_NAME: 
+MID: CTGTACATAC
+MID_NAME: MID99
 MID_POS: 4
 MID_LEN: 10
-MID_MISMATCHES: 0
+MID_MISMATCHES: 2
 ---