deeporigin.drug_discovery.docking¶
Not yet released
This class isn't yet available on the latest release of the deeporigin client. Use the Complex class and methods on Protein and Ligand objects.
A unified class to perform molecular docking on DeepOrigin.
Attributes¶
Classes¶
Docking
¶
Bases: Execution, SyncExecutableMixin, AsyncExecutableMixin, NotebookWatchMixin
Molecular docking via the tools API (client.executions.create).
The execution request body includes sync (true = blocking, false =
immediate DTO). :meth:run sets "sync": true for exactly one ligand; the
server blocks until the run finishes and returns the completed execution.
:meth:quote (default mode="async") and :meth:start set "sync": false (non-blocking).
:meth:start is for multiple ligands only: one create with all ligands. The
call returns immediately with an execution DTO. For a single ligand, use
:meth:run instead of :meth:start. Track async jobs with .sync(),
from_id(), and list(). In Jupyter, use
await docking.watch() or await docking.watch_async() (see
:class:~deeporigin.drug_discovery.notebook_watch_mixin.NotebookWatchMixin).
Attributes:
| Name | Type | Description |
|---|---|---|
protein |
Protein
|
Target protein structure. |
ligands |
LigandSet
|
Set of ligands to dock. |
pocket |
Pocket
|
Binding pocket defining the docking box. |
effort |
int
|
Docking effort level (1 = fastest, 5 = most thorough). |
name |
Execution label, set automatically from protein and ligands unless overridden. |
|
batch_size |
int
|
For async :meth: |
Attributes¶
name
instance-attribute
¶
name = (
name
if name is not None
else _docking_default_name(protein, ligands)
)
tool_key
class-attribute
instance-attribute
¶
tool_key: str = TOOL_KEYS_AND_VERSIONS["docking"][
"tool_key"
]
Functions¶
from_dto
classmethod
¶
from_dto(
dto: dict, *, client: DeepOriginClient | None = None
) -> Self
Construct a Docking instance from an execution DTO.
Rehydrates the protein, pocket, and ligands from the stored
userInputs. Protein and ligand structure files are not downloaded;
Protein.remote_path and each ligand's remote_path are set from
the execution payload (and API metadata) so you can call
:meth:~deeporigin.drug_discovery.structures.entity.Entity.download
later if needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dto
|
dict
|
Execution payload (same shape as |
required |
client
|
DeepOriginClient | None
|
Optional API client. Uses the default if not provided. |
None
|
Returns:
| Type | Description |
|---|---|
Self
|
A fully-hydrated Docking instance with status from the DTO. |
get_poses
¶
get_poses(*, all_poses: bool = False) -> LigandSet
Download pose SDFs from the platform and return a LigandSet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
all_poses
|
bool
|
If True, download all poses for each ligand. If False (default), download only the best pose per ligand. |
False
|
Returns:
| Type | Description |
|---|---|
LigandSet
|
A |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no execution has been started. |
DeepOriginException
|
If no poses could be loaded. |
get_results
¶
get_results(
dto: dict[str, Any] | None = None,
*,
all_poses: bool = False
) -> LigandSet
Load docked poses for this execution from the data platform or jobOutputs.
Tries :meth:~deeporigin.drug_discovery.structures.ligand.LigandSet.from_result
first (fast metadata path, no SDF download). On failure, parses
jobOutputs.poses from dto, or fetches the execution DTO via
client.executions.get when dto is omitted.
To convert the result to a DataFrame::
poses = docking.get_results()
df = poses.to_dataframe()
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dto
|
dict[str, Any] | None
|
Optional execution payload ( |
None
|
all_poses
|
bool
|
When |
False
|
Returns:
| Type | Description |
|---|---|
LigandSet
|
A |
Raises:
| Type | Description |
|---|---|
ValueError
|
If :attr: |
DeepOriginException
|
If no poses could be loaded from the data
platform or |
get_undocked_ligands
¶
get_undocked_ligands() -> LigandSet | None
Get a list of ligands that failed to dock.
Note: we cannot rely on the tool progress report to determine failed ligands, because catastrophic tool failures will not update the progress report.
Returns:
| Type | Description |
|---|---|
LigandSet | None
|
A |
run
¶
run(
*,
quote: bool = False,
approve_amount: int | None = None
) -> LigandSet | None
Execute docking synchronously (blocking).
Submits one synchronous tools execution and returns docked poses from the
data platform. Requires exactly one ligand in :attr:ligands; use
:meth:start for multiple ligands.
Pass quote=True (or approve_amount=0) to request a cost estimate
only. In that case the platform returns a Quoted DTO, the instance
is updated with estimate and status="Quoted", and None is
returned.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quote
|
bool
|
Shorthand for |
False
|
approve_amount
|
int | None
|
Spend cap forwarded to the platform as |
None
|
Returns:
| Type | Description |
|---|---|
LigandSet | None
|
A |
LigandSet | None
|
responds with |
Raises:
| Type | Description |
|---|---|
ValueError
|
If :attr: |
DeepOriginException
|
If |
start
¶
start(
*,
quote: bool = False,
approve_amount: int | None = None,
**kwargs: Any
) -> None
Submit a persisted async execution. Requires at least two ligands.
For a single ligand, use :meth:run instead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quote
|
bool
|
Shorthand for |
False
|
approve_amount
|
int | None
|
Spend cap forwarded to the platform. |
None
|
**kwargs
|
Any
|
Forwarded to |
{}
|