The aim of this manual is to familiarize the user with OEGraphSim functionalities, however, it does not provide explanations of basic OEChem classes and functions. Therefore reading the OEChem manual beforehand is highly recommended.
All the Python related code will be found under openeye/python.
For Python to locate OEChem and OEGraphSim you need to set the PYTHONPATH environment variable. In your shell startup script (.bashrc for example) add the following 2 lines. (The syntax may vary if you use a shell other than bash.)
PYTHONPATH=/usr/local/openeye/python
export PYTHONPATH
This is equivalent to the following Python code.
import sys
sys.path.append("/usr/local/openeye/python")
If you installed OEChem in a different parent directory, you would use that actual location rather than /usr/local.
At the beginning of most Python programs, functionality that resides in other files is imported with the import statement. Built-in modules are usually imported in the following way:
import os, sys
Then functionality from those modules can be called by prefixing the method name with the module name as in sys.stdout.write() or os.exit(0).
OEGraphSim resides in the openeye module and is routinely imported as:
from openeye.oegraphsim import *
Where all methods and objects in the oegraphsim namespace are pulled directly into the current script’s namespace. Since OEGraphSim‘s objects and functions have unique names, there is little chance of a name clash with this particular import * call.
Once the package is imported, objects can be created and methods can be called without the addition of namespace prefixes, resulting in simpler code.