]> git.donarmstrong.com Git - biopieces.git/commitdiff
fixed bug in clip_adaptor where LEFT_POS > RIGHT_POS
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 4 Sep 2012 12:04:21 +0000 (12:04 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 4 Sep 2012 12:04:21 +0000 (12:04 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1910 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/clip_adaptor

index 0589b27d0c109bf551d8ff4db07e42192ec3ee99..1e722b28ba8f64c322006e566d61c00681bb70b9 100755 (executable)
@@ -46,7 +46,9 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
       end
 
       if record[:ADAPTOR_POS_LEFT]
-        entry.subseq!(record[:ADAPTOR_POS_LEFT].to_i + record[:ADAPTOR_LEN_LEFT].to_i)
+        if record[:ADAPTOR_POS_LEFT].to_i + record[:ADAPTOR_LEN_LEFT].to_i < entry.length
+          entry.subseq!(record[:ADAPTOR_POS_LEFT].to_i + record[:ADAPTOR_LEN_LEFT].to_i)
+        end
       end
 
       record.merge! entry.to_bp