AsIs¶
The final method to be discussed is
OEFastROCSOrientation.AsIs
.
In this method, only one optimization is carried out at the query and the
database molecule’s original coordinates. No inertial starts are optimized.
When using this method, the database intended to be searched must be reloaded
using OEShapeDatabase.Open
. This ensures that the
database molecules are not centered or set to an inertial frame of reference
as is usually done. When reloading the database,
the OEFastROCSOrientation.AsIs
constant must be passed to the Open
routine:
oechem.OEThrow.Info("Opening database file %s ..." % sys.argv[2])
dbase = oefastrocs.OEShapeDatabase()
moldb = oechem.OEMolDatabase()
moldb.Open(sys.argv[2])
dbase.Open(moldb, oefastrocs.OEFastROCSOrientation_AsIs)
Next, set the OEFastROCSOrientation.AsIs
option with
OEShapeDatabaseOptions.SetInitialOrientation
:
opts.SetInitialOrientation(oefastrocs.OEFastROCSOrientation_AsIs)
This will force the number of starts and the number of inertial starts to
both equal 1. To check that the starts have been set correctly, query
OEShapeDatabaseOptions.GetNumStarts
and
OEShapeDatabaseOptions.GetNumInertialStarts
:
if opts.GetInitialOrientation() == oefastrocs.OEFastROCSOrientation_AsIs:
numStarts = opts.GetNumStarts()
numInertialStarts = opts.GetNumInertialStarts()
oechem.OEThrow.Info("This example will use %u starts & %u inertial starts"
% (numStarts, numInertialStarts))
The output from the modified Python script now looks like this:
Opening database file 3tmn_lig.sdf ...
This example will use 1 starts & 1 inertial starts
Searching for 4tmn_lig.sdf
Score for mol 0(conf 0) 0.286799 shape 0.356514 color
Download code
The fully modified python script used in this tutorial can be found here
AsIsStartsExample.py