[Bioperl-guts-l] [14504] bioperl-live/trunk: Changed the swissprot parser to work regardless of the end full stop character in DT lines .

Heikki Lehvaslaiho heikki at dev.open-bio.org
Wed Feb 13 01:39:51 EST 2008


Revision: 14504
Author:   heikki
Date:     2008-02-13 01:39:51 -0500 (Wed, 13 Feb 2008)

Log Message:
-----------
Changed the swissprot parser to work regardless of the end full stop character in DT lines. This solved an old problem with a workaround in the swiss.t: "grabbing seq_update with old SwissProt seqs fails roundtrip tests" Now make sure to print it out for each DT line.

Modified Paths:
--------------
    bioperl-live/trunk/Bio/SeqIO/swiss.pm
    bioperl-live/trunk/t/swiss.t

Modified: bioperl-live/trunk/Bio/SeqIO/swiss.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqIO/swiss.pm	2008-02-13 05:54:35 UTC (rev 14503)
+++ bioperl-live/trunk/Bio/SeqIO/swiss.pm	2008-02-13 06:39:51 UTC (rev 14504)
@@ -230,14 +230,14 @@
         my ($date, $version) = split(' ', $line, 2);
         $date =~ tr/,//d; # remove comma if new version    
         if ($version =~ /\(Rel\. (\d+), Last sequence update\)/ || # old
-                        /sequence version (\d+)\./) { #new
+                        /sequence version (\d+)/) { #new
             my $update = Bio::Annotation::SimpleValue->new(
                                         -tagname    => 'seq_update',
                                         -value      => $1
                                         );
             $annotation->add_Annotation($update);
         } elsif ($version =~ /\(Rel\. (\d+), Last annotation update\)/ || #old
-                             /entry version (\d+)\./) { #new
+                             /entry version (\d+)/) { #new
             $params{'-version'} = $1;
         }
        push @{$params{'-dates'}}, $date;
@@ -477,10 +477,10 @@
         my ($update_version) = $seq->annotation->get_Annotations("seq_update");
         foreach my $dt (@dates){
         $self->_write_line_swissprot_regex("DT   ","DT   ",
-                $dt.', integrated into UniProtKB/'.$ns,
+                $dt.', integrated into UniProtKB/'.$ns.'.',
                 "\\s\+\|\$",80) if $ct == 1;
         $self->_write_line_swissprot_regex("DT   ","DT   ",
-                $dt.", sequence version ".$update_version->display_text,
+                $dt.", sequence version ".$update_version->display_text.'.',
                 "\\s\+\|\$",80) if $ct == 2;
         $self->_write_line_swissprot_regex("DT   ","DT   ",
                 $dt.", entry version $seq_version.",

Modified: bioperl-live/trunk/t/swiss.t
===================================================================
--- bioperl-live/trunk/t/swiss.t	2008-02-13 05:54:35 UTC (rev 14503)
+++ bioperl-live/trunk/t/swiss.t	2008-02-13 06:39:51 UTC (rev 14504)
@@ -7,7 +7,7 @@
     use lib 't/lib';
     use BioperlTest;
     
-    test_begin(-tests => 240);
+    test_begin(-tests => 241);
 	
     use_ok('Bio::SeqIO');
 }




More information about the Bioperl-guts-l mailing list