9
$\begingroup$

I am trying to find some good resources to understand generation of InChIKeys from the InChI. There seems to be no resource available online. I have gone through the Wikipedia article for InChI, but it hardly contains any information as to how the InChI keys are generated. Can anyone provide me with this information as to how we can generate InChIKeys from InChI. Also, if you happen to find any good resources for the same, please do share them with me.

$\endgroup$

3 Answers 3

8
$\begingroup$

InChI is the acronym for the IUPAC International Chemical Identifier. It is basically as system, to catalogue molecular information. Its prime advantage is, that it is just a text string. That basically means, that it can easily be understood by machines. The other advantage is, that it is also human readable. It consists of several layers: the molecular formula, connectivity of the heavy atoms, placement of the hydrogen atoms/ stereochemical information. This shall not be confused with the IChIKey, which is a string of 27 characters derived from the hash code of the InChI string.

A quite thorough presentation/ documentation of the software and its algorithms (including the generation of the InChI string and the InChIKey) is available as an open access paper (currently asap): Stephen R Heller, Alan McNaught, Igor Pletnev, Stephen Stein and Dmitrii Tchekhovskoi, Journal of Cheminformatics, 2015, 7:23. Since the abstract is not very comprehensive, I will quote a short passage from the introduction, which outlines the contents of the article:

We then describe the workflow of InChI generation (normalization, canonicalization, and serialization stages), as well as generation of the compact hashed code derived from InChI (InChIKey); the related algorithms and implementation details are briefly discussed.

In response to R.M.'s comment I am also including the introductory sentence of the linked paper, which describes what an IChIKey is:

InChIKey is a compact chemical identifier derived from InChI. The InChIKey is always only 27-characters long.

For a more technical description of the algorithms and the scope of the InChI string and the InChIKey, the reader is pointed towards the technical manual: Stein S, Heller S, Tchekhovskoi D, Pletnev I. IUPAC International Chemical Identifier (InChI) InChI version 1, software version 1.04 (2011) Technical Manual. The description of the InChIKey can be found in section V, pp 53-62:

The InChIKey is a character signature based on a hash code of the InChI string. A hash code is a fixed length condensed digital representation of a variable length character string. Providing a signature derived from an InChI string is helpful for search applications, including Web searching and chemical structure database indexing; also, it may serve as a checksum for verifying InChI, for example, after transmission over a network.

Please note that the InChIKey by itself does not contain enough information to restore the molecular structure. This is also mentioned in the open access paper:

A disadvantage of the InChIKey is that one loses the ability to algorithmically restore a structure from a textual label: InChIKey is a structure-based registry-lookup identifier [...].

But these are not the only sources. As an IUPAC member, most information relating to the developement and implementation can be accessed freely at iupac.org. Since itself is an non-profit organisation, it also has its own website, www.inchi-trust.org. This includes a very extensive technical FAQ (html and pdf) and since it is open source software also the source code.


The software is still actively developed by the chemical community and the trust itself. As of the current version (1.04, Sept. 2011) there are still several shortcomings, which have bean addressed in Structure that breaks InChI.

$\endgroup$
4
  • $\begingroup$ @Martin-マーチン I'm not sure I'd categorize 1.04 as actively developed, since there haven't been updates since 2011. I suspect there will be a InChI v2 at some point, but otherwise it's a great answer. $\endgroup$ Jun 29, 2015 at 17:48
  • $\begingroup$ @Geoff Thanks. I agree, active development is something different. Take it as an indirect quote (and a little bit of a pun). $\endgroup$ Jun 29, 2015 at 17:55
  • $\begingroup$ @Martin-マーチン Thanks a lot.I was actually looking for the actual algorithm which takes place internally in the softwares used for conversion.I got a good explanation in one of the links mentioned in the technical manual you referred.Thanks again. $\endgroup$
    – LifeIsGood
    Jun 29, 2015 at 18:02
  • $\begingroup$ This probably needs an update… we have inchi 1.06 from December 2020. So it'sn't really active development but not standstill either. $\endgroup$ Nov 3, 2023 at 12:56
7
$\begingroup$

According to Wikipedia, the InChikey is generated by a hashing algorithm, like the SHA-2. The InChi key is designed for use in search, and thus is not necessarily designed to be comprehensible to the end user.

If you are looking for a way to generate InChi keys from InChis, there are a number of software packages that do so, including the open source program from IUPAC via the InChi Trust: http://www.inchi-trust.org/downloads/.

InChi is published under a more permissive variation of the GPL, so in addition to the standalone executable, you can download the code as well. Then, you can sift through the code for the hashing algorithm and figure out what it is doing. InChi even has a project on SourceForge. The provided documentation at these locations likely includes the workings of the algorithm, but remember that InChi key was designed to produce a string of characters from a structure that a computer can match; the end user is not necessarily supposed to interact with or parse the InChi key.

If you are looking for existing programs that can also produce InChi keys, IUPAC provides the following list:

The first three comfortably sit in your browser.

$\endgroup$
0
$\begingroup$

Lots of information in this link with references,

http://www.inchi-trust.org/technical-faq/

$\endgroup$
5
  • $\begingroup$ Since I recently looked into the matter myself, I know that your answer is the correct reference and in this case probably as valid as it can get. In general (for future references), however, it would be preferable to include the essential parts of the answer here, and provide the link for reference. This is probably why this was flagged as very low quality. $\endgroup$ Jun 29, 2015 at 11:41
  • $\begingroup$ @Martin-マーチン IUPAC is the go to place for the OP's question. Thanks for the link but the OP's question was quite broad. $\endgroup$ Jun 29, 2015 at 12:39
  • $\begingroup$ I know, that is why I dismissed the flag and gave you and upvote, too. I just wanted to inform you for further references. $\endgroup$ Jun 29, 2015 at 12:41
  • $\begingroup$ @Martin-マーチン point taken, and thanks for taking the time and trouble to respond. $\endgroup$ Jun 29, 2015 at 12:42
  • $\begingroup$ FWIW, link-only answers are not appropriate since the link might become invalid in the future. (Though unlikely in this case) The point is, we don't like someone to visit our Q/A and then be redirected to where they could've gone to with a Google search. It's really appreciable if you provide some of the relevant info in that FAQ here. $\endgroup$
    – M.A.R.
    Jun 29, 2015 at 18:17

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.