public class InChIGeneratorFactory extends Object
Factory providing access to InChIGenerator
and InChIToStructure
.
See those classes for examples of use. These methods make use of the
JNI-InChI library.
The InChIGeneratorFactory
is a singleton class, which means that there
exists only one instance of the class. An instance of this class is obtained
with:
InChIGeneratorFactory factory = InChIGeneratorFactory.getInstance();
InChI/Structure interconversion is implemented in this way so that we can
check whether or not the native code required is available. If the native
code cannot be loaded during the first call to getInstance
method (when the instance is created) a CDKException
will be thrown. The
most common problem is that the native code is not in the * the correct
location. Java searches the locations in the PATH environmental
variable, under Windows, and LD_LIBRARY_PATH under Linux, so the JNI-InChI
native libraries must be in one of these locations. If the JNI-InChI jar file
is being used and either the current working directory, or '.' are contained
in PATH of LD_LIBRARY_PATH then the native code should be placed
automatically. If the native files are in the correct location but fail to
load, then they may need to be recompiled for your system. See:
Modifier and Type | Method and Description |
---|---|
boolean |
getIgnoreAromaticBonds()
Deprecated.
|
InChIGenerator |
getInChIGenerator(IAtomContainer container)
Gets an Standard InChI generator for a
IAtomContainer . |
InChIGenerator |
getInChIGenerator(IAtomContainer container,
List<net.sf.jniinchi.INCHI_OPTION> options)
Gets InChI generator for CDK IAtomContainer.
|
InChIGenerator |
getInChIGenerator(IAtomContainer container,
String options)
Gets InChI generator for CDK IAtomContainer.
|
InChIToStructure |
getInChIToStructure(String inchi,
IChemObjectBuilder builder)
Gets structure generator for an InChI string.
|
InChIToStructure |
getInChIToStructure(String inchi,
IChemObjectBuilder builder,
List<String> options)
Gets structure generator for an InChI string.
|
InChIToStructure |
getInChIToStructure(String inchi,
IChemObjectBuilder builder,
String options)
Gets structure generator for an InChI string.
|
static InChIGeneratorFactory |
getInstance()
Gives the one
InChIGeneratorFactory instance,
if needed also creates it. |
void |
setIgnoreAromaticBonds(boolean ignore)
Deprecated.
"the use of aromatic bonds is strongly discouraged" - InChI
FAQ, the InChI will fail for many compounds if ignore
aromatic bonds is not enabled and the compound have aromatic
flags.
|
public static InChIGeneratorFactory getInstance() throws CDKException
InChIGeneratorFactory
instance,
if needed also creates it.InChIGeneratorFactory
instanceCDKException
- if unable to load native code when attempting
to create the factory@Deprecated public void setIgnoreAromaticBonds(boolean ignore)
ignore
- if aromatic bonds should be treated as bonds of type single and double@Deprecated public boolean getIgnoreAromaticBonds()
public InChIGenerator getInChIGenerator(IAtomContainer container) throws CDKException
IAtomContainer
. AuxInfo is not
generated by this method, please use getInChIGenerator(IAtomContainer, List)
with no options specified if you would like to generate AuxInfo.container
- AtomContainer to generate InChI for.CDKException
- if the generator cannot be instantiatedpublic InChIGenerator getInChIGenerator(IAtomContainer container, String options) throws CDKException
container
- AtomContainer to generate InChI for.options
- String of options for InChI generation.CDKException
- if the generator cannot be instantiatedpublic InChIGenerator getInChIGenerator(IAtomContainer container, List<net.sf.jniinchi.INCHI_OPTION> options) throws CDKException
container
- AtomContainer to generate InChI for.options
- List of options (net.sf.jniinchi.INCHI_OPTION) for InChI generation.CDKException
- if the generator cannot be instantiatedpublic InChIToStructure getInChIToStructure(String inchi, IChemObjectBuilder builder) throws CDKException
inchi
- InChI to generate structure from.builder
- the builder to useCDKException
- if the generator cannot be instantiatedpublic InChIToStructure getInChIToStructure(String inchi, IChemObjectBuilder builder, String options) throws CDKException
Gets structure generator for an InChI string.
inchi
- InChI to generate structure from.builder
- the builder to employoptions
- String of options for structure generation.CDKException
- if the generator cannot be instantiatedpublic InChIToStructure getInChIToStructure(String inchi, IChemObjectBuilder builder, List<String> options) throws CDKException
Gets structure generator for an InChI string.
inchi
- InChI to generate structure from.options
- List of options (net.sf.jniinchi.INCHI_OPTION) for structure generation.builder
- the builder to employCDKException
- if the generator cannot be instantiatedCopyright © 2018. All Rights Reserved.