]> git.donarmstrong.com Git - biopieces.git/commitdiff
added to_seq method to sff.rb
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 30 May 2012 11:37:01 +0000 (11:37 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 30 May 2012 11:37:01 +0000 (11:37 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1832 74ccb610-7750-0410-82ae-013aeee3265d

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