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__
¶ alias of
enum.EnumMeta
-
__members__
= mappingproxy(OrderedDict([('NEW', <State.NEW: 1>), ('RUNNING_GRIDGEN', <State.RUNNING_GRIDGEN: 2>), ('STARTING_SERVER', <State.STARTING_SERVER: 3>), ('READY', <State.READY: 4>), ('STOPPED', <State.STOPPED: 5>)]))¶
-
__module__
= 'schrodinger.application.glide.ligand_designer'¶
-
-
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.
-
isSatisfied
(pose)¶ Check if a pose satisfies the interaction with the given site.
Return type: bool
-
__class__
¶ alias of
builtins.type
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.glide.ligand_designer', '__doc__': '\n Base class for a generic "hypothesis site". A site is defined by a point in\n space (.xyz property) and has a method to check whether a pose satisfies\n the desired interaction.\n ', 'isSatisfied': <function Site.isSatisfied>, '__dict__': <attribute '__dict__' of 'Site' objects>, '__weakref__': <attribute '__weakref__' of 'Site' objects>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.glide.ligand_designer'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
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
-
__class__
¶ alias of
builtins.type
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.glide.ligand_designer', '__doc__': '\n A site from a Phase hypothesis.\n ', '__init__': <function PhaseSite.__init__>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.glide.ligand_designer'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
isSatisfied
(pose)¶ Check if a pose satisfies the interaction with the given site.
Return type: bool
-
-
class
schrodinger.application.glide.ligand_designer.
WatermapSite
(atom)¶ Bases:
schrodinger.application.glide.ligand_designer.Site
A WaterMap site.
-
__init__
(atom)¶ Parameters: atom – WaterMap site
-
isSatisfied
(pose)¶ True if any ligand atoms are within WMAP_DISPLACEMENT_CUTOFF of the WaterMap site.
-
__class__
¶ alias of
builtins.type
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.glide.ligand_designer', '__doc__': '\n A WaterMap site.\n ', '__init__': <function WatermapSite.__init__>, 'isSatisfied': <function WatermapSite.isSatisfied>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.glide.ligand_designer'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
schrodinger.application.glide.ligand_designer.
LigandDesigner
(ligand_st, receptor_st, wmap_st=None, keywords=None, tmpdir=None)¶ Bases:
object
A LigandDesigner is set up with a ligand, a receptor, and optionally a WaterMap, and provides methods for finding the hypotheses, finding which bonds may be enumerated upon for a given hypothesis, and performing the actual enumeration. 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, wmap_st=None, keywords=None, tmpdir=None)¶ Parameters: - ligand_st (schrodinger.Structure.structure) – ligand structure
- receptor_st (schrodinger.Structure.structure) – receptor structure
- wmap_st (schrodinger.Structure.structure) – watermap 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
¶
-
hypo
¶
-
getHypoCt
()¶ Get the Phase ligand hypothesis for the binding site as a Structure.
Return type: schrodinger.Structure
-
wmap_sites
¶ 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.).
-
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
-
getBonds
(site, 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.
Returns: list of (staying_atom_index, leaving_atom_index) tuples
Return type: list of (int, int)
Parameters: - site (Site) – site
- 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
-
getEnumerator
(site, atom, rgroups)¶ Return a generator of poses. If there was a problem with the server, the generator will yield (not raise!) an exception instead of a Structure. It is then up to the caller to wait for the server to be ready again and retry, if desired.
The unusual error handling mechanism is a way for the generator to keep state so it can retry where it left off, letting the client decide whether to retry and how to wait for the server to restart. For example:
gen = ld.getEnumerator(site, atom, rgroups) for i in range(MAX_RETRIES):
- for st in gen:
- if isinstance(st, Exception)
- wait_for_server(ld) break # retry
frobnicate(st)
- else:
- break # all done!
- else:
- complain(“failed after max retries”)
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
-
__class__
¶ alias of
builtins.type
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.glide.ligand_designer', '__doc__': '\n A LigandDesigner is set up with a ligand, a receptor, and optionally a\n WaterMap, and provides methods for finding the hypotheses, finding which\n bonds may be enumerated upon for a given hypothesis, and performing the\n actual enumeration. This is an R-group enumeration on a single bond,\n followed by core-constrained Glide docking of each generated ligand and a\n filter to ensure that the poses satisfy the hypothesis.\n\n A LigandDesigner keeps its state and intermediate files in a scratch\n directory. A unique subdirectory is created for each ligand-receptor\n complex; if another object is created for the same complex, it will share\n the same directory. This allows the reuse of existing grid files, for\n example. However, only one LigandDesigner at a time can be performing an\n enumeration because the underlying Glide server process is single-threaded.\n\n The LigandDesigner implements a non-blocking workflow, so the caller needs\n to take action to drive it. This is done by calling the isReady() method\n until true. Example:\n\n ld = LigandDesigner(lig, recep)\n while not ld.isReady():\n time.sleep(1)\n # now we are ready!\n\n The idea is that the caller is free to do other stuff while waiting; for\n example, interacting with the user.\n ', '__init__': <function LigandDesigner.__init__>, 'default_docking_keywords': <property object>, 'hypo': <property object>, 'getHypoCt': <function LigandDesigner.getHypoCt>, 'wmap_sites': <property object>, 'getSite': <function LigandDesigner.getSite>, 'state': <property object>, 'start': <function LigandDesigner.start>, 'stop': <function LigandDesigner.stop>, 'isReady': <function LigandDesigner.isReady>, 'getBonds': <function LigandDesigner.getBonds>, 'getEnumerator': <function LigandDesigner.getEnumerator>, '_getRgroupEnumerator': <function LigandDesigner._getRgroupEnumerator>, '_getJobDir': <function LigandDesigner._getJobDir>, '_createJobDir': <function LigandDesigner._createJobDir>, '__dict__': <attribute '__dict__' of 'LigandDesigner' objects>, '__weakref__': <attribute '__weakref__' of 'LigandDesigner' objects>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.glide.ligand_designer'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
schrodinger.application.glide.ligand_designer.
GridgenJob
(receptor_st, ligand_st, jobdir, jobname='grid')¶ Bases:
object
-
__init__
(receptor_st, ligand_st, jobdir, jobname='grid')¶ Parameters: - ligand_st (schrodinger.Structure.structure) – ligand structure
- receptor_st (schrodinger.Structure.structure) – receptor structure
- jobdir (path-like object) – job directory
- jobname (str) – basename for input and output files
-
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.
-
__class__
¶ alias of
builtins.type
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.glide.ligand_designer', '__init__': <function GridgenJob.__init__>, 'writeInputs': <function GridgenJob.writeInputs>, 'launch': <function GridgenJob.launch>, 'isDone': <function GridgenJob.isDone>, '__dict__': <attribute '__dict__' of 'GridgenJob' objects>, '__weakref__': <attribute '__weakref__' of 'GridgenJob' objects>, '__doc__': None})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.glide.ligand_designer'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
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