]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_ruby/lib/maasha/genbank.rb
fixed genbank and embl parsing of 5'UTR and 3'UTR
[biopieces.git] / code_ruby / lib / maasha / genbank.rb
index b1c9f8734a7a7f6dac1df4c7a18a3d59a62e2af1..795de75652f1d84f7ec6fd91531e07fc929741b1 100644 (file)
@@ -147,7 +147,7 @@ class GenbankFeatures
 
   def each
     while @entry[@i] and @entry[@i] !~ /^ORIGIN/
-      if @entry[@i] =~ /^\s{5}([A-Za-z_-]+)/
+      if @entry[@i] =~ /^\s{5}([53'A-Za-z_-]+)/
         if want_feat? $1
           record = {}
 
@@ -155,7 +155,7 @@ class GenbankFeatures
 
           @j = @i + 1
 
-          while @entry[@j] and @entry[@j] !~ /^(\s{21}\/|\s{5}[A-Za-z_-]|[A-Z])/
+          while @entry[@j] and @entry[@j] !~ /^(\s{21}\/|\s{5}[53'A-Za-z_-]|[A-Z])/
             loc << @entry[@j].lstrip
             @j += 1
           end
@@ -181,7 +181,7 @@ class GenbankFeatures
     quals = {}
     k     = 0
 
-    while @entry[@j] and @entry[@j] !~ /^\s{5}[A-Za-z_-]|^[A-Z]/
+    while @entry[@j] and @entry[@j] !~ /^\s{5}[53'A-Za-z_-]|^[A-Z]/
       if @entry[@j] =~ /^\s{21}\/([^=]+)="([^"]+)/
         qual = $1
         val  = $2
@@ -189,7 +189,7 @@ class GenbankFeatures
         if want_qual? qual
           k = @j + 1
 
-          while @entry[k] and @entry[k] !~ /^(\s{21}\/|\s{5}[A-Za-z_-]|[A-Z])/
+          while @entry[k] and @entry[k] !~ /^(\s{21}\/|\s{5}[53'A-Za-z_-]|[A-Z])/
             val << @entry[k].lstrip.chomp('"')
             k += 1
           end