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[source]

Bases: RuntimeError

Exception raised if the Glide server is not ready after MAX_WAIT

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class schrodinger.application.glide.http_client.GlideResult(poses, message='')[source]

Bases: object

Sequence-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='')[source]
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__()[source]
toJson()[source]

Return a JSON representation of the docking result.

Returns

JSON

Return type

str

classmethod fromJson(json_str)[source]

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='')[source]

Bases: object

Iterator 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='')[source]
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()[source]

Convert the iterator back into a GlideResult.

Returns

GlideResult

Rype

GlideResult

class schrodinger.application.glide.http_client.AbstractHTTPClient[source]

Bases: object

Interface for connecting to a Glide HTTP server.

dock(ct)[source]

Dock the ligand in Structure object ct using the remote Glide server.

shutdown_server()[source]

Ask the Glide HTTP server to shut down.

static ct_to_multipart(ct)[source]

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.HTTPClient(con=None, host='localhost', port=8000, timeout=1000)[source]

Bases: schrodinger.application.glide.http_client.AbstractHTTPClient

This 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)[source]

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)[source]

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

setReferenceLigand(ct)[source]

Tell the server to use a new reference ligand when docking subsequent ligands. (This only has an effect if the job started with a reference ligand, for example when the job uses core constraints.)

Parameters

ct (schrodinger.structure.Structure) – new reference ligand

Returns

Glide results iterator (empty, but with an “Updated reflig” message)

Return type

GlideResultIterator

dockSmiles(smiles)[source]

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()[source]

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)[source]

Bases: schrodinger.application.glide.http_client.AbstractHTTPClient, PyQt5.QtCore.QObject

Class 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)[source]
Parameters
  • host (str) – Hostname for server

  • port (int) – Port for server

dock(ct)[source]

Docks the structure without blocking.

Parameters

ct (schrodinger.structure.Structure) – Structure to dock

dockSmiles(smiles)[source]

Dock a ligand from SMILES without blocking.

Parameters

smiles (str) – ligand SMILES

shutdown_server()[source]

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(QMetaObject.Connection) bool
disconnect(self) None
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)[source]

Bases: object

An 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)[source]
Parameters
  • cmd (list of str) – command line to execute

  • logfile (file) – file to use for log stdout/stderr

readAgain()[source]
property Status
kill()[source]
isComplete()[source]
class schrodinger.application.glide.http_client.AbstractGlideServerManager(keywords, jobdir='.', jobname=None, use_jc=True)[source]

Bases: object

__init__(keywords, jobdir='.', jobname=None, use_jc=True)[source]
Parameters
  • keywords (dict) – Glide keywords to use for the job. The only required keyword is GRIDFILE.

  • jobdir (str) – job directory

  • jobname (str) – 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)[source]

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 wait seconds; if the server is still not ready then, raise a RuntimeError.

isReady()[source]
Returns

is the server ready to dock?

Return type

bool

waitUntilReady(timeout=60)[source]

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)[source]

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.

property 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)[source]

Bases: schrodinger.application.glide.http_client.AbstractGlideServerManager

A 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)[source]

See parent class for additional arguments.

Parameters
  • host (str) – 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)[source]

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)[source]

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

setReferenceLigand(st)[source]

Tell the server to use a new reference ligand when docking subsequent ligands. (This only has an effect if the job started with a reference ligand, for example when the job uses core constraints.)

Parameters

st (schrodinger.structure.Structure) – new reference ligand

Returns

Glide result (empty, but with an “Updated reflig” message)

Return type

GlideResult

property client

Client object to be used for connecting to the Glide server process.

Return type

HTTPClient

Returns

the client object.

property 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 wait seconds; 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)[source]

Bases: schrodinger.application.glide.http_client.GlideServerManager, PyQt5.QtCore.QObject

A 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)[source]

See parent class for additional arguments.

Parameters
  • host (str) – 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(*args, **kwargs)[source]

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)[source]

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)[source]

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 structures finish docking. Pass False if structures is a generator that can have more structures added to it at runtime.

cancelBatch()[source]
addStructures(structures)[source]

Add more structures to dock. Should call setDoneAdding once all structures have been added.

Parameters

structures (iterable[schrodinger.structure.Structure]) – Structures to dock

setDoneAdding()[source]

Call this when done adding structures to a batch; once all structures have been docked, batchFinished will be emitted.

property 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'
property 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(QMetaObject.Connection) bool
disconnect(self) None
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
setReferenceLigand(st)

Tell the server to use a new reference ligand when docking subsequent ligands. (This only has an effect if the job started with a reference ligand, for example when the job uses core constraints.)

Parameters

st (schrodinger.structure.Structure) – new reference ligand

Returns

Glide result (empty, but with an “Updated reflig” message)

Return type

GlideResult

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 wait seconds; 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)[source]

Bases: PyQt5.QtCore.QObject

Class to get an GlideServerManager object to the ready state without blocking the GUI.

Variables

ready – Whether the backend is ready

__init__(*args, **kwargs)[source]
wait(timeout=60)[source]

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)[source]

Set the backend object to call isReady on

stopChecking()[source]

Stop checking whether the backend is ready

onServerTimeout(*, msg=None)[source]
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(QMetaObject.Connection) bool
disconnect(self) None
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)[source]

Bases: PyQt5.QtCore.QObject

Connect 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)[source]
Parameters

url (str) – URL of server to connect to.

dock(st, lignum=None)[source]

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()[source]
cancel()[source]
getStatus()[source]

Request a status update from the server. When the response comes, the gotStatus signal is emitted with a dict containg status information.

disconnect()[source]

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)[source]

Bases: schrodinger.application.glide.http_client.AbstractGlideServerManager, PyQt5.QtCore.QObject

Launch 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)[source]

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(*args, **kwargs)[source]

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)[source]
dockBatch(structures, done_adding=True, reset=True)[source]

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 structures finish 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()[source]
addStructures(structures)[source]

Add more structures to dock. Should call setDoneAdding once all structures have been added.

Parameters

structures (iterable[schrodinger.structure.Structure]) – Structures to dock

setDoneAdding()[source]

Call this when done adding structures to a batch; once all structures have been docked, batchFinished will be emitted.

property client
getStatus()[source]
start(*args, **kwargs)[source]

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 wait seconds; if the server is still not ready then, raise a RuntimeError.

blockSignals(self, bool) bool
childEvent(self, QChildEvent)
children(self) List[QObject]
property 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(QMetaObject.Connection) bool
disconnect(self) None
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
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)[source]

Return a Structure from a compressed blob.

Parameters

blob (bytes) – compressed m2io representation of a structure

Returns

Structure

Return type

schrodinger.structure.Structure