require 'seq'
casts = []
-casts << {:long=>'right', :short=>'r', :type=>'string', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
-casts << {:long=>'left', :short=>'l', :type=>'string', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'right_adaptor', :short=>'r', :type=>'string', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'left_adaptor', :short=>'l', :type=>'string', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'right_hamming_dist', :short=>'R', :type=>'uint', :mandatory=>false, :default=>25, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'left_hamming_dist', :short=>'L', :type=>'uint', :mandatory=>false, :default=>25, :allowed=>nil, :disallowed=>nil}
bp = Biopieces.new
if record.has_key? :SEQ
entry = Seq.new(record[:SEQ_NAME], record[:SEQ], record[:TYPE], record[:SCORES])
- if options[:right]
- pos_right = entry.adaptor_locate_right(options[:right])
+ if options[:right_adaptor]
+ pos_right = entry.adaptor_locate_right(options[:right_adaptor], options[:right_hamming_dist])
entry.subseq!(0, pos_right) if pos_right >= 0
record[:CLIP_ADAPTOR_RIGHT] = pos_right
else
record[:CLIP_ADAPTOR_RIGHT] = -1
end
- if options[:left]
- pos_left = entry.adaptor_locate_left(options[:left])
+ if options[:left_adaptor]
+ pos_left = entry.adaptor_locate_left(options[:left_adaptor], options[:left_hamming_dist])
entry.subseq!(pos_left + 1) if pos_left >= 0
record[:CLIP_ADAPTOR_LEFT] = pos_left
else