[Biopython-dev] flex, setup.py and Bio.PDB.mmCIF (Bug 2619)

Michiel de Hoon mjldehoon at yahoo.com
Fri Mar 15 13:09:18 UTC 2013


Hi everybody,

I looked at the mmCIF parser again, and it turned out that the Python standard library contains a shlex lexical analyzer module that makes mmCIF parsing straightforward without relying on flex or PLY. I uploaded a modified version of MMCIF2Dict.py to the git repository. This parser does the exact same thing as the flex-based parser, but is in pure Python. If you're interested, have a look at MMCIF2Dict.py in the git repository; comments and suggestions are welcome.

If there are no objections, I think we can remove everything in Bio.PDB.mmCIF. Also I'm a bit unhappy with how the information in an mmCIF file is represented in Biopython. I think there are more Pythonic ways to store the contents of an mmCIF file in a Python object.

Best,
-Michiel.

--- On Sat, 2/16/13, Peter Cock <p.j.a.cock at googlemail.com> wrote:

> From: Peter Cock <p.j.a.cock at googlemail.com>
> Subject: Re: [Biopython-dev] flex, setup.py and Bio.PDB.mmCIF (Bug 2619)
> To: "Michiel de Hoon" <mjldehoon at yahoo.com>
> Cc: "BioPython-Dev Mailing List" <biopython-dev at biopython.org>, "Lenna Peterson" <arklenna at gmail.com>
> Date: Saturday, February 16, 2013, 5:42 AM
> On Sat, Feb 16, 2013 at 2:46 AM,
> Michiel de Hoon <mjldehoon at yahoo.com>
> wrote:
> > Hi Lenna,
> >
> > Maybe we are confusing each other..
> > I am looking for a solution that (a) doesn't introduce
> new dependencies,
> 
> +1
> 
> > (b) is pure-Python so it can run on Jython,
> 
> +1 And on PyPy (which to me is more interesting that Jython)
> etc.
> 
> > and (c) if that is not possible and we do need to use
> C, then that C code
> > should be understandable so that it can be debugged if
> necessary.
> >
> > I was suggesting to clean up lex.yy.c so that we can at
> least achieve (c).
> 
> This does mean we essentially give up on ever regenerating
> the lex.yy.c
> file every again - could that be a problem if Flex itself
> changes much?
> 
> > The alternative is to start from the PLY-based parser
> and remove the
> > dependency on PLY.
> >
> > Best,
> > -Michiel.
> 
> Peter
> 



More information about the Biopython-dev mailing list