Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
input.each do |record|
- if record.has_key? :SEQ
+ if record[:SEQ]
forward = false
reverse = false
seq = Seq.new_bp(record)
- seq.patscan(options[:forward].to_s, 0, options[:mismatches], options[:insertions], options[:deletions]) do |match|
+ seq.patscan(options[:forward].to_s,
+ max_mismatches: options[:mismatches],
+ max_insertions: options[:insertions],
+ max_deletions: options[:deletions]) do |match|
record[:FORWARD_POS] = match.pos
record[:FORWARD_LEN] = match.length
pos = match.pos + match.length
break
end
- seq.patscan(options[:reverse].to_s, 0, options[:mismatches], options[:insertions], options[:deletions]) do |match|
+ seq.patscan(options[:reverse].to_s,
+ max_mismatches: options[:mismatches],
+ max_insertions: options[:insertions],
+ max_deletions: options[:deletions]) do |match|
record[:REVERSE_POS] = match.pos
record[:REVERSE_LEN] = match.length
pos = 0