]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/find_adaptor
added coverage to find_SNPs
[biopieces.git] / bp_bin / find_adaptor
index 5b2c96b76403428a3ae776d81cbbdda87587e046..4fd559dd281b45b06b372134e6215cc600ef55a2 100755 (executable)
@@ -88,10 +88,10 @@ end
 
 Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
   input.each do |record|
-    if record[:SEQ] and record[:SEQ].length > 0
+    if record[:SEQ]
       entry = Seq.new_bp(record)
 
-      if options[:forward]
+      if options[:forward] and record[:SEQ].length >= options[:forward].length
         if m = entry.patmatch(options[:forward], 0, fmis, fins, fdel)
           record[:ADAPTOR_POS_LEFT] = m.pos
           record[:ADAPTOR_LEN_LEFT] = m.length
@@ -106,8 +106,7 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
             fdel = percent2real(len, options[:deletions])
 
             pat = pat[1 ... pat.length]
-$stderr.puts pat
-$stderr.puts entry.seq[0 ... len]
+
             if m = entry.patmatch(pat, [0, len], fmis, fins, fdel)
               record[:ADAPTOR_POS_LEFT] = m.pos
               record[:ADAPTOR_LEN_LEFT] = m.length
@@ -121,7 +120,7 @@ $stderr.puts entry.seq[0 ... len]
         end
       end
 
-      if options[:reverse]
+      if options[:reverse] and record[:SEQ].length >= options[:reverse].length
         if m = entry.patmatch(options[:reverse], 0, rmis, rins, rdel)
           record[:ADAPTOR_POS_RIGHT] = m.pos
           record[:ADAPTOR_LEN_RIGHT] = m.length