]> git.donarmstrong.com Git - biopieces.git/commitdiff
polishing find_adaptor
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 23 May 2011 16:04:28 +0000 (16:04 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 23 May 2011 16:04:28 +0000 (16:04 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1418 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/find_adaptor

index 15371bdd03045ffdbd64159264c24a6d0eebc2aa..9ada12c23757ef7e990130759c8d5e6c27460210 100755 (executable)
@@ -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)