|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jniinchi.JniInchiWrapper
public class JniInchiWrapper
JNI Wrapper for International Chemical Identifier (InChI) C++ library.
This class is not intended to be used directly, but should be accessed through subclasses that read data formats and load them into the InChI data structures.
Subclasses should load data through the addAtom, addBond and addParity methods. Once the molecule is fully loaded then the generateInchi method should be called. Ideally this should all take place within the subclass's constructor. The public get methods will all return null until this has happened.
See inchi_api.h.
Method Summary | |
---|---|
static INCHI_STATUS |
checkInchi(String inchi,
boolean strict)
Checks if the string represents valid InChI/standard InChI. |
static INCHI_KEY_STATUS |
checkInchiKey(String key)
Checks whether a string represents valid InChIKey. |
protected static String |
checkOptions(List<INCHI_OPTION> ops)
Checks and canonicalises options. |
protected static String |
checkOptions(String ops)
Checks and canonicalises options. |
static JniInchiOutput |
getInchi(JniInchiInput input)
Generates the InChI for a chemical structure. |
static JniInchiOutput |
getInchiFromInchi(JniInchiInputInchi input)
Converts an InChI into an InChI for validation purposes (the same as the -InChI2InChI option). |
static JniInchiOutputKey |
getInchiKey(String inchi)
Calculates the InChIKey for an InChI string. |
static JniInchiInputData |
getInputFromAuxInfo(String auxInfo)
|
static JniInchiOutput |
getStdInchi(JniInchiInput input)
Calculates the Standard InChI string for a chemical structure. |
static JniInchiOutputStructure |
getStructureFromInchi(JniInchiInputInchi input)
Generated 0D structure from an InChI string. |
protected static String |
LibInchiGetVersion()
|
static void |
loadLibrary()
Loads native library. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void loadLibrary() throws LoadNativeLibraryException
JniInchiException
- Library failed to load
LoadNativeLibraryException
protected static String checkOptions(List<INCHI_OPTION> ops) throws JniInchiException
ops
- List of INCHI_OPTION
JniInchiException
protected static String checkOptions(String ops) throws JniInchiException
ops
- Space delimited string of options to pass to InChI library.
Each option may optionally be preceded by a command line
switch (/ or -).
JniInchiException
public static JniInchiOutput getInchi(JniInchiInput input) throws JniInchiException
Generates the InChI for a chemical structure.
If no InChI creation/stereo modification options are specified then a standard InChI is produced, otherwise the generated InChI will be a non-standard one.
Valid options:
Structure perception (compatible with stdInChI): /NEWPSOFF /DoNotAddH /SNon Stereo interpretation (lead to generation of non-standard InChI) /SRel /SRac /SUCF /ChiralFlagON /ChiralFlagOFF InChI creation options (lead to generation of non-standard InChI) /SUU /SLUUD /FixedH /RecMet /KET /15T
Other options:
/AuxNone Omit auxiliary information (default: Include) /Wnumber Set time-out per structure in seconds; W0 means unlimited In InChI library the default value is unlimited /OutputSDF Output SDfile instead of InChI /WarnOnEmptyStructure Warn and produce empty InChI for empty structure /SaveOpt Save custom InChI creation options (non-standard InChI)
input
-
JniInchiException
public static JniInchiOutput getStdInchi(JniInchiInput input) throws JniInchiException
Calculates the Standard InChI string for a chemical structure.
The only valid structure perception options are NEWPSOFF/DoNotAddH/SNon. In any other structural perception options are specified then the calculation will fail.
input
-
JniInchiException
public static JniInchiOutput getInchiFromInchi(JniInchiInputInchi input) throws JniInchiException
Converts an InChI into an InChI for validation purposes (the same as the -InChI2InChI option).
This method may also be used to filter out specific layers. For instance, /Snon would remove the stereochemical layer; Omitting /FixedH and/or /RecMet would remove Fixed-H or Reconnected layers. In order to keep all InChI layers use options string "/FixedH /RecMet"; option /InChI2InChI is not needed.
input
-
JniInchiException
public static JniInchiOutputStructure getStructureFromInchi(JniInchiInputInchi input) throws JniInchiException
input
-
JniInchiException
public static JniInchiOutputKey getInchiKey(String inchi) throws JniInchiException
inchi
- source InChI string
JniInchiException
public static INCHI_KEY_STATUS checkInchiKey(String key) throws JniInchiException
key
-
JniInchiException
public static INCHI_STATUS checkInchi(String inchi, boolean strict) throws JniInchiException
Checks if the string represents valid InChI/standard InChI.
inchi
- source InChIstrict
- if false
, just briefly check for proper layout (prefix, version, etc.) The result
may not be strict.
If true
, try to perform InChI2InChI conversion and returns success if a resulting
InChI string exactly match source. The result may be 'false alarm' due to imperfectness of
JniInchiException
public static JniInchiInputData getInputFromAuxInfo(String auxInfo) throws JniInchiException
JniInchiException
protected static String LibInchiGetVersion()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |