X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Ffind_adaptor;h=f2f593d1ce90f11087b04ca9d2abc8a58a40b264;hb=f0f14eaee0bc9e0aa3ec9899293b1d27dd950972;hp=0534572bd4ff08669f934a57d1d1bfc9a64d9486;hpb=449502a619149d8b881cd0d1e7c2ba01b2ff88aa;p=biopieces.git diff --git a/bp_bin/find_adaptor b/bp_bin/find_adaptor index 0534572..f2f593d 100755 --- a/bp_bin/find_adaptor +++ b/bp_bin/find_adaptor @@ -53,11 +53,11 @@ casts << {:long=>'deletions', :short=>'d', :type=>'uint', :mandatory=>false, options = Biopieces.options_parse(ARGV, casts) if options[:forward_rc] - options[:forward] = Seq.new("test", options[:forward_rc], 'dna').revcomp.seq + options[:forward] = Seq.new("test", options[:forward_rc], :dna).reverse.complement.seq end if options[:reverse_rc] - options[:reverse] = Seq.new("test", options[:reverse_rc], 'dna').revcomp.seq + options[:reverse] = Seq.new("test", options[:reverse_rc], :dna).reverse.complement.seq end raise ArgumentError, "no adaptor specified" unless options[:forward] or options[:reverse] @@ -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 @@ -120,7 +120,7 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output| 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