| 1 |
/** |
| 2 |
* This package provides functionality related to <a href="https://dx.doi.org/10.1186/s13321-018-0277-8">RInChI</a>. |
| 3 |
* <h2>Overview</h2> |
| 4 |
* <br> |
| 5 |
* To provide this functionality calls are placed to methods of the <a href="https://github.com/IUPAC-InChI/RInChI/">native RInChI library</a> |
| 6 |
* by means of a <a href="https://github.com/java-native-access/jna">JNA</a> wrapper. |
| 7 |
* <p> |
| 8 |
* The precompiled binaries (i.e., dll and so files) of the IUPAC RInChI native C++ code provide access to their |
| 9 |
* functionality to generate RInChI only by accepting MDL CTAB file text formats RXN and RDfile for inputting and |
| 10 |
* outputting reaction information. Direct access to the C++ internal data structures of the IUPAC RInChI library |
| 11 |
* is <i>not</i> available. |
| 12 |
* </p> |
| 13 |
* <p> |
| 14 |
* The RInChI functionality is provided in Java by the class {@link io.github.dan2097.jnarinchi.JnaRinchi}. |
| 15 |
* The classes {@link io.github.dan2097.jnarinchi.cheminfo.MdlReactionReader} and |
| 16 |
* {@link io.github.dan2097.jnarinchi.cheminfo.MdlReactionWriter} provide utilities for converting RinchiInput data |
| 17 |
* to file texts in RXN and RDFile format and vice versa. |
| 18 |
* </p> |
| 19 |
* <h2>Getting Started</h2> |
| 20 |
* <pre> |
| 21 |
* // load a RDfile into a String |
| 22 |
* String reactionText = ....; |
| 23 |
* |
| 24 |
* // calculate the RInChI from the reaction file |
| 25 |
* RinchiOutput rinchiOutput = JnaRinchi.fileTextToRinchi(reactionText); |
| 26 |
* |
| 27 |
* // get the RInChI and the associated RAuxInfo |
| 28 |
* String rinchi = rinchiOutput.getRinchi(); |
| 29 |
* String rauxInfo = rinchiOutput.getAuxInfo(); |
| 30 |
* |
| 31 |
* // calculate the long RInChI-Key |
| 32 |
* RinchiKeyOutput rinchiKeyOutput = JnaRinchi.fileTextToRinchiKey(reactionText, RinchiKeyType.LONG); |
| 33 |
* String longRinchiKey = rinchiKeyOutput.getRinchiKey(); |
| 34 |
* |
| 35 |
* // decompose the RInChI into its constituent InChIs (and associated AuxInfo if any) |
| 36 |
* RinchiDecompositionOutput rinchiDecompositionOutput = JnaRinchi.decomposeRinchi(rinchi, rauxInfo); |
| 37 |
* |
| 38 |
* // the RinchiDecompositionOutput hands out arrays of inchis, auxinfo and ReactionComponentRole |
| 39 |
* String[] inchis = rinchiDecompositionOutput.getInchis(); |
| 40 |
* String[] auxInfos = rinchiDecompositionOutput.getAuxInfos(); |
| 41 |
* ReactionComponentRole[] roles = rinchiDecompositionOutput.getRoles(); |
| 42 |
* |
| 43 |
* // the direction of the reaction as specified in the RInChI string can also be retrieved |
| 44 |
* ReactionDirection direction = rinchiDecompositionOutput.getDirection(); |
| 45 |
* </pre> |
| 46 |
* <h2>Good to know</h2> |
| 47 |
* <h3>Aromaticity</h3> |
| 48 |
* <p> |
| 49 |
* The usage of "aromatic" bonds is strongly discouraged. Instead <b>Kekule</b> structures are <b>recommended</b>. |
| 50 |
* <h3>Implicit Hydrogen Atoms</h3> |
| 51 |
* <p> |
| 52 |
* The reaction components returned from the native RInChI library in the MDL RXN or RDFile format do not indicate the |
| 53 |
* number of implicit hydrogen atoms. The implicit valence (hydrogen atom count) for a given atom is determined by |
| 54 |
* taking into account the element, charge and explicit valence (sum of all bond orders) by using the MDL valence model. |
| 55 |
* </p> |
| 56 |
* <h2>Known Limitations</h2> |
| 57 |
* <h3>Stereochemical Information</h3> |
| 58 |
* <h4>Reaction to RInChI</h4> |
| 59 |
* <p> |
| 60 |
* The native RInChI library supports tetrahedral chiral atoms, and double bond stereo configurations. The |
| 61 |
* stereochemical information of allene atoms is not captured in RInChI. Generally, the stereo information |
| 62 |
* for tetrahedral chiral atoms and double bonds is only taken into account by the native RInChI library |
| 63 |
* if it can be inferred from the 2D or 3D coordinates of atoms of the reaction components. |
| 64 |
* </p> |
| 65 |
* <h4>RInChI to Reaction</h4> |
| 66 |
* <p> |
| 67 |
* When converting a (RInChI, RAuxInfo) pair to a chemical object of the type RinchiInput, the stereo information |
| 68 |
* is stored implicitly in the atom coordinates. This only works if the RAuxInfo contains 2D or 3D coordinates as |
| 69 |
* the RInChI itself does not store any coordinates. |
| 70 |
* </p> |
| 71 |
* <h3>Agents</h3> |
| 72 |
* <p> |
| 73 |
* The native RInChI library is able to consider agents if they are specified within an RDfile, that is, |
| 74 |
* in the counts line of an RXN record of an RDfile and as Molfiles of the respective RXN record. This is the why |
| 75 |
* RDfile is the preferred (and default, see {@link io.github.dan2097.jnarinchi.ReactionFileFormat#AUTO}) input format |
| 76 |
* to feed into the native RInChI library when consuming a reaction to producing a RInChI. |
| 77 |
* <br> |
| 78 |
* The agent types information (e.g. catalyst, solvent) generally could be present in the RDFile content, |
| 79 |
* but such information is not processed by the native RInChI code (also there is no uniform or widely accepted way |
| 80 |
* to store/formalize the agent types within MDL syntax). |
| 81 |
* <br> |
| 82 |
* Please note that agents cannot be processed by the native RInChI library if the unofficial agent-extension of the |
| 83 |
* RXN V2000 format is used. |
| 84 |
* </p> |
| 85 |
* <h3>Radicals</h3> |
| 86 |
* <p> |
| 87 |
* Radicals are supported by the InChI and RInChI standard as well as by <code>jna-inchi</code>. |
| 88 |
* </p> |
| 89 |
*/ |
| 90 |
package io.github.dan2097.jnarinchi; |