]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_ruby/lib/maasha/sff.rb
added to_seq method to sff.rb
[biopieces.git] / code_ruby / lib / maasha / sff.rb
index f4c39313c5d45d45db88279e19b6cbf822ffd8f8..c5243adb3c82ef02eae5e587111d4d9bf5920426 100644 (file)
@@ -23,6 +23,7 @@
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 require 'maasha/base36'
+require 'maasha/seq'
 
 # Error class for all exceptions to do with SFF.
 class SFFError < StandardError; end
@@ -212,6 +213,11 @@ class Read
     hash
   end
 
+  # Method that converts a Read object's data to a Seq object.
+  def to_seq
+    Seq.new(self.name, self.bases, nil, self.quality_scores.map { |i| (i += 64).chr }.join "")
+  end
+
   # Method that soft masks the sequence (i.e. lowercases sequence) according to
   # clip_qual_left and clip_qual_right information.
   def mask