my-server
← Wiki Redirected from InChI

International Chemical Identifier

The International Chemical Identifier (InChI, <small>pronounced</small> ) is a textual identifier for chemical substances, designed to provide a standard way to encode molecular information and to facilitate the search for such information in databases and on the web. Initially developed by the International Union of Pure and Applied Chemistry (IUPAC) and National Institute of Standards and Technology (NIST) from 2000 to 2005, the format and algorithms are non-proprietary. Since May 2009, it has been developed by the InChI Trust, a nonprofit charity from the United Kingdom which works to implement and promote the use of InChI.

The identifiers describe chemical substances in terms of layers of information &mdash; the atoms and their bond connectivity, tautomeric information, isotope information, stereochemistry, and electronic charge information. Not all layers have to be provided; for instance, the tautomer layer can be omitted if that type of information is not relevant to the particular application. The InChI algorithm converts input structural information into a unique InChI identifier in a three-step process: normalization (to remove redundant information), canonicalization (to generate a unique number label for each atom), and serialization (to give a string of characters).

InChIs differ from the widely used CAS registry numbers in three respects: firstly, they are freely usable and non-proprietary; secondly, they can be computed from structural information and do not have to be assigned by some organization; and thirdly, most of the information in an InChI is human readable (with practice). InChIs can thus be seen as akin to a general and extremely formalized version of IUPAC names. They can express more information than the simpler SMILES notation and, in contrast to SMILES strings, every structure has a unique InChI string, which is important in database applications. Information about the 3-dimensional coordinates of atoms is not represented in InChI; for this purpose a format such as PDB can be used.

The InChIKey, sometimes referred to as a hashed InChI, is a fixed length (27 character) condensed digital representation of the InChI that is not human-understandable. The InChIKey specification was released in September 2007 in order to facilitate web searches for chemical compounds, since these were problematic with the full-length InChI. Unlike the InChI, the InChIKey is not unique: though collisions are expected to be extremely rare, there are known collisions.

InChI was first released in 2005. A major milestone was version 1.02 of January 2009, which provided a means to generate so called standard InChI, a version of the InChI with a fixed level of detail and collection of layers. The standard InChIKey is then the hashed version of the standard InChI string. The standard InChI will simplify comparison of InChI strings and keys generated by different groups, and subsequently accessed via diverse sources such as databases and web resources. Since version 1.07.1 (August 2024), the software uses the MIT license, and may be downloaded from the InChI GitHub site. Beside the implementation in molecule editors, stand-alone executables have been packaged for multiple Linux distributions, including Debian.

Generation

In order to avoid generating different InChIs for tautomeric structures, before generating the InChI, an input chemical structure is normalized to reduce it to its so-called core parent structure. This may involve changing bond orders, rearranging formal charges and possibly adding and removing protons. Different input structures may give the same result; for example, acetic acid and acetate would both give the same core parent structure, that of acetic acid. A core parent structure may be disconnected, consisting of more than one component, in which case the sublayers in the InChI usually consist of sublayers for each component, separated by semicolons (periods for the chemical formula sublayer). One way this can happen is that all metal atoms are disconnected during normalization; so, for example, the InChI for tetraethyllead will have five components, one for lead and four for the ethyl groups.

The first, main, layer of the InChI refers to this core parent structure, giving its chemical formula, non-hydrogen connectivity without bond order (<code>/c</code> sublayer) and hydrogen connectivity (<code>/h</code> sublayer.) The <code>/q</code> portion of the charge layer gives its charge, and the <code>/p</code> portion of the charge layer tells how many protons (hydrogen ions) must be added to or removed from it to regenerate the original structure. If present, the stereochemical layer, with sublayers <code>b</code>, <code>/t</code>, <code>/m</code> and <code>/s</code>, gives stereochemical information, and the isotopic layer <code>/i</code> (which may contain sublayers <code>/h</code>, <code>/b</code>, <code>/t</code>, <code>/m</code> and <code>/s</code>) gives isotopic information. These are the only layers which can occur in a standard InChI.

If the user wants to specify an exact tautomer, a fixed hydrogen layer <code>/f</code> can be appended, which may contain various additional sublayers; this cannot be done in standard InChI though, so different tautomers will have the same standard InChI (for example, alanine will give the same standard InChI whether input in a neutral or a zwitterionic form.) Finally, a nonstandard reconnected <code>/r</code> layer can be added, which effectively gives a new InChI generated without breaking bonds to metal atoms. This may contain various sublayers, including <code>/f</code>.

