[Biopython-dev] Atom.py - _assign_element function (small bug)

Peter Cock p.j.a.cock at googlemail.com
Tue Jan 25 15:38:03 UTC 2011


On Tue, Jan 25, 2011 at 3:00 PM, João Rodrigues <anaryin at gmail.com> wrote:
> Hey all,
>
> I stumbled upon a little bug today in this function. There's a formatting
> argument missing in line 92:
>
>                msg = "Could not assign element %r for Atom (name=%s) with
> given element %r" \
>                      % (*putative_element,* self.name, element)
>
> Apart from this "typo", there's a problem with hydrogens.

Oops.

> For example with
> Glutamine, the hydrogens HE21 and HE22 (if present) fail to be assigned
> decently with the current setting. I'm adding an additional condition to the
> if-clause in line 77 to correct this. This correction now parses correctly
> these hydrogens (and everyone else). The tests run fine too and I don't
> think I should add anything to them either.
>
> GLN 205
> HE22 [  8.46199989  -1.04999995 -15.40400028] 4368
> Final Assignment: H
>
> I'm pushing this fix to my github atom-element branch, I guess that's easy
> to cherry-pick?

Cherry-picked,

Thanks,

Peter




More information about the Biopython-dev mailing list