I am not a chemist, I come from a computer science background. I am working on a project related to computer-aided drug design.

I have a list of chemical compounds in their SMILES notation, to which I am trying to retrieve some chemical properties. Some of these chemical properties exist in the Pubchem database, others exist in the Chembl database.

As an example:

Which means that if I were to use these SMILES as a key for my (automated) search, I will get chemical properties for different compounds.

Now, my question is: Is there some unique key, that exists in both databases (PubChem and Chembl) that I can use for my search?

Also, if possible, can anyone explain why these SMILES are different even for the same compound. As I was reading in a website, that these are canonical SMILES which I beleive are specific to each database.

  • $\begingroup$ InChi keys are unique (with very limited exceptions). You could also pre-process your SMILES through some kind of standardisation code to get them all into the same format $\endgroup$
    – NotEvans.
    Commented Nov 5, 2021 at 19:35
  • $\begingroup$ @NotEvans. Depending on what you aim for, standard InChI/InChIKey (version 1.06, December 2020) may be good and efficient. They may lead to confusion, too. Because Amine Chadi stated a background different to the one of a «chemist by training», I sense potential (though not insurmountable) pitfalls using them and appended my answer. Version 1.06+ possibly growths and improves by feedback. $\endgroup$
    – Buttonwood
    Commented Nov 6, 2021 at 18:26

1 Answer 1


There is not one, but there are multiple approaches to describe a molecule by a SMILES string. It is up to the developers of the programs (and databases) to define which one is used and to declare this in the documentation. Thus, read the manual; if they do not state this explicitly, ask them.

One of the better approaches taken is, for example the one by OpenBabel; it offers you to write e.g., either a canonical, universal, or inchified SMILES string.

If SMILES you work with have origin in multiple sources adhering to more than one dialect, you may request e.g., OpenBabel to consolidate the representation you subsequently use. Thus

obabel -:"C1=CN=CC=C1C(=O)NN" -ocan

yields to the canonical SMILES string NNC(=O)c1ccncc1. In case you have a file listing many SMILES, consider a conversion like

obabel -ismi input.txt -ocan -O output_canonical.smi

Noel M O'Boyle wrote a paper about the methods to identify a canonical SMILES representation of (organic) structures which provides insight here, too.

Towards a Universal SMILES representation - A standard method to generate canonical SMILES based on the InChI in J. Cheminf. 2012; doi 10.1186/1758-2946-4-22.

A comment suggested to use InChI and their hashed form, InChI keys as a replacement of SMILES. Their spread in databases (example NIST, or examples compiled by Warr) may be tempting and checking identity of entries based on InChI key appealing in terms of performance and collision resistance once they are in hand (e.g., Goodman et al.).

However, the discern of different compounds which are tautomers of each other currently is not possible using standard InChI/InChI key. Take, for example, 2-hydroxypyridine and its tautomer, 2-pyridone. Depending on the polarity of the solvent, one form may be favoured over the other; and while both structures differ, and are described by two different canonical SMILES, the standard InChI and InChIKey are the same for both:

enter image description here


«different tautomers have the same connectivity/hydrogen layer»

see 4.7. Standard InChI specifics, InChI trust's Technical FAQ by 2012-05-12

What can be done, e.g. using InChI trust's reference binaries (version 1.06/December 2020, repository), is to invoke the inclusion of a fixed H layer then leading to InChI




As of now, the inclusion of a fixed H layer in InChI leads to a non-standard description (thus, there is no leading 1S). Equally note that only the second hash block is affected to yield a different InChIKey.

Thus, in short depending on what you aim for, use InChI/InChIKey with caution.


Goodman, J. M.; Platnev, I.; Thiessen, P.; Bolton, E.; Heller, S. R. InChI version 1.06: now more than 99.99% reliable in J. Cheminform. 13, 2021, 40; doi 10.1186/s13321-021-00517-z, open access.

Warr, W. A. Many InChIs and quite some feat in J. Comput. Aided Mol. Des. 29, 2015, 681–694; doi 10.1007/s10822-015-9854-3.

  • $\begingroup$ Thank you for the great informative answer. $\endgroup$
    – mac179
    Commented Nov 7, 2021 at 15:52

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.