schrodinger.application.glide.ligand_designer module¶
This module provides the APIs behind the Ligand Designer panel and workflow. It combines binding site Phase hypothesis generation with R-group enumeration and Glide grid generation and docking. The docking uses a Glide HTTP server for speed.
-
class
schrodinger.application.glide.ligand_designer.
State
¶ Bases:
enum.Enum
An enumeration.
-
NEW
= 1¶
-
READY
= 4¶
-
RUNNING_GRIDGEN
= 2¶
-
STARTING_SERVER
= 3¶
-
STOPPED
= 5¶
-
-
class
schrodinger.application.glide.ligand_designer.
Pose
(structure, source_lig)¶ Bases:
tuple
-
__contains__
¶ Return key in self.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
__len__
¶ Return len(self).
-
count
(value) → integer -- return number of occurrences of value¶
-
index
(value[, start[, stop]]) → integer -- return first index of value.¶ Raises ValueError if the value is not present.
-
source_lig
¶ Alias for field number 1
-
structure
¶ Alias for field number 0
-
-
class
schrodinger.application.glide.ligand_designer.
Site
¶ Bases:
object
Base class for a generic “hypothesis site”. A site is defined by a point in space (.xyz property) and has a method to check whether a pose satisfies the desired interaction.
Subclasses must override the .xyz property.
-
xyz
¶ Returns: Cartesian coordinates of this site Return type: iterable(float, float, float)
-
isSatisfied
(pose)¶ Check if a pose satisfies the interaction with the given site.
Return type: bool
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
schrodinger.application.glide.ligand_designer.
PhaseSite
(site)¶ Bases:
schrodinger.application.glide.ligand_designer.Site
A site from a Phase hypothesis.
-
__init__
(site)¶ Parameters: site (schrodinger.infra.phase.PhpSite) – Phase site
-
xyz
¶ Returns: Cartesian coordinates of this site Return type: iterable(float, float, float)
-
isSatisfied
(pose)¶ Check if a pose satisfies the interaction with the given site.
Return type: bool
-
-
class
schrodinger.application.glide.ligand_designer.
WatermapSite
(atom, wmap_eid)¶ Bases:
schrodinger.application.glide.ligand_designer.Site
A WaterMap site.
-
__init__
(atom, wmap_eid)¶ Parameters: - atom (schrodinger.structure._StructureAtom) – WaterMap site atom
- wmap_eid (str or NoneType) – WaterMap entry ID, used to identify the structure to which this site belongs
-
xyz
¶ Returns: Cartesian coordinates of this site Return type: iterable(float, float, float)
-
dg
¶ Returns: the WaterMap dG value, if available Return type: float or None
-
name
¶ Returns: the name of this WaterMap site Return type: str
-
wmap_eid
¶ Returns: the WaterMap entry ID Return type: str or NoneType
-
isSatisfied
(pose)¶ True if any ligand atoms are within WMAP_DISPLACEMENT_CUTOFF of the WaterMap site.
-
-
class
schrodinger.application.glide.ligand_designer.
SphereSite
(sphere_data)¶ Bases:
schrodinger.application.glide.ligand_designer.Site
A site for a growth space sphere.
-
__init__
(sphere_data)¶ Parameters: sphere_data (namedtuple(float, float, float, float)) – The sphere’s x, y, z coordinates and radius
-
xyz
¶ Returns: Cartesian coordinates of this site Return type: iterable(float, float, float)
-
isSatisfied
(pose)¶ True if any ligand atoms are within the sphere
-
-
class
schrodinger.application.glide.ligand_designer.
FilterWrapper
(filter_obj, descriptors=None)¶ Bases:
object
A wrapper for schrodinger.ui.qt.filter_dialog_dir.filter_core.Filter to filter an iterable of Structure while computing RDKit descriptors, modifying the structure in-place.
Variables: structures_checked – How many structures were passed to filterStructures
-
__init__
(filter_obj, descriptors=None)¶ Parameters: - filter_obj (schrodinger.ui.qt.filter_dialog_dir.filter_core.Filter) – Filter object to wrap
- descriptors (iterable of str) – names of descriptors to add to each structure, in addition to those that are required by the filters.
-
filterStructures
(structures)¶ Generator which filters an iterable of structures, yielding those that pass, after adding descriptor properties to them. The input structures are modified.
Parameters: structures (iterable of schrodinger.structure.Structure) – structures to filter Return type: generator of schrodinger.structure.Structure
-
-
class
schrodinger.application.glide.ligand_designer.
LigandDesignerTask
(keywords=None, tmpdir=None, *args, **kwargs)¶ Bases:
schrodinger.models.parameters.CompoundParam
A LigandDesignerTask stores a ligand, a receptor, and optionally a WaterMap, and provides methods for finding hypotheses and finding which bonds may be enumerated upon for a given hypothesis.
Variables: - GRIDGEN_RETRIES – Number of times to check whether gridgen is finished
- DOCK_WAIT – Time in seconds to wait for
runBlocking
to finish docking - input (_LigandDesignerInput) – Task input
- output (list[Pose]) – List of poses resulting from enumeration job
- enumeration_errors (list[Exception]) – List of errors resulting from enumeration job
- filter_obj (filter_core.Filter) – object responsible for storing filter settings for the enumerated poses
- backendReady – Signal emitted when backend becomes ready
- serverTimedOut – Signal emitted when server is not ready after
GRIDGEN_RETRIES
- enumerationFinished – Signal emitted when an enumeration job finishes. Emitted with the number of enumerated ligands, ligands matching the filter, poses docked, and poses satisfied.
-
input
¶ Variables: - ligand_st (schrodinger.Structure.structure) – ligand structure
- receptor_st (schrodinger.Structure.structure) – receptor structure
- wmap_sts (list(schrodinger.Structure.structure)) – watermap structures
- site (Site) – target site
- leaving_atom_index – this atom and others reachable from it in the direction “away” from the core will be replaced by the R-group
- r_groups (iterable of schrodinger.structure.Structure) – R-group library
-
output
¶ A Param to represent lists. Values of this param will have a
mutated
signal that will be emitted whenever any mutation method is called.The constructor optionally takes a
item_class
keyword argument to specify what type of class the items in the list will be. This information will be used for jsonifying the list if specified.
-
enumeration_errors
¶ A Param to represent lists. Values of this param will have a
mutated
signal that will be emitted whenever any mutation method is called.The constructor optionally takes a
item_class
keyword argument to specify what type of class the items in the list will be. This information will be used for jsonifying the list if specified.
-
backendReady
¶
-
serverTimedOut
¶
-
jobStarted
¶
-
posesDocked
¶
-
enumerationFinished
¶
-
GRIDGEN_RETRIES
= 600¶
-
DOCK_WAIT
= 60¶
-
__init__
(keywords=None, tmpdir=None, *args, **kwargs)¶ Parameters: - keywords – See
LigandDesigner
for documentation - tmpdir – See
LigandDesigner
for documentation
- keywords – See
-
filter_obj
¶
-
backend
¶
-
hypo
¶
-
getHypoCt
()¶ Get the Phase ligand hypothesis for the binding site as a Structure.
Return type: schrodinger.Structure
-
getCurrentInteractions
(start=None)¶ Parameters: start (int or NoneType) – Starting index to renumber sites or None to not renumber Returns: receptor sites from PhpComplex Return type: list[phase.PhpSite]
-
getPotentialInteractions
(start=None)¶ Parameters: start (int or NoneType) – Starting index to renumber sites or None to not renumber Returns: receptor sites from PhpDeNovoPharm Return type: list[phase.PhpSite]
-
getBindingSiteAtoms
()¶ Returns: Atom indices of the receptor that are close to the ligand Return type: list[int]
-
getWmapSites
()¶ The WaterMap sites, as a dict by name, sorted by delta G.
-
getSite
(site_name)¶ Return a Site by name. It may be a WatermapSite (conventinally named W1, W2, etc.) or a Phase hypothesis site (with names such as D1, D2 for donors; A1, A2 for acceptors; R1, R2 for aromatic rings; etc.).
-
getBonds
(min_angle=90.0)¶ Return a list of ligand bonds that could be broken to perform an R-group enumeration in an attempt to satisfy the interaction with a given site.
Parameters: min_angle (float) – minimum angle, in degrees, between the site and the bond to be broken for R-group enumeration, with the leaving atom at the vertex Returns: list of (staying_atom_index, leaving_atom_index) tuples Return type: list of (int, int)
-
run
()¶ If inputs are valid, run the job. This method should be used when running from a GUI.
Raises: RuntimeError – if the job cannot run
-
runBlocking
()¶ If inputs are valid, run the job and block until finished. This method should be used when running from a script.
Raises: RuntimeError – if the job cannot run
-
DataClass
¶ alias of
builtins.object
-
aboutToReplace
¶
-
blockSignals
(self, bool) → bool¶
-
childEvent
(self, QChildEvent)¶
-
children
(self) → object¶
-
connectNotify
(self, QMetaMethod)¶
-
customEvent
(self, QEvent)¶
-
deleteLater
(self)¶
-
destroyed
¶ destroyed(self, QObject = None) [signal]
-
disconnect
(self)¶
-
disconnectNotify
(self, QMetaMethod)¶
-
dumpObjectInfo
(self)¶
-
dumpObjectTree
(self)¶
-
dynamicPropertyNames
(self) → object¶
-
enumeration_errorsChanged
¶
-
enumeration_errorsReplaced
¶
-
event
(self, QEvent) → bool¶
-
eventFilter
(self, QObject, QEvent) → bool¶
-
findChild
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject¶ findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
-
findChildren
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]¶ findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
-
classmethod
fromJson
(json_obj)¶ A factory method which constructs a new object from a given dict loaded from a json string or file.
Parameters: json_obj (dict) – A json-loaded dictionary to create an object from. Returns: An instance of this class. :rtype : cls
-
classmethod
fromJsonImplementation
(json_dict)¶ Sets the value of this compound param value object from a JSON dict.
-
get_version
()¶ Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
-
inherits
(self, str) → bool¶
-
initAbstract
()¶ Override this method to define logic specfically for initializing abstract instances of this param.
-
initConcrete
()¶ Override this method to define logic specfically for initializing concrete instances of this param. This will generally only run for compound params, as atomic params are not typically instantiated outside of class declaration.
-
inputChanged
¶
-
inputReplaced
¶
-
installEventFilter
(self, QObject)¶
-
isDefault
()¶
-
isSignalConnected
(self, QMetaMethod) → bool¶
-
isWidgetType
(self) → bool¶
-
isWindowType
(self) → bool¶
-
is_abstract
= True¶
-
killTimer
(self, int)¶
-
metaObject
(self) → QMetaObject¶
-
moveToThread
(self, QThread)¶
-
objectName
(self) → str¶
-
objectNameChanged
¶ objectNameChanged(self, str) [signal]
-
outputChanged
¶
-
outputReplaced
¶
-
owner
()¶ Returns the owner of this param. Works for both concrete and abstract params. Returns None if the param has no owner. Follows the same rules as ownerChain.
-
ownerChain
()¶ Returns the owner chain for this param. This works for concrete params and abstract params. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a regular param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, bar, atom.coord, x]
where Foo is a class and all other items are abstract params.
-
parent
(self) → QObject¶
-
property
(self, str) → Any¶
-
pyqtConfigure
(...)¶ Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
-
receivers
(self, PYQT_SIGNAL) → int¶
-
removeEventFilter
(self, QObject)¶
-
reset
(*args)¶ Resets this compound param to its default value. If no arguments are passed in, the entire param is reset. Any number of abstract params may be optionally passed in to perform a partial reset to default value of specified sub-params. For example, given a compound param with two xyz coordinates as endpoints:
- class Line(CompoundParam):
- start = Coord(x=1, y=2, z=3) end = Coord(x=4, y=5, z=6)
line = Line()
We can reset the entire line:
line.reset()Or just certain parts:
line.reset(Line.start.x) # resets just start.x line.start.reset(Coord.x) # another way to reset start.x line.reset(Line.end) # resets the entire end point line.reset(Line.start.z, Line.end.z) # resets the z-coord of bothParameters: args – abstract sub-params of self
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setObjectName
(self, str)¶
-
setParent
(self, QObject)¶
-
setProperty
(self, str, Any) → bool¶
-
setValue
(value=None, **kwargs)¶ Set the value of this compound param instance. This mutates the compound param to be equal to
value
; it does not make the compound param /identical/ tovalue
.Parameters: value (self.DataClass or dict) – either another param instance of the same type or a dictionary mapping the sub-param names to values.
-
signalsBlocked
(self) → bool¶
-
startTimer
(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int¶
-
staticMetaObject
= <PyQt5.QtCore.QMetaObject object>¶
-
suspend_signals
()¶
-
thread
(self) → QThread¶
-
timerEvent
(self, QTimerEvent)¶
-
toDict
()¶
-
toJson
(_mark_version=True)¶ Create and returns a data structure made up of jsonable items.
Return type: An instance of one the classes from NATIVE_JSON_DATATYPES
-
toJsonImplementation
()¶ Returns a JSON representation of this value object.
-
tr
(self, str, disambiguation: str = None, n: int = -1) → str¶
-
valueChanged
¶
-
class
schrodinger.application.glide.ligand_designer.
LigandDesigner
(ligand_st, receptor_st, keywords=None, tmpdir=None)¶ Bases:
PyQt5.QtCore.QObject
A LigandDesigner is set up with a ligand and a receptor. It provides methods for performing the enumeration job. This is an R-group enumeration on a single bond, followed by core-constrained Glide docking of each generated ligand and a filter to ensure that the poses satisfy the hypothesis.
A LigandDesigner keeps its state and intermediate files in a scratch directory. A unique subdirectory is created for each ligand-receptor complex; if another object is created for the same complex, it will share the same directory. This allows the reuse of existing grid files, for example. However, only one LigandDesigner at a time can be performing an enumeration because the underlying Glide server process is single-threaded.
The LigandDesigner implements a non-blocking workflow, so the caller needs to take action to drive it. This is done by calling the isReady() method until true. Example:
ld = LigandDesigner(lig, recep) while not ld.isReady():
time.sleep(1)# now we are ready!
The idea is that the caller is free to do other stuff while waiting; for example, interacting with the user.
-
__init__
(ligand_st, receptor_st, keywords=None, tmpdir=None)¶ Parameters: - ligand_st (schrodinger.Structure.structure) – ligand structure
- receptor_st (schrodinger.Structure.structure) – receptor structure
- keywords (dict) – docking keywords to use to override the defaults
- tmpdir (path-like object) – directory under which the job files will be written. Default is $SCHRODINGER_TMPDIR.
-
default_docking_keywords
¶
-
state
¶
-
start
()¶ Start the ligand designer workflow.
-
stop
()¶ Stop the ligand designer workflow.
-
isReady
()¶ Return True if the LigandDesigner is ready to enumerate. This method has the side effect of taking steps to advance towards the READY state.
Returns: server is ready? Return type: bool
-
startEnumeration
(site, atom, rgroups, filter_wrapper=None)¶ Start asynchronous enumeration. If there was a problem with the server, the method will return (not raise!) an exception.
Parameters: - site (Site) – target site
- atom (int) – leaving atom index (this atom and others reachable from it in the direction “away” from the core will be replaced by the R-group).
- rgroups (iterable of schrodinger.structure.Structure) – R-group library
- filter_wrapper (FilterWrapper) – optional filter to apply to the enumeration output
Return type: Exception or NoneType
-
blockSignals
(self, bool) → bool¶
-
childEvent
(self, QChildEvent)¶
-
children
(self) → object¶
-
connectNotify
(self, QMetaMethod)¶
-
customEvent
(self, QEvent)¶
-
deleteLater
(self)¶
-
destroyed
¶ destroyed(self, QObject = None) [signal]
-
disconnect
(self)¶
-
disconnectNotify
(self, QMetaMethod)¶
-
dumpObjectInfo
(self)¶
-
dumpObjectTree
(self)¶
-
dynamicPropertyNames
(self) → object¶
-
event
(self, QEvent) → bool¶
-
eventFilter
(self, QObject, QEvent) → bool¶
-
findChild
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject¶ findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
-
findChildren
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]¶ findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
-
inherits
(self, str) → bool¶
-
installEventFilter
(self, QObject)¶
-
isSignalConnected
(self, QMetaMethod) → bool¶
-
isWidgetType
(self) → bool¶
-
isWindowType
(self) → bool¶
-
killTimer
(self, int)¶
-
metaObject
(self) → QMetaObject¶
-
moveToThread
(self, QThread)¶
-
objectName
(self) → str¶
-
objectNameChanged
¶ objectNameChanged(self, str) [signal]
-
parent
(self) → QObject¶
-
property
(self, str) → Any¶
-
pyqtConfigure
(...)¶ Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
-
receivers
(self, PYQT_SIGNAL) → int¶
-
removeEventFilter
(self, QObject)¶
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setObjectName
(self, str)¶
-
setParent
(self, QObject)¶
-
setProperty
(self, str, Any) → bool¶
-
signalsBlocked
(self) → bool¶
-
startTimer
(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int¶
-
staticMetaObject
= <PyQt5.QtCore.QMetaObject object>¶
-
thread
(self) → QThread¶
-
timerEvent
(self, QTimerEvent)¶
-
tr
(self, str, disambiguation: str = None, n: int = -1) → str¶
-
-
class
schrodinger.application.glide.ligand_designer.
GridgenJob
(receptor_st, ligand_st, jobdir)¶ Bases:
object
-
__init__
(receptor_st, ligand_st, jobdir)¶ Parameters: - ligand_st (schrodinger.Structure.structure) – ligand structure
- receptor_st (schrodinger.Structure.structure) – receptor structure
- jobdir (path-like object) – job directory
-
writeInputs
()¶ Write the input files.
-
launch
()¶ Launch the gridgen job.
-
isDone
()¶ Return true if the gridgen job is done. This is based in the existence of the grid file and, if available, the job record.
-
-
schrodinger.application.glide.ligand_designer.
read_json_file
(filename)¶ Read a JSON file. If there are issues reading it (doesn’t exist, syntax errors…) quietly return an empty dict.
Return type: object
-
schrodinger.application.glide.ligand_designer.
md5sum
(input_str)¶ MD5 hex digest of a string.
Return type: str
-
schrodinger.application.glide.ligand_designer.
get_structure_digest
(st, length=8)¶ Return an abbreviated MD5 hex digest given a Structure, after stripping out the structure-level properties.
Parameters: - st (schrodinger.structure.Structure) – input structure (not modified)
- length (int) – digest length in hex digits
Returns: hex digest
Return type: str