Format and layers

Every InChI starts with the string <code>InChI=</code> followed by the version number, currently <code>1</code>. If the InChI is standard, this is followed by the letter <code>S</code> for standard InChIs, which is a fully standardized InChI flavor maintaining the same level of attention to structure details and the same conventions for drawing perception. The remaining information is structured as a sequence of layers and sub-layers, with each layer providing one specific type of information. The layers and sub-layers are separated by the delimiter <code>/</code> and start with a characteristic prefix letter (except for the chemical formula sub-layer of the main layer). The six layers with important sublayers are:

  1. Main layer (always present)
  2. * Chemical formula (no prefix). This is the only sublayer that must occur in every InChI. Numbers used throughout the InChI are given in the formula's element order excluding hydrogen atoms. For example, /C10H16N5O13P3 implies that atoms numbered 1–10 are carbons, 11–15 are nitrogens, 16–28 are oxygens, and 29–31 are phosphorus.
  3. * Atom connections (<code>/c</code>). The atoms in the chemical formula (except for hydrogens) are numbered in sequence; this sublayer describes which atoms are connected by bonds to which other ones. The type of those bonds is later specified in the stereochemical layer (<code>/b</code>).
  4. * Hydrogen atoms (<code>/h</code>). Describes how many hydrogen atoms are connected to each of the other atoms.
  5. Charge layer
  6. * charge sublayer (<code>/q</code>)
  7. * proton sublayer (<code>/p</code> for protons)
  8. Stereochemical layer
  9. * double bonds and cumulenes (<code>/b</code>).
  10. * tetrahedral stereochemistry of atoms and allenes. First <code>/t</code> describes the relative configuration, which implies a preference for one of the mirror forms. Then <code>/m</code> is used to choose whether to mirror the molecule described by <code>/t</code>, if an absolute configuration is requested.
  11. * type of stereochemistry information (<code>/s</code>). <code>/s1</code> for absolute, <code>/s2</code> for relative (unspecified mix of chiralities), <code>/s3</code> for racemic (equal mix of both chiralities).
  12. Isotopic layer (<code>/i</code>), may include sublayers:
  13. * sublayer <code>/h</code> for isotopic hydrogen
  14. * sublayers <code>/b</code>, <code>/t</code>, <code>/m</code>, <code>/s</code> for isotopic stereochemistry
  15. Fixed-H layer (<code>/f</code>) for tautomeric hydrogens; contains some or all of the above types of layers except atom connections; may end with <code>o</code> sublayer.
  16. Reconnected layer (<code>/r</code>); contains the whole InChI of a structure with reconnected metal atoms

The delimiter-prefix format has the advantage that a user can easily use a wildcard search to find identifiers that match only in certain layers.

Standard InChI adds the following constraints:

  • The <code>/f</code>, <code>/o</code>, and <code>/r</code> (sub)layers are never included in standard InChI.
  • If stereochemistry is specified, it can only be absolute <code>/s1</code>. Unknown stereo designations are treated as undefined.
  • Organometallic connectivity does not include bonds to the metal.

InChIKey

The condensed, 27 character InChIKey is a hashed version of the full InChI (using the SHA-256 algorithm), designed to allow for easy web searches of chemical compounds. The standard InChIKey is the hashed counterpart of standard InChI. Most chemical structures on the Web up to 2007 have been represented as GIF files, which are not searchable for chemical content. The full InChI turned out to be too lengthy for easy searching, and therefore the InChIKey was developed. There is a very small, but nonzero chance of two different molecules having the same InChIKey, but the probability for duplication of only the first 14 characters has been estimated as only one duplication in 75 databases each containing one billion unique structures. With all databases currently having below 50 million structures, such duplication appears unlikely at present. A recent study more extensively studies the collision rate finding that the experimental collision rate is in agreement with the theoretical expectations.

