From 39422dfc6100f9955c6263a0a8eb5f62a665ea4f Mon Sep 17 00:00:00 2001 From: martinahansen Date: Tue, 6 Sep 2011 08:19:10 +0000 Subject: [PATCH] fixed bug in remove_mids git-svn-id: http://biopieces.googlecode.com/svn/trunk@1520 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/remove_mids | 12 ------------ bp_test/out/remove_mids.out.4 | 12 ++++++------ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/bp_bin/remove_mids b/bp_bin/remove_mids index 39f575c..74846c1 100755 --- a/bp_bin/remove_mids +++ b/bp_bin/remove_mids @@ -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 diff --git a/bp_test/out/remove_mids.out.4 b/bp_test/out/remove_mids.out.4 index 319808a..9dbc8fd 100644 --- a/bp_test/out/remove_mids.out.4 +++ b/bp_test/out/remove_mids.out.4 @@ -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 --- -- 2.39.5