This is a collection of prose covering many of the important topics which can be addressed by the OEChem library. This manual is meant to be read from front to back at least once. Each topic in this manual is introduced assuming the knowledge presented earlier in the manual has been read. Further, the complexity of topics as well as the complexity of the example code grows as the text progresses. While the initial listings are effectively the ‘’Hello World’’ of OEChem, later examples may require some time to comprehend fully. This manual is filled with example programs. We encourage you to compile, test and modify the examples we present.
See also
Experienced OEChem programmers should use the Application Programming Interface (API) for the most thorough reference of OEChem functionality.
First, Java needs to be able to find the OpenEye JAR files in its CLASSPATH. Add the java/libs directory to your CLASSPATH along with the JARS. Note also that this allows a single CLASSPATH to work across multiple platforms and Java versions. By default, all the files are found in a toolkit-version specific directory under the top-level openeye directory. For example, for v1.7.0-1, the path to the JAR files would be openeye/wrappers/v1.7.0-1/java. A sym-link, openeye/java, is provided to point to the latest version.
The following is a bash example for setting the CLASSPATH to include all of the toolkit libraries.
export OEJAVA="/usr/local/openeye/java"
export CLASSPATH=".:$OEJAVA/openeye.oechem.jar"
export CLASSPATH="$CLASSPATH:$OEJAVA/openeye.oebio.jar"
export CLASSPATH="$CLASSPATH:$OEJAVA/openeye.oegrid.jar"
export CLASSPATH="$CLASSPATH:$OEJAVA/openeye.oeshape.jar"
export CLASSPATH="$CLASSPATH:$OEJAVA/openeye.oezap.jar"
export CLASSPATH="$CLASSPATH:$OEJAVA/openeye.oespicoli.jar"
export CLASSPATH="$CLASSPATH:$OEJAVA/openeye.oeproton.jar"
export CLASSPATH="$CLASSPATH:$OEJAVA/openeye.oeszybki.jar"
export CLASSPATH="$CLASSPATH:$OEJAVA/openeye.oedepict.jar"
export CLASSPATH="$CLASSPATH:$OEJAVA/openeye.oeiupac.jar"
export CLASSPATH="$CLASSPATH:$OEJAVA/openeye.examples.jar"
export CLASSPATH="$CLASSPATH:$OEJAVA/libs"
To include OpenEye libraries in a Java program the libraries must be imported at the top of each .java file. This is accomplished with the following idiom:
import openeye.oechem.*;
Once the package is imported, objects can be created and methods can be called without the addition of namespace prefixes, resulting in simpler code.
Free functions are widely used in OEChem, however, they are not directly supported by Java. These free functions are static member functions of the oechem object which is automatically imported by the above idiom. This requires all OEChem free functions to be prefixed with this special oechem object like the following:
oechem.OEParseSmiles(mol, str);
Chemical information processing is the science of representing molecules in computers. Hence the fundamental “object” or data structure within a chemical information system is that of the molecule, its atoms and its bonds.
A significant problem encountered in such systems is that different applications place differing requirements or constraints on how a molecule is represented. In protein biochemistry, molecules are divided into amino acid residues with specific atom naming and conformational information such as alpha helix or beta sheet. Inorganic chemistry requires isotopic and co-ordination information for atoms and modeling of complex chiralities. One possible solution is to prescribe a single data structure that encodes all of the potential information required of a molecule. However, such an approach suffers from the fact that ‘you can not please all of the chemists, all of the time’. A requirement in the field of chemical databases and substructure searching is that a molecule representation be as compact as possible, to allow as much information to be held in memory as possible and maximize the performance of processing databases from disk. It is this reason that the molecule, its atoms and its bonds are defined in an abstract a manner as possible in OEChem.
The following is a quick guide to the chapters covering these fundamental classes: