Skip to content

deeporigin.drug_discovery.patent

Patent drives platform tool deeporigin.draco to extract chemical structures from a PDF document. The workflow is async-only: quote with start(quote=True), confirm(), then wait() and get_results().

Patent -- extract chemical structures from PDF documents via deeporigin.draco.

Classes

Patent

Bases: Execution, AsyncExecutableMixin, NotebookWatchMixin

Extract chemical structures from a patent or chemistry PDF.

Async-only workflow backed by platform tool deeporigin.draco. Upload a local PDF with :meth:start, optionally quote first via start(quote=True) and :meth:confirm, then poll with :meth:wait or :meth:sync and read extracted structures via :meth:get_results.

Attributes

name instance-attribute
name = name
pdf property
pdf: Path | None

Local PDF path when known (None after :meth:from_dto rehydration).

remote_pdf_path property
remote_pdf_path: str | None

UFA key for the uploaded PDF after :meth:start or :meth:from_dto.

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

Methods:

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

Construct a Patent instance from an execution 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.

None

Returns:

Type Description
Self

A fully-hydrated Patent instance with status from the DTO.

Raises:

Type Description
ValueError

If input_file.key is missing from stored inputs.

from_id classmethod
from_id(
    id: str, *, client: DeepOriginClient | None = None
) -> Self

Construct a Patent instance from an existing platform execution ID.

get_results
get_results(**_kwargs: Any) -> DataFrame | None

Retrieve extracted structures as a ligand-oriented DataFrame.

Returns:

Type Description
DataFrame | None

A DataFrame with smiles, name, page, and related columns,

DataFrame | None

or None if the job has not succeeded or no molecules were found.

Raises:

Type Description
ValueError

If no execution has been started.