Files
rdkit/Code/GraphMol/FileParsers/PDBWriter.cpp
Franz Waibl 8bc2b5d025 Improve PDB formatting with incomplete Monomer info (#7286)
* Fix PDB formatting if residue name is set but atom name is not.

* additionally, sets the width of the atom name to 4. If the name is set
  to something shorter than 4 letters, fill up with whitespace. This
  avoids bad column alignment. If the name is set to something with more
  than 4 characters, the PDB will still be invalid.

* Add a test for missing residue name and short atom names

* Fix atom name alignment in unit test

* Small updates to PDB line formatting, add a unit test

* Truncate residue names to 3 letters, and atom names to 4
* Add a unit test to ensure that atom and residue names are truncated.
* Switch from std::array<char, 2> to std::string for the atom number.
* Use name.empty() instead of name.size() == 0

---------

Co-authored-by: Franz Waibl <waiblfranz@gmail.com>
2024-07-10 04:43:08 +02:00

10 KiB