[Biopython-dev] [Bug 2294] New: These patches allow one to write a GenBank file using the SeqIO interface

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed May 16 01:55:14 UTC 2007


http://bugzilla.open-bio.org/show_bug.cgi?id=2294

           Summary: These patches allow one to write a GenBank file using
                    the SeqIO interface
           Product: Biopython
           Version: 1.43
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: howard.salis at gmail.com


The SeqIO interface currently reads from, but does not write to the GenBank
format. The GenBank format is widely used and is often chosen as the data
storage format for many plasmid, genome, and other nucleotide editors. By
giving Biopython the capability of writing annotated sequences to the GenBank
format, one can use Biopython to read in raw sequences, analyze and annotate
them, and then view them in a nucleotide visual editor. The following patches
do exactly this and use the current SeqIO interface to do it.

The following attached patches enable the command
SeqIO.write(record,handle,"genbank"), where handle is an open, writable
file-object and record is _either_ a SeqRecord generator or the result of one
of its iterations. That is, if one did manyrecords =
SeqIO.parse(handle,"genbank") or onerecord = manyrecords.next(), then one could
pass either manyrecords or onerecord to SeqIO.write(). If a generator
containing multiple records is passed, all records are written to a single
GenBank file. If one record is passed, it is written to file. The file is not
closed, though, and may be called multiple times to write additional records to
file.

The attached patches make small modifications to Bio/SeqIO/__init__.py and
Bio/SeqIO/InsdcIO.py. The _feed_first_line function in Bio/GenBank/Scanner.py
is altered to handle missing data (it uses a very Pythonic dictionary of test
lambda functions to parse the meaning of words). Finally, a new file is created
called Bio/GenBank/GenBankWriter.py.

Questions, Comments, Suggestions, Criticisms, etc are welcome.


-- 
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