Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restype_lig and other text fields converted to float #23

Closed
xrobin opened this issue May 29, 2018 · 1 comment
Closed

restype_lig and other text fields converted to float #23

xrobin opened this issue May 29, 2018 · 1 comment

Comments

@xrobin
Copy link
Contributor

xrobin commented May 29, 2018

I just ran into an issue with 1HDQ, where the ligand, INF, is wrongly converted to a floating point number representation of positive infinity, which causes issues downstream.

plipcmd -i 1hdq -x

And then:

>>> import plip.modules.plipxml as plip
>>> report = plip.PLIPXML("report.xml")
>>> print(report.bsites['INF:A:1308'].hydrophobics[0].restype_lig)
inf
>>> print(type(report.bsites['INF:A:1308'].hydrophobics[0].restype_lig))
<type 'float'>

When dumped into json the ligand name becomes Infinity (without quotes) instead of 'INF' (with quotes) so I cannot get the ligand back. When dumped with ujson an OverflowError is raised.

There are other ligand names which can be interpreted as numbers, for instance 1ONY has a ligand named 588, and a ligand named NAN exists, although it isn't used in any PDB entry so far.

ssalentin pushed a commit that referenced this issue May 30, 2018
Force more data to string (issue #23)
@ssalentin
Copy link

Merged pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants