From: martinahansen Date: Mon, 24 Jun 2013 10:55:33 +0000 (+0000) Subject: fixed genbank and embl parsing of 5'UTR and 3'UTR X-Git-Url: https://git.donarmstrong.com/?p=biopieces.git;a=commitdiff_plain;h=7029104c208f9013c0e8804737cc4f5da8bf7524 fixed genbank and embl parsing of 5'UTR and 3'UTR git-svn-id: http://biopieces.googlecode.com/svn/trunk@2187 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_ruby/lib/maasha/embl.rb b/code_ruby/lib/maasha/embl.rb index 6d9d6b5..66a53c0 100644 --- a/code_ruby/lib/maasha/embl.rb +++ b/code_ruby/lib/maasha/embl.rb @@ -152,7 +152,7 @@ class EMBLFeatures def each while @entry[@i] and @entry[@i][0 ... 2] != "SQ" - if @entry[@i] =~ /^FT\s{3}([A-Za-z_-]+)/ + if @entry[@i] =~ /^FT\s{3}([53'A-Za-z_-]+)/ if want_feat? $1 record = {} @@ -160,7 +160,7 @@ class EMBLFeatures @j = @i + 1 - while @entry[@j] and @entry[@j][0 ... 2] == "FT" and @entry[@j] !~ /^FT(\s{19}\/|\s{3}[A-Za-z_-])/ + while @entry[@j] and @entry[@j][0 ... 2] == "FT" and @entry[@j] !~ /^FT(\s{19}\/|\s{3}[53'A-Za-z_-])/ loc << @entry[@j].split(/\s+/, 2).last @j += 1 end @@ -186,7 +186,7 @@ class EMBLFeatures quals = {} k = 0 - while @entry[@j] and @entry[@j][0 ... 2] == "FT" and @entry[@j] !~ /^FT\s{3}[A-Za-z_-]/ + while @entry[@j] and @entry[@j][0 ... 2] == "FT" and @entry[@j] !~ /^FT\s{3}[53'A-Za-z_-]/ if @entry[@j] =~ /^FT\s{19}\/([^=]+)="([^"]+)/ qual = $1 val = $2 @@ -194,7 +194,7 @@ class EMBLFeatures if want_qual? qual k = @j + 1 - while @entry[k] and @entry[k][0 ... 2] == "FT" and @entry[k] !~ /^FT(\s{19}\/|\s{3}[A-Za-z_-])/ + while @entry[k] and @entry[k][0 ... 2] == "FT" and @entry[k] !~ /^FT(\s{19}\/|\s{3}[53'A-Za-z_-])/ val << @entry[k].split(/\s+/, 2).last.chomp('"') k += 1 end diff --git a/code_ruby/lib/maasha/genbank.rb b/code_ruby/lib/maasha/genbank.rb index b1c9f87..795de75 100644 --- a/code_ruby/lib/maasha/genbank.rb +++ b/code_ruby/lib/maasha/genbank.rb @@ -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