From 2c5b65bbb1d934446296299159ac44281ac27bcf Mon Sep 17 00:00:00 2001 From: martinahansen Date: Tue, 4 Sep 2012 12:04:21 +0000 Subject: [PATCH] fixed bug in clip_adaptor where LEFT_POS > RIGHT_POS git-svn-id: http://biopieces.googlecode.com/svn/trunk@1910 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/clip_adaptor | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bp_bin/clip_adaptor b/bp_bin/clip_adaptor index 0589b27..1e722b2 100755 --- a/bp_bin/clip_adaptor +++ b/bp_bin/clip_adaptor @@ -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 -- 2.39.5