From c505a0e687f2d53aa67a7450fea5c3d878a92885 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Mon, 23 May 2011 16:04:28 +0000 Subject: [PATCH] polishing find_adaptor git-svn-id: http://biopieces.googlecode.com/svn/trunk@1418 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/find_adaptor | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bp_bin/find_adaptor b/bp_bin/find_adaptor index 15371bd..9ada12c 100755 --- a/bp_bin/find_adaptor +++ b/bp_bin/find_adaptor @@ -87,7 +87,7 @@ class Pattern @options = options @patterns = [] @patterns << pattern_internal - @patterns += patterns_end if @options[:trim_end] + @patterns += patterns_end if @options[:partial] end def to_i @@ -124,9 +124,9 @@ class Pattern patterns = [] adaptor = @options[:adaptor] - raise PatternError, "trim_end_min > adaptor length: #{@options[:trim_end_min]} > #{adaptor.length - 1}" if @options[:trim_end_min] > adaptor.length - 1 + raise PatternError, "len > adaptor length: #{@options[:len]} > #{adaptor.length - 1}" if @options[:len] > adaptor.length - 1 - (adaptor.length - 1).downto(@options[:trim_end_min]) do |i| + (adaptor.length - 1).downto(@options[:len]) do |i| pattern = adaptor[0 ... i] mis = mis_count(pattern) ins = ins_count(pattern) @@ -151,12 +151,12 @@ class Pattern end casts = [] -casts << {:long=>'adaptor', :short=>'a', :type=>'string', :mandatory=>true, :default=>nil, :allowed=>nil, :disallowed=>nil} -casts << {:long=>'trim_end', :short=>'t', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil} -casts << {:long=>'trim_end_min', :short=>'l', :type=>'uint', :mandatory=>false, :default=>10, :allowed=>nil, :disallowed=>'0'} -casts << {:long=>'mismatches', :short=>'m', :type=>'uint', :mandatory=>false, :default=>10, :allowed=>nil, :disallowed=>nil} -casts << {:long=>'insertions', :short=>'i', :type=>'uint', :mandatory=>false, :default=>5, :allowed=>nil, :disallowed=>nil} -casts << {:long=>'deletions', :short=>'d', :type=>'uint', :mandatory=>false, :default=>5, :allowed=>nil, :disallowed=>nil} +casts << {:long=>'adaptor', :short=>'a', :type=>'string', :mandatory=>true, :default=>nil, :allowed=>nil, :disallowed=>nil} +casts << {:long=>'partial', :short=>'p', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil} +casts << {:long=>'len', :short=>'l', :type=>'uint', :mandatory=>false, :default=>10, :allowed=>nil, :disallowed=>'0'} +casts << {:long=>'mismatches', :short=>'m', :type=>'uint', :mandatory=>false, :default=>10, :allowed=>nil, :disallowed=>nil} +casts << {:long=>'insertions', :short=>'i', :type=>'uint', :mandatory=>false, :default=>5, :allowed=>nil, :disallowed=>nil} +casts << {:long=>'deletions', :short=>'d', :type=>'uint', :mandatory=>false, :default=>5, :allowed=>nil, :disallowed=>nil} options = Biopieces.options_parse(ARGV, casts) -- 2.39.5