[BioPython] suggestions for Bio.PDB

Andrew Dalke dalke at dalkescientific.com
Sun Apr 17 12:59:54 EDT 2005


Catherine Letondal wrote:
> Would it be possible for the get_structure() method in PDBParser to 
> accept a filehandle, instead of just accepting just a filename?

>     def get_structure(self, id, filename=None, filehandle=None):
>         """Return the structure.

I've also seen this sort of API done like this

    def get_structure(self, id, infile):
       if isinstance(infile, basestring):
         infile = open(infile)

so that there is only one parameter instead of two.

					Andrew
					dalke at dalkescientific.com



More information about the BioPython mailing list