Skip navigation links

Package io.github.dan2097.jnarinchi

This package provides functionality related to RInChI.

See: Description

Package io.github.dan2097.jnarinchi Description

This package provides functionality related to RInChI.

Overview


To provide this functionality calls are placed to methods of the native RInChI library by means of a JNA wrapper.

The precompiled binaries (i.e., dll and so files) of the IUPAC RInChI native C++ code provide access to their functionality to generate RInChI only by accepting MDL CTAB file text formats RXN and RDfile for inputting and outputting reaction information. Direct access to the C++ internal data structures of the IUPAC RInChI library is not available.

The RInChI functionality is provided in Java by the class JnaRinchi. The classes MdlReactionReader and MdlReactionWriter provide utilities for converting RinchiInput data to file texts in RXN and RDFile format and vice versa.

Getting Started

 // load a RDfile into a String
 String reactionText = ....;

 // calculate the RInChI from the reaction file
 RinchiOutput rinchiOutput = JnaRinchi.fileTextToRinchi(reactionText);

 // get the RInChI and the associated RAuxInfo
 String rinchi = rinchiOutput.getRinchi();
 String rauxInfo = rinchiOutput.getAuxInfo();

 // calculate the long RInChI-Key
 RinchiKeyOutput rinchiKeyOutput = JnaRinchi.fileTextToRinchiKey(reactionText, RinchiKeyType.LONG);
 String longRinchiKey = rinchiKeyOutput.getRinchiKey();

 // decompose the RInChI into its constituent InChIs (and associated AuxInfo if any)
 RinchiDecompositionOutput rinchiDecompositionOutput = JnaRinchi.decomposeRinchi(rinchi, rauxInfo);

 // the RinchiDecompositionOutput hands out arrays of inchis, auxinfo and ReactionComponentRole
 String[] inchis = rinchiDecompositionOutput.getInchis();
 String[] auxInfos = rinchiDecompositionOutput.getAuxInfos();
 ReactionComponentRole[] roles = rinchiDecompositionOutput.getRoles();

 // the direction of the reaction as specified in the RInChI string can also be retrieved
 ReactionDirection direction = rinchiDecompositionOutput.getDirection();
 

Good to know

Aromaticity

The usage of "aromatic" bonds is strongly discouraged. Instead Kekule structures are recommended.

Implicit Hydrogen Atoms

The reaction components returned from the native RInChI library in the MDL RXN or RDFile format do not indicate the number of implicit hydrogen atoms. The implicit valence (hydrogen atom count) for a given atom is determined by taking into account the element, charge and explicit valence (sum of all bond orders) by using the MDL valence model.

Known Limitations

Stereochemical Information

Reaction to RInChI

The native RInChI library supports tetrahedral chiral atoms, and double bond stereo configurations. The stereochemical information of allene atoms is not captured in RInChI. Generally, the stereo information for tetrahedral chiral atoms and double bonds is only taken into account by the native RInChI library if it can be inferred from the 2D or 3D coordinates of atoms of the reaction components.

RInChI to Reaction

When converting a (RInChI, RAuxInfo) pair to a chemical object of the type RinchiInput, the stereo information is stored implicitly in the atom coordinates. This only works if the RAuxInfo contains 2D or 3D coordinates as the RInChI itself does not store any coordinates.

Agents

The native RInChI library is able to consider agents if they are specified within an RDfile, that is, in the counts line of an RXN record of an RDfile and as Molfiles of the respective RXN record. This is the why RDfile is the preferred (and default, see ReactionFileFormat.AUTO) input format to feed into the native RInChI library when consuming a reaction to producing a RInChI.
The agent types information (e.g. catalyst, solvent) generally could be present in the RDFile content, but such information is not processed by the native RInChI code (also there is no uniform or widely accepted way to store/formalize the agent types within MDL syntax).
Please note that agents cannot be processed by the native RInChI library if the unofficial agent-extension of the RXN V2000 format is used.

Radicals

Radicals are supported by the InChI and RInChI standard as well as by jna-inchi.

Skip navigation links

Copyright © 2024. All rights reserved.