strand = '-'
end
- results[id.to_i] << Match.new(start, stop, strand, entry.seq)
+ results[id.to_i] << Match.new(start, stop, strand, pattern, entry.seq)
else
raise "Failed to parse seq_name: #{entry.seq_name} in patscan result"
end
# Subclass to define Patscan hits.
class Match
- attr_reader :start, :stop, :strand, :match
+ attr_reader :start, :stop, :strand, :pattern, :match
- def initialize(start, stop, strand, match)
+ def initialize(start, stop, strand, pattern, match)
@start = start
@stop = stop
@strand = strand
+ @pattern = pattern
@match = match
end
if options[:inline]
if results[key]
results[key].each do |result|
- record[:PATTERN] = options[:pattern]
+ record[:PATTERN] = result.pattern
record[:MATCH] = result.match
record[:S_BEG] = result.start
record[:S_END] = result.stop
results[key].each do |result|
new_record[:REC_TYPE] = "PATSCAN"
new_record[:S_ID] = record[:SEQ_NAME]
- new_record[:Q_ID] = options[:pattern]
+ new_record[:Q_ID] = result.pattern
new_record[:MATCH] = result.match
new_record[:S_BEG] = result.start
new_record[:S_END] = result.stop