schrodinger.application.glide.http_client module¶
Glide HTTP client
This module implements objects that connect to a Glide HTTP server (see schrodinger.application.glide.http_server) and use the server to dock ligands remotely.
Sample usage:
from schrodinger import structure from schrodinger.application.glide import http_client
client = http_client.HTTPClient(host=’localhost’, port=8000) ct = structure.Structure.read(‘mylig.mae’) poses = client.dock(ct) for pose in poses:
print “gscore=%f” % pose.properties[‘r_i_glide_gscore’]
For a higher level API that also starts up and monitors the server itself,
see GlideServerManager.
-
exception
schrodinger.application.glide.http_client.ServerTimedOutError¶ Bases:
RuntimeErrorException raised if the Glide server times out
-
__init__¶ Initialize self. See help(type(self)) for accurate signature.
-
args¶
-
with_traceback()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
class
schrodinger.application.glide.http_client.GlideResult(poses, message='')¶ Bases:
objectSequence-like object containing the poses returned by Glide for one ligand. When no poses were produced, the reason is available in the .message property.
-
__init__(poses, message='')¶ Parameters: - poses (list of schrodinger.structure.Structure) – poses returned by glide (may be empty)
- message (str) – status message explaining why no poses were returned
-
__len__()¶
-
toJson()¶ Return a JSON representation of the docking result.
Returns: JSON Return type: str
-
classmethod
fromJson(json_str)¶ Construct a GlideResult from its JSON representation.
Parameters: json_str (str) – JSON representation Returns: GlideResult Return type: GlideResult
-
-
class
schrodinger.application.glide.http_client.GlideResultIterator(poses, message='')¶ Bases:
objectIterator over the poses returned by Glide for one ligand. When no poses were produced, the reason is available in the .message property.
-
__init__(poses, message='')¶ Parameters: - poses (list of schrodinger.structure.Structure) – poses returned by glide (may be empty)
- message (str) – status message explaining why no poses were returned
-
asGlideResult()¶ Convert the iterator back into a GlideResult.
Returns: GlideResult Rype: GlideResult
-
-
class
schrodinger.application.glide.http_client.AbstractHTTPClient¶ Bases:
objectInterface for connecting to a Glide HTTP server.
-
dock(ct)¶ Dock the ligand in Structure object
ctusing the remote Glide server.
-
shutdown_server()¶ Ask the Glide HTTP server to shut down.
-
static
ct_to_multipart(ct)¶ Encode a CT in multipart/form-data format, ready to POST.
Parameters: ct (structure.Structure) – Structure to encode Returns: The body of the request and the boundary Return type: tuple(str, str)
-
__init__¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
schrodinger.application.glide.http_client.HTTPClient(con=None, host='localhost', port=8000, timeout=1000)¶ Bases:
schrodinger.application.glide.http_client.AbstractHTTPClientThis class provides an API to connect to an existing Glide HTTP server. For a higher level API that also starts up and monitors the server itself, see
GlideServerManager.-
__init__(con=None, host='localhost', port=8000, timeout=1000)¶ Initialize a new HTTPClient object. The optional ‘con’ is an existing httplib.HTTPConnection object. If not provided, then ‘host’, ‘port’, and ‘timeout’ will be used to create one. The default timeout value is very large to make sure that it is enough for most docking jobs to finish.
-
dock(ct)¶ Dock the ligand in Structure object ‘ct’ using the remote Glide server.
Parameters: ct (schrodinger.structure.Structure) – input ligand Returns: docking results as an iterator Return type: GlideResultIterator
-
dockSmiles(smiles)¶ Dock a ligand from SMILES. For best results, the server should have been launched with the LIGPREP keyword enabled.
Parameters: smiles (str) – ligand SMILES Returns: docking results as an iterator Return type: GlideResultIterator
-
shutdown_server()¶ Ask the Glide HTTP server to shut down.
-
static
ct_to_multipart(ct)¶ Encode a CT in multipart/form-data format, ready to POST.
Parameters: ct (structure.Structure) – Structure to encode Returns: The body of the request and the boundary Return type: tuple(str, str)
-
-
class
schrodinger.application.glide.http_client.NonBlockingHTTPClient(host=None, port=8000)¶ Bases:
schrodinger.application.glide.http_client.AbstractHTTPClient,PyQt5.QtCore.QObjectClass for connecting to a Glide HTTP server and docking poses without blocking.
Variables: - posesDocked – Signal emitted when a ligand finishes docking. Emitted with a list of pose structures.
- noPosesDocked – Signal emitted when a ligand goes through the docking workflow, but does not return any valid poses
- errorOccurred – Signal emitted when there is an error communicating with the server.
- finished – Signal emitted when an HTTP request finishes. Note: aliased from self.manager.finished
-
posesDocked¶
-
noPosesDocked¶
-
errorOccurred¶
-
__init__(host=None, port=8000)¶ Parameters: - host (str) – Hostname for server
- port (int) – Port for server
-
dock(ct)¶ Docks the structure without blocking.
Parameters: ct (schrodinger.structure.Structure) – Structure to dock
-
dockSmiles(smiles)¶ Dock a ligand from SMILES without blocking.
Parameters: smiles (str) – ligand SMILES
-
shutdown_server()¶ Requests shutting down the server without blocking.
-
blockSignals(self, bool) → bool¶
-
childEvent(self, QChildEvent)¶
-
children(self) → List[QObject]¶
-
connectNotify(self, QMetaMethod)¶
-
static
ct_to_multipart(ct)¶ Encode a CT in multipart/form-data format, ready to POST.
Parameters: ct (structure.Structure) – Structure to encode Returns: The body of the request and the boundary Return type: tuple(str, str)
-
customEvent(self, QEvent)¶
-
deleteLater(self)¶
-
destroyed¶ destroyed(self, object: QObject = None) [signal]
-
disconnect(self)¶
-
disconnectNotify(self, QMetaMethod)¶
-
dumpObjectInfo(self)¶
-
dumpObjectTree(self)¶
-
dynamicPropertyNames(self) → List[QByteArray]¶
-
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.http_client.SubprocessJobAdapter(cmd, logfile)¶ Bases:
objectAn adapter that starts a subprocess but makes it look a bit like a jobcontrol.Job object. This class does not attempt to expose the full Job API; it only has what is actually used within this module. Its purpose is so the GlideServerManager class can treat job control jobs and subprocesses equally.
-
__init__(cmd, logfile)¶ Parameters: - cmd (list of str) – command line to execute
- logfile (file) – file to use for log stdout/stderr
-
readAgain()¶
-
Status¶
-
kill()¶
-
isComplete()¶
-
-
class
schrodinger.application.glide.http_client.AbstractGlideServerManager(keywords, jobdir='.', jobname=None, use_jc=True)¶ Bases:
object-
__init__(keywords, jobdir='.', jobname=None, use_jc=True)¶ Parameters: keywords – Glide keywords to use for the job. The only required keyword is GRIDFILE. :type keywords: dict
Parameters: - jobdir (str) – job directory
- jobname – basename for input and output files and for job control. By default, a random jobname is chosen.
- use_jc (bool) – run the Glide backend under job control?
-
start(wait=None)¶ Launch the Glide Server job. By default, returns as soon as the job is launched, but to make sure that the job is ready to dock call .isReady() until True.
Parameters: wait (int or NoneType) – if given, wait for the server to be ready up to waitseconds; if the server is still not ready then, raise a RuntimeError.
-
isReady()¶ Returns: is the server ready to dock? Return type: bool
-
waitUntilReady(timeout=60)¶ Wait for the server to be ready. If the timeout is reached and the server is still not ready, raise a RuntimeError.
Parameters: timeout (int) – maximum wait in seconds
-
stop(wait=0.0)¶ Stop the server. First it will try to send it a shutdown request via the network; if that doesn’t work, it will kill via job control.
Parameters: wait (float) – wait up to this time in seconds for the backend process to exit before killing it and returning. If wait==0.0 and the shutdown message was sent successfully via the network, return immediately without killing.
-
config¶ A dictionary with the information needed to connect with the server: host, port, and jobid. This data is obtained from a JSON file written by the server. If the file does not exist (yet?), the dict will be empty.
-
-
class
schrodinger.application.glide.http_client.GlideServerManager(*args, host='localhost', port=0, timeout=1000, **kwargs)¶ Bases:
schrodinger.application.glide.http_client.AbstractGlideServerManagerA class to start, stop, monitor, and use a Glide HTTP server. Sample use:
server = GlideServerManager({‘GRIDFILE’: ‘grid.zip’}) server.start() while not server.isReady():
time.sleep(1)poses = server.dock(st) server.stop()
-
client_module= 'schrodinger.application.glide.http_server'¶
-
config_ext= '_http.json'¶
-
__init__(*args, host='localhost', port=0, timeout=1000, **kwargs)¶ See parent class for additional arguments.
Parameters: - host – host to which the server should bind to
- port (int) – port where the server should listen. If zero, pick one automatically.
- timeout (int) – the server will shut down automatically if this time, in seconds, passes without receiving any connections.
-
dock(st)¶ Dock a ligand. Return a list of poses, which may be empty. If there was a problem connecting to the server, socket.error exceptions may be propagated.
Parameters: st (schrodinger.structure.Structure) – Structure to dock Returns: docking result Return type: GlideResult
-
dockSmiles(smiles)¶ Dock a ligand from SMILES. For best results, the server should have been launched with the LIGPREP keyword enabled.
Parameters: smiles (str) – ligand SMILES Returns: docking result Return type: GlideResult
-
client¶ Client object to be used for connecting to the Glide server process.
Return type: HTTPClient Returns: the client object.
-
config¶ A dictionary with the information needed to connect with the server: host, port, and jobid. This data is obtained from a JSON file written by the server. If the file does not exist (yet?), the dict will be empty.
-
isReady()¶ Returns: is the server ready to dock? Return type: bool
-
start(wait=None)¶ Launch the Glide Server job. By default, returns as soon as the job is launched, but to make sure that the job is ready to dock call .isReady() until True.
Parameters: wait (int or NoneType) – if given, wait for the server to be ready up to waitseconds; if the server is still not ready then, raise a RuntimeError.
-
stop(wait=0.0)¶ Stop the server. First it will try to send it a shutdown request via the network; if that doesn’t work, it will kill via job control.
Parameters: wait (float) – wait up to this time in seconds for the backend process to exit before killing it and returning. If wait==0.0 and the shutdown message was sent successfully via the network, return immediately without killing.
-
waitUntilReady(timeout=60)¶ Wait for the server to be ready. If the timeout is reached and the server is still not ready, raise a RuntimeError.
Parameters: timeout (int) – maximum wait in seconds
-
-
class
schrodinger.application.glide.http_client.NonBlockingGlideServerManager(*args, **kwargs)¶ Bases:
schrodinger.application.glide.http_client.GlideServerManager,PyQt5.QtCore.QObjectA class to use a Glide HTTP server without blocking.
Variables: - posesDocked – Signal emitted when a ligand finishes docking. Emitted with a list of pose structures.
- noPosesDocked – Signal emitted when a ligand goes through the docking workflow, but does not return any valid poses
- errorOccurred – Signal emitted when there is an error communicating with the server.
- batchFinished – Signal emitted when a docking batch finishes. Emitted with the number of ligands that were docked.
-
posesDocked¶
-
noPosesDocked¶
-
batchFinished¶
-
errorOccurred¶
-
__init__(*args, **kwargs)¶ See parent class for additional arguments.
Parameters: - host – host to which the server should bind to
- port (int) – port where the server should listen. If zero, pick one automatically.
- timeout (int) – the server will shut down automatically if this time, in seconds, passes without receiving any connections.
-
stop()¶ Stop the server. First it will try to send it a shutdown request via the network; if that doesn’t work, it will kill via job control.
Parameters: wait (float) – wait up to this time in seconds for the backend process to exit before killing it and returning. If wait==0.0 and the shutdown message was sent successfully via the network, return immediately without killing.
-
dock(st)¶ Docks a given structure
Parameters: st (structure.Structure or str) – Structure or SMILES to dock :raises RuntimeError if stop() is called on the server during startup
-
dockBatch(structures, done_adding=True)¶ Set a batch of structures to dock.
Parameters: - structures (iterable[schrodinger.structure.Structure]) – Structures to dock
- done_adding (bool) – Whether to emit batchFinished when all sts in
structuresfinish docking. Pass False if structures is a generator that can have more structures added to it at runtime.
-
cancelBatch()¶
-
addStructures(structures)¶ Add more structures to dock. Should call
setDoneAddingonce all structures have been added.Parameters: structures (iterable[schrodinger.structure.Structure]) – Structures to dock
-
setDoneAdding()¶ Call this when done adding structures to a batch; once all structures have been docked,
batchFinishedwill be emitted.
-
client¶ Client object to be used for connecting to the Glide server process.
Return type: HTTPClient Returns: the client object.
-
blockSignals(self, bool) → bool¶
-
childEvent(self, QChildEvent)¶
-
children(self) → List[QObject]¶
-
client_module= 'schrodinger.application.glide.http_server'¶
-
config¶ A dictionary with the information needed to connect with the server: host, port, and jobid. This data is obtained from a JSON file written by the server. If the file does not exist (yet?), the dict will be empty.
-
config_ext= '_http.json'¶
-
connectNotify(self, QMetaMethod)¶
-
customEvent(self, QEvent)¶
-
deleteLater(self)¶
-
destroyed¶ destroyed(self, object: QObject = None) [signal]
-
disconnect(self)¶
-
disconnectNotify(self, QMetaMethod)¶
-
dockSmiles(smiles)¶ Dock a ligand from SMILES. For best results, the server should have been launched with the LIGPREP keyword enabled.
Parameters: smiles (str) – ligand SMILES Returns: docking result Return type: GlideResult
-
dumpObjectInfo(self)¶
-
dumpObjectTree(self)¶
-
dynamicPropertyNames(self) → List[QByteArray]¶
-
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)¶
-
isReady()¶ Returns: is the server ready to dock? Return type: bool
-
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¶
-
start(wait=None)¶ Launch the Glide Server job. By default, returns as soon as the job is launched, but to make sure that the job is ready to dock call .isReady() until True.
Parameters: wait (int or NoneType) – if given, wait for the server to be ready up to waitseconds; if the server is still not ready then, raise a RuntimeError.
-
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¶
-
waitUntilReady(timeout=60)¶ Wait for the server to be ready. If the timeout is reached and the server is still not ready, raise a RuntimeError.
Parameters: timeout (int) – maximum wait in seconds
-
class
schrodinger.application.glide.http_client.NonBlockingBackendChecker(*args, **kwargs)¶ Bases:
PyQt5.QtCore.QObjectClass to get an GlideServerManager object to the ready state without blocking the GUI.
Variables: ready – Whether the backend is ready -
__init__(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
wait(timeout=60)¶ Block python execution (but not the GUI) until the backend is ready or the timeout is reached.
Parameters: timeout (int or NoneType) – Timeout in seconds or None to not timeout. Returns: Whether the backend is ready
-
setBackend(backend)¶ Set the backend object to call isReady on
-
stopChecking()¶ Stop checking whether the backend is ready
-
onServerTimeout()¶
-
blockSignals(self, bool) → bool¶
-
childEvent(self, QChildEvent)¶
-
children(self) → List[QObject]¶
-
connectNotify(self, QMetaMethod)¶
-
customEvent(self, QEvent)¶
-
deleteLater(self)¶
-
destroyed¶ destroyed(self, object: QObject = None) [signal]
-
disconnect(self)¶
-
disconnectNotify(self, QMetaMethod)¶
-
dumpObjectInfo(self)¶
-
dumpObjectTree(self)¶
-
dynamicPropertyNames(self) → List[QByteArray]¶
-
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.http_client.ZmqClient(url)¶ Bases:
PyQt5.QtCore.QObjectConnect to a Glide ZMQ driver and dock ligands synchronously.
A Glide ZMQ driver is a Glide job launched with the -mq and -server flags.
Variables: - posesDocked – Signal emitted when a ligand finishes docking. Emitted with a list of pose structures.
- noPosesDocked – Signal emitted when a ligand goes through the docking workflow, but does not return any valid poses
- noMoreLigs – Signal emitted when there are no more ligands left to dock in the server’s queue.
- gotStatus – Signal emitted when the server sends a status message. Emitted with a dict with status information. Current keys include “elapsed_time”, “ligs_done”, “poses_stored”, “ligs_per_sec”, “lps_per_worker”, “active_workers”, “idle_workers”, and “lost_workers”.
-
posesDocked¶
-
noPosesDocked¶
-
noMoreLigs¶
-
gotStatus¶
-
__init__(url)¶ Parameters: url (str) – URL of server to connect to.
-
dock(st, lignum=None)¶ Send a ligand to the server to dock. Poses are returned asynchronously via the posesDocked and noPosesDocked signals.
Parameters: - st (schrodinger.structure.Structure) – Structure to dock
- lignum (int or NoneType) – ligand index (stored by Glide in the i_i_glide_lignum property). It can be used to tell which ligand is which, because the poses are not in general returned in the same order in which the ligands are sent to the server. If not provided, a sequential number will be used. Note that unique numbers should be used, because lignum is used as a key by the server!
-
shutdown_server()¶
-
cancel()¶
-
getStatus()¶ Request a status update from the server. When the response comes, the gotStatus signal is emitted with a dict containg status information.
-
disconnect()¶ Disconnect the ZMQ socket and stop listening.
-
blockSignals(self, bool) → bool¶
-
childEvent(self, QChildEvent)¶
-
children(self) → List[QObject]¶
-
connectNotify(self, QMetaMethod)¶
-
customEvent(self, QEvent)¶
-
deleteLater(self)¶
-
destroyed¶ destroyed(self, object: QObject = None) [signal]
-
disconnectNotify(self, QMetaMethod)¶
-
dumpObjectInfo(self)¶
-
dumpObjectTree(self)¶
-
dynamicPropertyNames(self) → List[QByteArray]¶
-
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.http_client.NonBlockingGlideServerManagerZmq(*args, nworkers=2, **kwargs)¶ Bases:
schrodinger.application.glide.http_client.AbstractGlideServerManager,PyQt5.QtCore.QObjectLaunch and use Glide ZMQ server without blocking. The server and workers are run on localhost, but future versions might relax this restriction.
This class is meant as a drop-in replacement for NonBlockingGlideServerManager, but there are a couple of subtle differences in behavior: 1) when docking a batch, all ligands are sent immediately to the server, which keeps its own queue. This could be a problem when feeding an infinite iterable to dockBatch(). 2) cancelBatch() causes any currently docking ligands to be aborted, unlike NonBlockingGlideServerManager which waits for the current ligand to complete.
Variables: - posesDocked – Signal emitted when a ligand finishes docking. Emitted with a list of pose structures.
- noPosesDocked – Signal emitted when a ligand goes through the docking workflow, but does not return any valid poses
- errorOccurred – Signal emitted when there is an error communicating with the server.
- batchFinished – Signal emitted when a docking batch finishes. Emitted with the number of ligands that were docked.
- gotStatus – Signal emitted when the server sends a status message. Emitted with a dict with status information. Current keys include “elapsed_time”, “ligs_done”, “poses_stored”, “ligs_per_sec”, “lps_per_worker”, “active_workers”, “idle_workers”, and “lost_workers”.
-
config_ext= '_zmq.json'¶
-
posesDocked¶
-
noPosesDocked¶
-
batchFinished¶
-
errorOccurred¶
-
gotStatus¶
-
__init__(*args, nworkers=2, **kwargs)¶ Most arguments are passed through to GlideServerManager; see that class for documentation. Arguments specific to this class:
Parameters: nworkers (int) – number of workers to launch.
-
stop()¶ Stop the server. First it will try to send it a shutdown request via the network; if that doesn’t work, it will kill via job control.
Parameters: wait (float) – wait up to this time in seconds for the backend process to exit before killing it and returning. If wait==0.0 and the shutdown message was sent successfully via the network, return immediately without killing.
-
dock(st)¶
-
dockBatch(structures, done_adding=True, reset=True)¶ Set a batch of structures to dock.
Parameters: - structures (iterable[schrodinger.structure.Structure]) – Structures to dock
- done_adding (bool) – Whether to emit batchFinished when all sts in
structuresfinish docking. Pass False if structures is a generator that can have more structures added to it at runtime. - reset (bool) – Whether to reset the batch before adding. Pass False to expand the current batch instead of starting a new one.
-
cancelBatch()¶
-
addStructures(structures)¶ Add more structures to dock. Should call
setDoneAddingonce all structures have been added.Parameters: structures (iterable[schrodinger.structure.Structure]) – Structures to dock
-
setDoneAdding()¶ Call this when done adding structures to a batch; once all structures have been docked,
batchFinishedwill be emitted.
-
client¶
-
getStatus()¶
-
blockSignals(self, bool) → bool¶
-
childEvent(self, QChildEvent)¶
-
children(self) → List[QObject]¶
-
config¶ A dictionary with the information needed to connect with the server: host, port, and jobid. This data is obtained from a JSON file written by the server. If the file does not exist (yet?), the dict will be empty.
-
connectNotify(self, QMetaMethod)¶
-
customEvent(self, QEvent)¶
-
deleteLater(self)¶
-
destroyed¶ destroyed(self, object: QObject = None) [signal]
-
disconnect(self)¶
-
disconnectNotify(self, QMetaMethod)¶
-
dumpObjectInfo(self)¶
-
dumpObjectTree(self)¶
-
dynamicPropertyNames(self) → List[QByteArray]¶
-
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)¶
-
isReady()¶ Returns: is the server ready to dock? Return type: bool
-
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¶
-
start(wait=None)¶ Launch the Glide Server job. By default, returns as soon as the job is launched, but to make sure that the job is ready to dock call .isReady() until True.
Parameters: wait (int or NoneType) – if given, wait for the server to be ready up to waitseconds; if the server is still not ready then, raise a RuntimeError.
-
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¶
-
waitUntilReady(timeout=60)¶ Wait for the server to be ready. If the timeout is reached and the server is still not ready, raise a RuntimeError.
Parameters: timeout (int) – maximum wait in seconds
-
schrodinger.application.glide.http_client.st_from_blob(blob)¶ Return a Structure from a compressed blob.
Parameters: blob (bytes) – compressed m2io representation of a structure Returns: Structure Return type: schrodinger.structure.Structure