]> git.donarmstrong.com Git - biopieces.git/commitdiff
added to_bp method to findsim.rb
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 18 Apr 2012 08:07:05 +0000 (08:07 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 18 Apr 2012 08:07:05 +0000 (08:07 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1798 74ccb610-7750-0410-82ae-013aeee3265d

code_ruby/lib/maasha/findsim.rb

index cd07b8e4c3fa45ed5f8bd9233627df1e21221f2f..6c794e3696c4ec08d298a317ef699b453a37b918 100644 (file)
@@ -580,6 +580,17 @@ class FindSim
     def to_s
       "#{@q_id}:#{@s_id}:#{@score.round(2)}"
     end
+
+    # Method to convert to a Biopiece record.
+    def to_bp
+      hash = {}
+      hash[:REC_TYPE] = "findsim"
+      hash[:Q_ID]     = @q_id
+      hash[:S_ID]     = @s_id
+      hash[:SCORE]    = @score.round(2)
+
+      hash
+    end
   end
 end