[Biopython-dev] reusable code in Genbank

Cayte katel at worldpath.net
Wed Mar 14 03:47:53 EST 2001


----- Original Message -----
From: "Brad Chapman" <chapmanb at arches.uga.edu>
To: <biopython-dev at biopython.org>
Sent: Saturday, March 10, 2001 11:19 AM
Subject: Re: [Biopython-dev] reusable code in Genbank


> Cayte:
> > _EventGenerator in GenBank looks like generic glue code that
> > could be used in my Kabat parser.  I could cut and paste it but
duplicate
> > code adds to the maintenance load.  Andrew, I suggest moving it to
Tools??
>
> Jeff:
> > Looks more appropriate for Bio/ParserSupport.py.
>
> I'm glad this code can be of more general use. I just cleaned up
> _EventGenerator a bit (it had some ugly GenBank-specific stuff in it)
> and moved it into ParserSupport.py, as Jeff suggested. It's called
> EventGenerator(), and now GenBank uses it from ParserSupport.
>
> One thing I was worried about is that EventGenerator is an XML
> handler, so it derives from an XML handler class. I didn't want to
> make ParserSupport only be usable if the user had XML installed (since
> non-Martel-based parsers use ParserSupport) so EventGenerator will
> only be conditionally created if the XML import goes okay, otherwise
> an error message will be printed.
>
.   Since this post, I've noticed more opportunities to reuse code.  I think
the class Referennce.py in Genbank is close enough to the Kabat references
to use as a base class.

   All of us may be able to create more efficient code by exchanging ideas
and refactoring rather than just eaxh writing our own code

                                             Cayte




More information about the Biopython-dev mailing list