Home > Community > InChIKey generation from InChI
Upvote

26

Downvote
+ Medical research
+ Software
+ Cheminformatics
Posted by
Louis Buff Parry

InChIKey generation from InChI

Allan Ashworth  Follow

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.

More

Upvote

VOTE

Downvote
Aphotic Sapian  Follow

Lots of information in this link with references,

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

More

Upvote

VOTE

Downvote
John Hearns  Follow
@Martin-マーチン point taken, and thanks for taking the time and trouble to respond.More
Upvote

VOTE

Downvote
Hey Paulman  Follow
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.More
Upvote

VOTE

Downvote
Eric Weatherby  Follow
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, More
Upvote

VOTE

Downvote
Dr Jo  Follow
I know, that is why I dismissed the flag and gave you and upvote, too. I just wanted to inform you for further references.More
Upvote

VOTE

Downvote
John Bove  Follow
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 dont like someone to visit our Q/A and then be redirected to where they couldve gone to with a Google search. Its really appreciable if you provide some of the relevant info in that FAQ here.More
Upvote

VOTE

Downvote
more replies
Dahny Patel  Follow

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.

More

Upvote

VOTE

Downvote
Erik Hendrych  Follow
@Martin-マーチン Im not sure Id categorize 1.04 as actively developed, since there havent been updates since 2011. I suspect there will be a InChI v2 at some point, but otherwise its a great answer.More
Upvote

VOTE

Downvote
Helen Kaye  Follow
@Geoff Thanks. I agree, active development is something different. Take it as an indirect quote (and a little bit of a pun).More
Upvote

VOTE

Downvote
Jonathon Howard  Follow
@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.More
Upvote

VOTE

Downvote