-
Notifications
You must be signed in to change notification settings - Fork 32
Description
FYI - OCL-SwingJS adds to chem/moreparsers and fleshes out chem.inchi/InChIOCL
ChemicalIdentifierResolver
(abstract superclass; contact point for PubChem and NCI/CADD Chemical Identifier Resolver)
InChIKeyResolver (subclass contacts PubChem (default) or NCI/CADD (selectable)
InChIResolver (subclass contacts PubChem (default) or NCI/CADD (selectable)
ChemicalNameResolver (subclass contacts NCI/CADD (default) or PubChem (selectable)
The key difference here is that PubChem only provides resolution of identifiers for compounds that have been registered with them, while the CIR uses CACTVS and OPSIN to read "roughly IUPAC" names, such as (R)-cis-4-hydroxyhex-2-ene (wrong-direction numbering) and can generate SMILES and InChI and 2D and 3D structures for novel compounds. CIR can also convert novel InChI strings to stereochemically correct structures (though not for allenes).
InChIParser
- calls static ...chem.inchi.InChIOCL.getMoleculeFromInChI(String inchi, StereoMolecule mol)
- returns a StereoMolecule from an InChI using JNI-InChI (Java) or inchi-wasm-SwingJS (JavaScript)
The chem.inchi.InChIOCL class is also directly accessible via several public static methods, including:
public static String getInChI(StereoMolecule mol, String options)
public static String getInChI(String molFileDataOrInChI, String options)
public static String getInChIKey(StereoMolecule mol, String options)
public static String getInChIKey(String molFileDataOrInChI, String options)
public static String getInChIFromSmiles(String smiles, String options)
public static String getSmilesFromInChI(String inchi, String options)
public static String getInChIModelJSON(String inchi)
This last method builds on new functionality added last week to inchi-web.WASM within the InChI-SwingJS project that extends to JavaScript the capabilities already provided in JNI-InChI for Java, namely the ability to extract full atom and bond strereochemical parities from "bare-bone" InChI strings (that is, without need for atom coordinates or auxInfo data).
Tests of this functionality can be found in OCLSwingJS main/src/java/OCLSwingJSTest.java; results are identical for Java and JavaScript -- except that Java is still at inchi.c 1.03, and JavaScript is 1.07+. (Java is at 1.03 because I have not managed to get the make command to work in Windows Subsystem Linux.)