[Biopython-dev] PDB occupancy behavior

Lenna Peterson arklenna at gmail.com
Fri Aug 9 09:46:54 EDT 2013


On Friday, 9 August 2013, Peter Cock wrote:

> On Fri, Aug 9, 2013 at 2:07 PM, Lenna Peterson <arklenna at gmail.com<javascript:;>>
> wrote:
> > On Friday, 9 August 2013, Peter Cock wrote:
> >
> >> On Fri, Aug 9, 2013 at 10:07 AM, Morten Kjeldgaard <mok at bioxray.dk<javascript:;>
> <javascript:;>>
> >> wrote:
> >>
> >> > On 09/08/2013, at 10:47, Peter Cock <p.j.a.cock at googlemail.com<javascript:;>
> <javascript:;>>
> >> wrote:
> >> >
> >> > > How about the special float values NaN or NA instead?
> >> > > Or the Python special value None?
> >> >
> >> > TBH I don't think there is any good reason to change the current
> >> defaults.
> >> > On the contrary, we should be careful when changing default values
> since
> >> > this might break users' programs.
> >> >
> >> > My point is, that Lenna wants to read files that does not follow the
> PDB
> >> > standard, and so she needs to make provisions for that in her own
> >> > program, not the toolkit.
> >> >
> >> >
> >> Do you think this should be something handled differently in strict and
> >> permissive mode? Should missing occupancy give a warning or error in
> strict
> >> mode?
> >
> > (Resending to dev list)
> >
> > None in permissive mode makes a lot of sense to me.
> >
> > Missing occupancy is a fatal error in strict mode.
> >
> > Lenna
>
> Good (error in strict mode).
>
> Do you think a warning in permissive mode for missing occupancy
> is also worth adding, or would using None as the value indicate
> that nicely?
>
> Peter
>


I have some concern about changing the type of an attribute but I imagine
any end user who cares about occupancy doesn't want spurious values of
either 1.0 or 0.0 anyway.

I'm not at a computer right now but I believe most problems in the PDB
parser are fatal in strict and warnings in permissive. So there should
already be a warning in place.

It occurred to me it would also be possible o create an "ultra-permissive"
mode designed for parsing computationally produced files, and suppress some
of the warnings (e.g. missing occupancy and B-factor). That way,
the current behavior could be left unchanged. Possibly a permissiveness
level (0 for strict, 1 for current permissive, 2 for even more permissive).

Anyway, I'd be happy to implement any of these options (current parser to
None, restore previous behavior and None in a new permissiveness level,
other?) and of course update the unit test.

Cheers,

Lenna


More information about the Biopython-dev mailing list