Class InChIJS

All Implemented Interfaces:
InChIStructureProvider, JmolInChI

public class InChIJS extends InchiJmol
This class implements inchi-web.wasm from InChI-SwingJS, which is adapted from https://github.com/IUPAC-InChI/InChI-Web-Demo by Bob Hanson and Josh Charlton 2025.01.23-2025.01.24. In the case of a Jmol model for mdel to InChI, we first generate MOL file data. For InChI to SMILES, we use the inchi-web.c method model_from_inchi() that we developed with the assistance of Frank Lange. The class originally adapted Richard Apodaca's 2020 molfile-to-inchi LLVM-derived Web Assembly implementation of IUPAC InChI v. 1.05. see https://depth-first.com/articles/2020/03/02/compiling-inchi-to-webassembly-part-2-from-molfile-to-inchi/ Note that this initialiation is asynchronous. One has to either use sync inchi or invoke a call to generate an InChI, such as: x = {none}.find("inchi")
  • Constructor Details

    • InChIJS

      public InChIJS()
  • Method Details

    • getInchi

      public String getInchi(Viewer vwr, BS atoms, Object molData, String options)
      Parameters:
      vwr -
      atoms -
      molData - can be String or InputStream
      options -
      Returns:
      InChI or SMILES or InChIKey or internal InChI structure details
    • initializeModelForSmiles

      public void initializeModelForSmiles()
    • getNumAtoms

      public int getNumAtoms()
      Atoms ///
    • setAtom

      public InChIStructureProvider setAtom(int i)
    • getElementType

      public String getElementType()
    • getX

      public double getX()
    • getY

      public double getY()
    • getZ

      public double getZ()
    • getCharge

      public int getCharge()
    • getImplicitH

      public int getImplicitH()
    • getIsotopicMass

      public int getIsotopicMass()
      Description copied from interface: InChIStructureProvider
      from inchi_api.h #define ISOTOPIC_SHIFT_FLAG 10000 add to isotopic mass if isotopic_mass = (isotopic mass - average atomic mass) AT_NUM isotopic_mass; 0 => non-isotopic; isotopic mass or ISOTOPIC_SHIFT_FLAG + mass - (average atomic mass)
      Returns:
      inchi's value of average mass
    • getNumBonds

      public int getNumBonds()
      Bonds ///
    • setBond

      public InChIStructureProvider setBond(int i)
    • getIndexOriginAtom

      public int getIndexOriginAtom()
    • getIndexTargetAtom

      public int getIndexTargetAtom()
    • getInchiBondType

      public String getInchiBondType()
    • getNumStereo0D

      public int getNumStereo0D()
      Stereo ///
    • setStereo0D

      public InChIStructureProvider setStereo0D(int i)
    • getParity

      public String getParity()
    • getStereoType

      public String getStereoType()
    • getCenterAtom

      public int getCenterAtom()
    • getNeighbors

      public int[] getNeighbors()