From: martinahansen Date: Wed, 30 May 2012 11:37:01 +0000 (+0000) Subject: added to_seq method to sff.rb X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1b969d23f52856a45f9e0b4ab52b64a32121f2b9;p=biopieces.git added to_seq method to sff.rb git-svn-id: http://biopieces.googlecode.com/svn/trunk@1832 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_ruby/lib/maasha/sff.rb b/code_ruby/lib/maasha/sff.rb index f4c3931..c5243ad 100644 --- a/code_ruby/lib/maasha/sff.rb +++ b/code_ruby/lib/maasha/sff.rb @@ -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