The InChIKey currently consists of three parts separated by hyphens, of 14, 10 and one character(s), respectively, like <code>xxxxxxxxxxxxxx-yyyyyyyyfv-p</code>.

  • The first 14 characters (x) result from a SHA-256 hash of the connectivity information (the main layer and <code>/q</code> sublayer of the charge layer) of the InChI. The mapping to letters is a "base-26" encoding.
  • The second part consists of 8 characters (y) resulting from a hash of the remaining ("minor") layers of the InChI, a single character (f) indicating the kind of InChIKey (<code>S</code> for standard and <code>N</code> for nonstandard), and a character (v) indicating the version of InChI used (currently <code>A</code> for version 1).
  • Finally, the single character (p) at the end indicates the protonation of the core parent structure, corresponding to the <code>/p</code> sublayer of the charge layer (<code>N</code> for no protonation, <code>O</code>, <code>P</code>, ... if protons should be added and <code>M</code>, <code>L</code>, ... if they should be removed.)

The following are examples of InChIs and InChIKeys. Because all standard InChIs can be trivially turned "nonstandard" by removing the "S" marker, they actually imply two keys that differ by one character.

<templatestyles src="Plainlist/styles.css"/>

Base 26 encoding

InChIKey uses a base 26 encoding to represent (parts of) SHA-256 hashes. Input is chopped in 14-bit segments, each of which corresponds to three letters (triplets). A remaining group up to 9 bits correspond to 2 characters (doublets). In InChIKey, inputs can only be of two lengths: 65 bits for the "major" hash (divided into 14 × 4 + 9 bits for 3 × 4 + 2 = 14 characters) and 37 bits for the "minor" hash (14 × 2 + 9 bits for 3 × 2 + 2 = 8 characters). A few additional lengths are used in RInChI:

  • 28 (14 × 2) bits yield a 6-character hash; only the truncated 4-character form is used.
  • 56 (14 × 4) bits yield a 12-character hash, the truncated form being 10 characters.
  • 78 (65 + 14 - 1) bits yield a 17-character hash, with one bit used twice.

The first 80 bits of the SHA-256 for an empty string is <code>e3 b0 c4 42 98 fc 1c 14 9a fb</code>. This results in the following base26 strings for this hash: <code>UHFF</code>, <code>UHFFFAOY</code>, <code>UHFFFADPSC</code>, <code>UHFFFADPSCTJ</code>, <code>UHFFFADPSCTJAU</code>, <code>UHFFFADPSCTJAUYIS</code>. These strings are commonly encountered when the corresponding layers have no data. For example, one sees <code>UHFFFAOYSA</code> or <code>UHFFFAOYNA</code> in an InChIKey when the source InChI has no stereochemical information.

InChI resolvers

As the InChI cannot be reconstructed from the InChIKey, an InChIKey always needs to be linked to the original InChI to get back to the original structure. InChI Resolvers act as a lookup service to make these links, and prototype services are available from National Cancer Institute, the UniChem service at the European Bioinformatics Institute, and PubChem. ChemSpider has had a resolver until July 2015 when it was decommissioned.

AuxInfo

The auxiliary information (<code>AuxInfo</code>) string is produced by InChI software alongside the InChI string. For example, the (±)-borneol <code>/s2</code> example produces:

AuxInfo=1/0/N:1,2,3,4,5,6,7,8,9,10,11/E:(1,2)/rA:13cCCCCCCCCCCOHH/rB:;;;s4;;s4s6;s6;s1s2s7;n3s5s8s9;P8;P7;s8;/rC:2.0857,-1.1788,0;3.0905,.273,0;2.6864,-1.7772,0;4.5619,-2.283,0;3.6719,-2.2295,0;5.2528,-.9411,0;4.5862,-1.4963,0;4.4381,-.864,0;3.0628,-.7814,0;3.6539,-1.3571,0;3.6343,-.1809,0;5.5343,-1.9585,0;4.8482,.1078,0;

"AuxInfo contains, in particular, atom non-stereo equivalence information, mapping input atom positions to output positions, and 'reversibility' information for re-drawing the structure." The reversibility information can be used to regenerate the source structure (such as a MOLFILE with 2D or 3D coordinates) without needing an InChI. The InChI user guide describes the format in detail. The parts seen here are:

  • <code>1/0</code> refers to InChI version 1, normalization type 0.
  • <code>/N:</code> maps InChI's atom numbering to the input's atom numbering.
  • <code>/E:</code> describes the equivalence between atoms.
  • <code>/rA:</code> describes reversibility information for atoms.
  • <code>/rB:</code> describes reversibility information for bonds.
  • <code>/rC:</code> describes reversibility information for coordinates. Here 2D coordinates are used; a more realistic depiction for this molecule would be 3D.

