From 2a8f4b16e21e5e0b2d268775b035c5f0651e888d Mon Sep 17 00:00:00 2001 From: martinahansen Date: Mon, 17 Jun 2013 09:56:22 +0000 Subject: [PATCH] updated patscan_seq git-svn-id: http://biopieces.googlecode.com/svn/trunk@2179 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/patscan_seq | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bp_bin/patscan_seq b/bp_bin/patscan_seq index 64fc6dd..f408bd6 100755 --- a/bp_bin/patscan_seq +++ b/bp_bin/patscan_seq @@ -85,7 +85,7 @@ class Patscan 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 @@ -109,12 +109,13 @@ class Patscan # 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 @@ -196,7 +197,7 @@ Biopieces.open(tmp_file, options[:stream_out]) do |input, output| 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 @@ -216,7 +217,7 @@ Biopieces.open(tmp_file, options[:stream_out]) do |input, output| 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 -- 2.39.2