]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_ruby/lib/maasha/genbank.rb
added \r remove hack to genbank/embl parsers
[biopieces.git] / code_ruby / lib / maasha / genbank.rb
index fe08263446379e749fc89094b66338e55421af3d..b1c9f8734a7a7f6dac1df4c7a18a3d59a62e2af1 100644 (file)
@@ -68,7 +68,7 @@ class Genbank < Filesys
 
     block.chomp!("//" + $/ )
 
-    entry = block.split $/
+    entry = block.tr("\r", "\n").split $/
 
     return nil if entry.empty?
 
@@ -87,7 +87,7 @@ class Genbank < Filesys
 
     seq = @entry[j + 1 .. i].join.delete(" 0123456789")
 
-    Seq.new(nil, seq, "dna") if seq
+    Seq.new(nil, seq, :dna) if seq
   end
 
   # Method to get the base keys from Genbank entry and return these
@@ -109,7 +109,7 @@ class Genbank < Filesys
             j += 1
           end
 
-          if keys.has_key? key.to_sym
+          if keys[key.to_sym]
             keys[key.to_sym] << ";" + val
           else
             keys[key.to_sym] = val