[Biopython-dev] [Bug 2957] New: GenBank Writer Should Write Out Date
    bugzilla-daemon at portal.open-bio.org 
    bugzilla-daemon at portal.open-bio.org
       
    Mon Nov 30 19:06:12 UTC 2009
    
    
  
http://bugzilla.open-bio.org/show_bug.cgi?id=2957
           Summary: GenBank Writer Should Write Out Date
           Product: Biopython
           Version: 1.52
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: n.j.loman at bham.ac.uk
Hi,
Would it be possible to modify the GenBank writer to output the date in the
LOCUS header. When reading GenBank files this is already parsed in the correct
format into record.annotations, so the following patch would work:
 diff -u InsdcIO.py InsdcIO-date.py
--- InsdcIO.py  2009-11-30 19:54:05.000000000 +0000
+++ InsdcIO-date.py     2009-11-30 19:55:32.000000000 +0000
@@ -278,12 +278,13 @@
         assert len(division) == 3
         #TODO - date
         #TODO - mol_type
-        line = "LOCUS       %s %s %s    %s           %s 01-JAN-1980\n" \
+        line = "LOCUS       %s %s %s    %s           %s %s\n" \
                      % (locus.ljust(16),
                         str(len(record)).rjust(11),
                         units,
                         mol_type.ljust(6),
-                        division)
+                        division,
+                        record.annotations.get('date', '01-JAN-1980'))
         assert len(line) == 79+1, repr(line) #plus one for new line
         assert line[12:28].rstrip() == locus, \
I realise you might not work when converting between different record types,
but this would suit my needs for the time being. 
Cheers
-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
    
    
More information about the Biopython-dev
mailing list