You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently PDBFile.set_structure() does not restrict the upper bound of float values in the atom annotations (e.g. coordinates). However the fixed columns in PDB only allow for a certain value range: For example the value 10000 does not fit into a 4 character string.
Attempting to write such high values would currently lead to a shift in all following columns.
Hence, the created PDB file becomes invalid.
To fix this, the function should raise an exception if setting such an AtomArray is attempted.
Example:
importbiotite.structure.io.pdbaspdbimportbiotite.structureasstrucatoms=struc.AtomArray(10)
# Keep the first five ATOM records correct for comparisonatoms.coord[:5] =100atoms.coord[5:] =1000000pdb_file=pdb.PDBFile()
pdb_file.set_structure(atoms)
print(pdb_file)
Output:
ATOM 1 0 100.000 100.000 100.000 1.00 0.00
ATOM 2 0 100.000 100.000 100.000 1.00 0.00
ATOM 3 0 100.000 100.000 100.000 1.00 0.00
ATOM 4 0 100.000 100.000 100.000 1.00 0.00
ATOM 5 0 100.000 100.000 100.000 1.00 0.00
ATOM 6 0 1000000.0001000000.0001000000.000 1.00 0.00
ATOM 7 0 1000000.0001000000.0001000000.000 1.00 0.00
ATOM 8 0 1000000.0001000000.0001000000.000 1.00 0.00
ATOM 9 0 1000000.0001000000.0001000000.000 1.00 0.00
ATOM 10 0 1000000.0001000000.0001000000.000 1.00 0.00
This affects the following atom annotations:
coord
b_factor
occupancy
Note that negative value allow one numeric character less due to the added '-' character.
The text was updated successfully, but these errors were encountered:
Currently
PDBFile.set_structure()
does not restrict the upper bound of float values in the atom annotations (e.g. coordinates). However the fixed columns in PDB only allow for a certain value range: For example the value10000
does not fit into a 4 character string.Attempting to write such high values would currently lead to a shift in all following columns.
Hence, the created PDB file becomes invalid.
To fix this, the function should raise an exception if setting such an
AtomArray
is attempted.Example:
Output:
This affects the following atom annotations:
coord
b_factor
occupancy
Note that negative value allow one numeric character less due to the added
'-'
character.The text was updated successfully, but these errors were encountered: