[Biopython-dev] format autodection

Jeffrey Chang jchang at smi.stanford.edu
Mon Dec 31 02:18:18 EST 2001


On Fri, Dec 21, 2001 at 04:02:17AM -0700, Andrew Dalke wrote:

> 2) Does the word "recognize" make sense in this context?  I tried
> "identifier" but that's also a commonly used noun.  (I choose
> "recognize" from a post of Thomas's from the end of summer.)q

I was a confused with what was going on in the code until I realized
that there's actually two slightly different uses of the word
"recognize."  In the first use,
> def _recognizeFile(parser, infile):
recognize is used as a predicate for whether the parser can handle the
format of the data in infile.

In the second,
> class RecognizeFormats:
> [...]
>   def recognizeFile(self, infile):
recognize selects between multiple formats and returns the appropriate
one for the data.

It would clear things up if one of them were renamed something else,
e.g. the first use is renamed as "handlesFile" or "acceptsFile".


> 6) Version detection depends on tell/seek working.  There needs to be
> a simple wrapper for inputs (like URLs, and sys.stdin) which don't
> support that action.  Jeff added something like this already.

The file-like handle in File.py is incomplete for this purpose.  It
can only push back stuff as lines, and not as other blocks of data.
It should not be hard to add that capability, though.

> 8) Does this idea make sense to others?

Yes!  And it's sorely needed!  :)

Jeff



More information about the Biopython-dev mailing list