Let suppose that, for a given reason, a PDB file (with all the residues/chains/heteratom/cofactor/ligand information inside) is converted to a XYZ file. Doing that, all protein information is lost.

Converting XYZ to PDB is straight forward using software like OpenBabel, Mercury, etc., but those package do a direct conversion, so I end with a PDB with atoms and coordinates and no protein specific information.

I wonder: Is there a way to convert the XYZ file back to PDB but recovering the protein information (residues/chain) now?

  • $\begingroup$ Open Babel will certainly do its best to perceive bond orders and residue / chain information. It generally works. Send me an example or please post a bug report. $\endgroup$ Commented Oct 28, 2022 at 19:24
  • $\begingroup$ mmmm guess you'll need a custom XYZ format with mor column for that data ? $\endgroup$
    – pippo1980
    Commented Nov 25, 2023 at 13:58

1 Answer 1


Yes, it is possible. Of course, the original residue numbering will be lost; but you can certainly recover the sequence, and number the residues within any contiguous chain.

How to do it really depends on what software you have access to. I don't know of any software that would do it off the shelf. OpenEye toolkit would do a decent job of inferring bond orders and formal charges from coordinates; I have used that before successfully to convert a large xyz to mol2, although not quite at the scale of a full protein. After that you'd have to do some work to iterate the bonds and determine which bonds and atoms form the backbone, and from there which atoms are in the same aminoacid (each backbone N-C-C(=O) and everything connected to the Calpha, following bonds recursively). The Chemical Component Dictionary http://www.wwpdb.org/data/ccd would give a list of both standard and modified aminoacids that you can match to to get the residue name and assign atom names within it. There will still be a bit of ambiguity in symmetric aminoacids, for example in glutamic acid you might not know which oxygen was OE1 and which OE2 in the original pdb; but they are interchangeable anyway.

If you ever get this fully working, please make it an open source project :)


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .