I have two .pdb files describing two (small ligand) molecular structures. I need to determine if these two pdbs describe the same molecule, perhaps in different spatial conformations. Is there a program, or a combination of tools that will allow me to do this?

Moreover, if the two pdbs are determined to be from the same molecule, it could be that the atoms are in different orders. So I also need a way to identify the atoms in one PDB with the atoms in the other PDB.

I am dealing with thousands of pdbs, so I need an automatic way to do this comparison.


1 Answer 1


This is actually a very difficult problem, because a given compound may exist in multiple conformations (have multiple structures), and it might not be obvious what conformation is most relevant.

For example, a seemingly simple compound like glucose has multiple stereoisomers: if you say "glucose", you probably mean alpha-D-glucose, as opposed to beta-D-glucose, or even L-glucose. But a PDB structure file may not specify the stereochemistry to this level, or ignore it completely, and then you have no way of knowing what compound was intended. Conversely, sometimes a specific structure is given, like this open form of D-glucose; but in a water solution this structure spontaneously interconverts with the closed ring form (they are tautomers). And there are other problems with protonation (which depends on solvent and pH), charge distribution, and what not. Chemistry is a mess :)

To sum it up, the fundamental problem is that more than one completely distinct structure can actually represent the same physical compound. Therefore, comparing physical compounds is difficult; it depends on the level of detail of specification you want. I don't think there is a generic solution for this.

Comparing structures, on the other hand, is perfectly feasible: I would recommend you take a look at the InChi format developed by IUPAC. It is an identifier string that uniquely identifies a molecular structure, so testing for structural identity is equivalent to simply comparing the corresponding InChi strings. The PDB has InChi strings associated with its entries, so this should be straightforward. (But again, this simple procedure will conclude that, for example, the open form and the closed-ring form of glucose are different things.)

I'm not sure about the atom numbering. The InChi format determines atom numbering in some canonical way according to predefined rules, so in this representation the numbering is by definition always the same (and therefore meaningless). But you would need to look into the details of the PDB--InChi conversion procedure to determine which atom gets mapped to which.

  • $\begingroup$ If I have a PDB file, what tool can I use to generate a InChi string? And then, how do I compare two such strings for equality? $\endgroup$
    – a06e
    Commented Sep 22, 2015 at 12:05
  • $\begingroup$ Openbabel works. Also, you can write a simple Python script to convert the PDB file into a mol block and then the mol block to an InChi string. $\endgroup$ Commented Nov 8, 2022 at 22:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.