Skip to content

Conversation

@ETC-tom
Copy link

@ETC-tom ETC-tom commented Dec 2, 2025

Stated behaviour of pdb_tidy:

Modifies the file to adhere (as much as possible) to the format specifications.


Expects a sorted file - REMARK/ATOM/HETATM/END - so use pdb_sort in case you are
not sure.

This includes:
    - Adding TER statements after chain breaks/changes
    - **Truncating**/Padding all lines to 80 characters
    - Adds END statement at the end of the file

Will remove all original TER/END statements from the file.

Usage:
    python pdb_tidy.py [-strict] <pdb file>

Example:
    python pdb_tidy.py 1CTF.pdb
    python pdb_tidy.py -strict 1CTF.pdb  # does not add TER on chain breaks

However truncating lines >80 characters is not implemented in the code.
I have added this functionality and a corresponding unit test.

Current behaviour

INPUT

TITLE     THIS IS A VERY LONG LINE WHICH SHOULD BE WRAPPED CORRECTLY OVER MULTIPLE LINES WITH PADDING\n

OUTPUT line remains unchanged

Desired behaviour

INPUT

TITLE     THIS IS A VERY LONG LINE WHICH SHOULD BE WRAPPED CORRECTLY OVER MULTIPLE LINES WITH PADDING\n

OUTPUT

TITLE     THIS IS A VERY LONG LINE WHICH SHOULD BE WRAPPED CORRECTLY OVER       \n
TITLE     MULTIPLE LINES WITH PADDING                                           \n

@ETC-tom
Copy link
Author

ETC-tom commented Dec 2, 2025

This behaviour can be evaluated by executing the following commands in terminal

echo "TITLE     THIS IS A VERY LONG LINE WHICH SHOULD BE WRAPPED CORRECTLY OVER MULTIPLE LINES WITH PADDING" > temp.pdb
pdb_tidy temp.pdb

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

Successfully merging this pull request may close these issues.

1 participant