]> git.donarmstrong.com Git - biopieces.git/commitdiff
fixed seq qual length check
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 8 Oct 2013 08:46:04 +0000 (08:46 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 8 Oct 2013 08:46:04 +0000 (08:46 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@2228 74ccb610-7750-0410-82ae-013aeee3265d

code_ruby/lib/maasha/seq.rb

index a2d5bbac3462d44401d0e1d97a70101f1b7d3af4..b291803f94074bb64412aa064f3584e221ded2c8 100644 (file)
@@ -136,7 +136,7 @@ class Seq
     @type     = options[:type]
     @qual     = options[:qual]
 
-    if @qual and @seq.length != @qual.length
+    if @seq and @qual and @seq.length != @qual.length
       raise SeqError, "Sequence length and score length mismatch: #{@seq.length} != #{@qual.length}"
     end
   end
@@ -343,12 +343,14 @@ class Seq
 
   # Method to reverse the sequence.
   def reverse
-    Seq.new(
+    entry = Seq.new(
       seq_name: self.seq_name,
       seq:      self.seq.reverse,
       type:     self.type,
       qual:     (self.qual ? self.qual.reverse : self.qual)
     )
+
+    entry
   end
 
   # Method to reverse the sequence.