[Bioperl-guts-l] [14539] bioperl-live/trunk/Bio/SeqIO/swiss.pm: AC (accession) line now wraps if there are too many accession to fit one line

Heikki Lehvaslaiho heikki at dev.open-bio.org
Sat Feb 23 10:10:46 EST 2008


Revision: 14539
Author:   heikki
Date:     2008-02-23 10:10:46 -0500 (Sat, 23 Feb 2008)

Log Message:
-----------
AC (accession) line now wraps if there are too many accession to fit one line

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

Modified: bioperl-live/trunk/Bio/SeqIO/swiss.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqIO/swiss.pm	2008-02-23 14:48:23 UTC (rev 14538)
+++ bioperl-live/trunk/Bio/SeqIO/swiss.pm	2008-02-23 15:10:46 UTC (rev 14539)
@@ -490,21 +490,22 @@
         if ( $self->_ac_generation_func ) {
             $temp_line = &{$self->_ac_generation_func}($seq);
             $self->_print( "AC   $temp_line\n");
-        } else {
-            if ($seq->can('accession_number') ) {
-                $self->_print("AC   ",$seq->accession_number,";");
-                if ($seq->can('get_secondary_accessions') ) {
-                    foreach my $sacc ($seq->get_secondary_accessions) {
-                        $self->_print(" ",$sacc,";");
-                    }
-                    $self->_print("\n");
-                } else {
-                    $self->_print("\n");
+        }
+        elsif ($seq->can('accession_number') ) {
+            my $ac_line = $seq->accession_number;
+            if ($seq->can('get_secondary_accessions') ) {
+                foreach my $sacc ($seq->get_secondary_accessions) {
+                    $ac_line .= "; ". $sacc;;
                 }
+                $ac_line .= ";";
             }
-            # otherwise - cannot print <sigh>
+
+            $self->_write_line_swissprot_regex("AC   ","AC   ",$ac_line,
+                                               "\\s\+\|\$",$LINE_LENGTH);
         }
+        # otherwise - cannot print <sigh>
 
+
         # Date lines and sequence versions (changed 6/15/2006)
         # This is rebuilt from scratch using the current SwissProt/UniProt format
         if ( $seq->can('get_dates') ) {




More information about the Bioperl-guts-l mailing list