samirelanduk / atomium

Python macromolecular parsing (with .pdb/.cif/.mmtf parsing and production)
https://atomium.bio
MIT License
102 stars 19 forks source link

Zero-pad pdb temperature factor #32

Closed hippolytej closed 3 years ago

hippolytej commented 3 years ago

For Bug Reports

Hi, it seems that when saving a structure to PDB format, the temperature factor does not get zero padded correctly, e.g.:

ATOM    194  O   LYS A  20      34.379  53.562  37.179  1.00 53.10           O  # expected
ATOM    194  O   LYS A  20      34.379  53.562  37.179  1.00  53.1           O  # actual

Example code to reproduce

import atomium

model = atomium.fetch("5LXR").model
print((atomium.pdb.structure_to_pdb_string((model.residue("A.7"))).split("\n")[4]))

Python Version/Operating System

Python 3.7.7, Macos, atomium v1.0.8

samirelanduk commented 3 years ago

Thanks for spotting this, it should be fixed now. I'll add it to PyPI as 1.0.9 in the next few days.