[Biopython-dev] Bioformat module

Brad Chapman chapmanb at arches.uga.edu
Thu Jan 3 22:22:51 EST 2002


Hey Andrew and all;

[Bioformats]
> I think it's at the stage where the code can be added
> to Biopython proper.  I would like someone else to
> take a look at it first, if only to try it out.  (It
> wouldn't hurt to also say "Wow! That's cool!" :)

I'll second the "Wow! That's cool" from Jeff :-). I like the way 
things are going with the Bioformats module. I just
had some time to play with it, and it is very nice. After some
small modifications to the GenBank format, I got GenBank minimally
working with it. Snazzy -- conversions to Fasta format:

>>> from Bioformats import registry
>>> infile = open("/home/chapmanb/bioppjx/biopython/Tests/GenBank/iro.gb")
>>> format = registry["sequence"].identify(infile)
>>> print format.name
genbank

>>> from Bioformats import IO
>>> infile.seek(0)
>>> writer = IO.io.make_writer(format = "fasta")
>>> for record in IO.io.readFile(infile):
...     print record
...     writer.write(record)
<Bio.SeqRecord.SeqRecord instance at 0x1d0e410>
>AL109817.1
cacaggcccagagccactcctgcctacaggttctgagggctcaggggacctcctgggccctcaggctcttta
gctgagaataagggccctgagggaactacctgcttctcacatccccgggtctctgaccatctgctgtgtgcc
[...]

I like it! Attached is the format registration stuff, that
goes in Bioformats/formats/genbank.py for anyone who is interested
in duplicating this.

I'm definately +1 on checking this into CVS. It seems along the
same spirit as what Thomas was working on in Bio/SeqIO/generic, but
integrates well with Martel. I'm not sure if I really have the full
picture of everything yet, but from what I see it looks good!

I'm excited about the mixin stuff as well -- it seems like it'll
really simplify a lot of repetitive coding for adding new formats. 
Too bad I already did all the repetitive coding for GenBank :-).

At-least-coding-monkeys-get-lots-of-bananas-ly yr's,
Brad
-- 
PGP public key available from http://pgp.mit.edu/



More information about the Biopython-dev mailing list