X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=code_ruby%2Flib%2Fmaasha%2Fseq.rb;h=b291803f94074bb64412aa064f3584e221ded2c8;hb=af282a65d141826c15944437b07a0353dd14e79c;hp=a2d5bbac3462d44401d0e1d97a70101f1b7d3af4;hpb=b75be26637f894573f1dbf5ebe31c5d651a4bb83;p=biopieces.git diff --git a/code_ruby/lib/maasha/seq.rb b/code_ruby/lib/maasha/seq.rb index a2d5bba..b291803 100644 --- a/code_ruby/lib/maasha/seq.rb +++ b/code_ruby/lib/maasha/seq.rb @@ -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.