The full complement of tags are: <code>1/0/N/E/gE/it/iN/I/E/gE/it/iN/CRV/rA/rB/rC</code>.

Derived formats

RInChI

RInChI (Reaction InChI, International chemical identifier for reactions) is a standard method for using InChI to describe chemical reactions. An RInChI string consists of several sets of InChI strings for the reactants, products, and agents as well as information required to tag them as such. Example string and breakdown:

As shown above, layers that do not involve InChI parts are separated with <code>/</code> as in InChI. Layers that do are separated with <code>&lt;&gt;</code>. Multiple InChI parts are separated with <code>!</code>.

It is allowed to omit some structures in the RInChI. In this case a sixth layer is used to specify how many structures have been omitted in each of layers 2, 3, and 4.

RInChI has an analogous concept of RInChIKeys. There are three versions of RInChIKey differing in length:

  • The Long-RInChIKey consists of a header and a joining of the full InChIKeys of the chemicals mentioned. The above reaction is <code>Long-RInChIKey=SA-EUHFF-QTBSBXVTEAMEQO-UHFFFAOYSA-N-LFQSCWFLJTTHZ-UHFFFAOYSA-N--XEKOWRVHYACXOJ-UHFFFAOYSA-N-XLYOFNOQVPJJNP-UHFFFAOYSA-N--QAOWNCQODCNURD-UHFFFAOYSA-N</code>. The "SA" refers to "standard, version 1", the "E" refers to direction (equilibrium, can also be "F" forward, "B" backward, "U" undefined), and the "UHFF" are unused (this is derived from the SHA hash of emptiness).
  • The Short-RInChIKey is a fixed-length (63 character, 55 without hyphen) string. <code>Short-RInChIKey=SA-EUHFF-JJFIATRHOH-UDXZTNISGZ-QAOWNCQODC-NUHFF-NUHFF-NUHFF-ZZZ</code>
  • The header is the same as the Long-RInChIKey.
  • The three 10-letter parts are derived from hashing the "major" InChI layers (atom, connectivity; same definition as InChIKey 14-letter part) for layers 2, 3, and 4 respectively; an empty layer hashes to <code>UHFFFADPSC</code>.
  • The three 5-letter parts encode the protonation and stereochemistry states for layers 2, 3, 4. The first letter ("N") encodes the total charge like the final one-letter part of InChIKey. The remaining four letters are a hash of the "minor" (stereochemistry, etc; same definition as InChIKey 8-letter part) parts; again, "UHFF"is a hash of the empty value.
  • The last three letters encode the number of "no structure" components (layer 6) for layers 2, 3, and 4. "Z" means 0, "A" means 1, etc.
  • The Web-RInChIKey is a fixed-length (47 characters, 1 hyphen) string. The above reaction has <code>Web-RInChIKey=SMUHAWIQPXIVCEVKG-NUHFFFADPSCTJSA</code>. To generate it, the InChI from all the layers of the RInChI are first combined and sorted alphabetically.
  • The first part (17 letters) is generated by combining the "major" layers of the sorted InChIs.
  • The second part consists of an indication of total protonation ("N" here, same encoding as InChIKey), a 12-letter hash of the "minor" layers of the sorted InChIs (<code>UHFFFADPSCTJ</code> is a hash of the empty value), and a version indicator ("SA" means standard, version 1).

MInChI

MInChI (Mixtures InChI, International chemical identifier for mixtures) is a draft standard for using (partial) InChI to describe a mixture. It actually defines two formats:

  • The Mixfile, a JSON-based format for describing mixtures. Chemicals can be identified by name, Molfile, SMILES, InChI, InChIKey, and/or chemical formula.
  • The MInChI, a condensed representation of mixtures where chemicals are identified by their InChI.

Both forms allow nesting of mixtures.

An example of a relatively complex (nested) Mixfile is provided below.

The corresponding MInChI is: <code>MInChI=0.00.1S/CH2O/c1-2/h1H2&CH4O/c1-2/h2H,1H3&H2O/h1H2/n