DOKK / manpages / debian 12 / pdb-tools / pdb_sort.1.en
PDB_SORT(1) User Commands PDB_SORT(1)

pdb_sort - manual page for pdb_sort 2.5.0

pdb_sort Sorting key is not valid: '-'

Sorts the ATOM/HETATM/ANISOU/CONECT records in a PDB file.

Atoms are always sorted by their serial number, meaning the original ordering of the atoms within each residue are not changed. Alternate locations are sorted by default.

Residues are sorted according to their residue sequence number and then by their insertion code (if any).

Chains are sorted by their chain identifier.

Finally, the file is sorted by all keys, and the records are placed in the following order:

- ATOM/ANISOU, intercalated if the latter exist - HETATM - CONECT, sorted by the serial number of the central (first) atom

MASTER, TER, END statements are removed. Headers (HEADER, REMARK, etc) are kept and placed first. Does NOT support multi-model files. Use pdb_splitmodel, then pdb_sort on each model, and then pdb_mkensemble.

python pdb_sort.py -<option> <pdb file>

# sorts by chain and residues
# sorts by chain (A, B, C ...) only
# sorts by residue number/icode only

This program is part of the `pdb-tools` suite of utilities and should not be distributed isolatedly. The `pdb-tools` were created to quickly manipulate PDB files using the terminal, and can be used sequentially, with one tool streaming data to another. They are based on old FORTRAN77 code that was taking too much effort to maintain and compile. RIP.

July 2022 pdb_sort 2.5.0