]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_ruby/lib/maasha/seq.rb
fixed bug in seq.to_fasta
[biopieces.git] / code_ruby / lib / maasha / seq.rb
index b70cfc7f3047d15cc8cc44860dfd9727551069d8..1c6f245b3672d0705fee06cc9e9ac6e043db4b11 100644 (file)
@@ -178,8 +178,8 @@ class Seq
 
   # Method that given a Seq entry returns a FASTA entry (a string).
   def to_fasta(wrap = nil)
-    raise SeqError, "Missing seq_name" if self.seq_name.nil?
-    raise SeqError, "Missing seq"      if self.seq.nil?
+    raise SeqError, "Missing seq_name" if self.seq_name.nil? or self.seq_name == ''
+    raise SeqError, "Missing seq"      if self.seq.nil?      or self.seq.empty?
 
     seq_name = self.seq_name.to_s
     seq      = self.seq.to_s