Skip to content

deeporigin.drug_discovery.pocket_finder

Not yet released

This class isn't yet available on the latest release of the deeporigin client.

PocketFinder -- find binding pockets via synchronous or asynchronous execution.

Sync usage (blocking, returns pockets directly)::

pf = PocketFinder(protein)
pf.quote()           # populates pf.estimate
pockets = pf.run()   # blocking; calls get_results(); populates pf.cost

Async usage (persisted execution, watch in notebook)::

pf = PocketFinder(protein)
pf.start()            # submits async; sets pf.id and pf.status
await pf.watch()      # live Jupyter updates (or pf.sync() in a loop)
pockets = pf.get_results()

Classes

PocketFinder

Bases: Execution, QuoteMixin, SyncExecutableMixin, AsyncExecutableMixin, NotebookWatchMixin

Find binding pockets in a protein structure.

The execution request body includes sync (true = blocking, false = immediate DTO). :meth:run sets "sync": true and blocks until the run finishes. :meth:start and :meth:quote set "sync": false (non-blocking); start returns immediately with an execution DTO that you can poll with :meth:sync (or watch with :meth:watch / :meth:watch_async in Jupyter). Track async jobs with :meth:sync, :meth:from_id, and :meth:list.

Attributes:

Name Type Description
protein Protein

The protein to analyse.

pocket_count int

Maximum number of pockets to detect.

pocket_min_size int

Minimum pocket volume in cubic Angstroms.

Attributes

pocket_count property
pocket_count: int

Maximum number of pockets to detect.

pocket_min_size property
pocket_min_size: int

Minimum pocket volume in cubic Angstroms.

protein property
protein: Protein

The protein to analyse.

tool_key class-attribute instance-attribute
tool_key: str = TOOL_KEYS_AND_VERSIONS["pocket_finder"][
    "tool_key"
]
tool_version instance-attribute
tool_version = tool_version

Functions

from_dto classmethod
from_dto(
    dto: dict[str, Any],
    *,
    client: DeepOriginClient | None = None
) -> Self

Construct a PocketFinder from a tools execution DTO.

Rehydrates protein, pocket_count, and pocket_min_size from userInputs (falling back to inputs for older payloads). The protein is loaded with Protein.from_id(..., download=False) and remote_path_override from the stored input, matching :meth:_make_payload / :meth:Docking.from_dto.

Parameters:

Name Type Description Default
dto dict[str, Any]

Execution payload (same shape as client.executions.get).

required
client DeepOriginClient | None

Optional API client. Uses the default if not provided.

None

Returns:

Type Description
Self

A PocketFinder with id, pricing fields, and domain inputs set.

Raises:

Type Description
ValueError

If protein.id is missing from stored inputs.

get_results
get_results(
    dto: dict[str, Any] | None = None,
) -> list[Pocket]

Load pockets for this execution from the data platform or jobOutputs.

Tries :meth:~deeporigin.drug_discovery.structures.pocket.Pocket.from_result first. On failure, parses jobOutputs.pockets from dto, or from client.executions.get when dto is omitted (for example after :meth:~deeporigin.drug_discovery.execution.Execution.from_id).

Parameters:

Name Type Description Default
dto dict[str, Any] | None

Optional execution payload (executions.create / executions.get). Passing it avoids an extra GET when the data platform path fails but the sync response included jobOutputs.

None

Returns:

Type Description
list[Pocket]

List of Pocket objects for this execution.

Raises:

Type Description
ValueError

If :attr:id is unset.

DeepOriginException

If no pockets could be loaded from the data platform or jobOutputs.

run
run() -> list[Pocket]

Execute pocket finding synchronously (blocking).

Submits one synchronous tools execution (sync=True) and returns the detected pockets via :meth:get_results. The server blocks until the run completes; use :meth:start for async, persisted execution.

Returns:

Type Description
list[Pocket]

List of Pocket objects found in the protein.

Raises:

Type Description
DeepOriginException

If no pockets could be loaded from the data platform or jobOutputs.