[Biopython-dev] Bio.PDB - Missing values (was Moratorium on commits?)

Peter Cock p.j.a.cock at googlemail.com
Thu Aug 15 13:23:50 UTC 2013


On Thu, Aug 15, 2013 at 2:18 PM, Lenna Peterson <arklenna at gmail.com> wrote:
> On Monday, 12 August 2013, João Rodrigues wrote:
>>
>> Throwing an error might not be a good idea because when dealing with
>> models
>> they sometimes have missing fields... then we'd have to fix them all
>> somehow before parsing them.
>>
>> The None value seems a good indicator that something is amiss, while not
>> putting any value there. There should also be a warning upon writing that
>> the value is being replaced by a default value. Blank is also good
>> actually, maybe we could add an option to the writer/parser to "preserve"
>> values?
>>
>
> I don't think writing string "None" into a fixed width field would be a good
> idea. So it's probably best to change occupancy (and any other missing
> values set to None) to blank, correct width fields for writing.

I didn't mean to suggest writing the string "None" in the field, and
I'm not sure if João did - it would certainly be an invalid PDB file.

I agree that where the data structure has None (e.g. from our parser)
then the writer could use a blank string (of the appropriate width).
For mandatory fields like occupancy, this should give a warning.

> I've never tangled with the writer and I have incoming PhD students this
> week but I can attempt to add this functionality early next week.

That would be great (assuming no-one else want to tackle it sooner).

Thanks,

Peter




More information about the Biopython-dev mailing list