deeporigin.drug_discovery.Pose / PoseSet¶
Bases: Entity
A 3D ligand conformation backed by an SDF in the platform pose result table.
A :class:Pose holds the platform pose result id (:attr:id) and the
parent ligand id (:attr:ligand_id). These are distinct from
:class:~deeporigin.drug_discovery.structures.ligand.Ligand identity.
Attributes:
| Name | Type | Description |
|---|---|---|
ligand_id |
str
|
Parent ligand id in the ligands table. |
smiles |
str | None
|
Canonical or input SMILES when known without loading the SDF. |
name |
str | None
|
Optional pose or ligand name. |
protein_id |
str | None
|
Optional protein the pose is associated with. |
compute_job_id |
str | None
|
Optional compute job that produced this pose. |
pose_score |
float | None
|
Docking pose score when present. |
binding_energy |
float | None
|
Docking binding energy when present. |
best_pose |
bool | None
|
Whether this row is the best pose for its ligand in a run. |
origin |
str | None
|
Provenance string (for example |
props |
dict[str, Any]
|
Additional metadata from the platform row. |
Attributes¶
Methods:¶
from_id
classmethod
¶
from_id(
id: str, *, client: Optional[DeepOriginClient] = None
) -> Self
Load a single pose from a result-explorer record id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
Platform pose result id. |
required |
client
|
Optional[DeepOriginClient]
|
Optional platform client. |
None
|
Returns:
| Type | Description |
|---|---|
Self
|
The matching :class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no pose record exists for |
from_json
classmethod
¶
from_json(
data: list[dict[str, Any]],
*,
client: Optional[DeepOriginClient] = None,
sanitize: bool = True,
remove_hydrogens: bool = False
) -> list[Self]
Build :class:Pose objects from pose metadata dicts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
list[dict[str, Any]]
|
Pose rows (for example result-explorer |
required |
client
|
Optional[DeepOriginClient]
|
Optional client for |
None
|
sanitize
|
bool
|
Passed to :meth: |
True
|
remove_hydrogens
|
bool
|
Passed to :meth: |
False
|
Returns:
| Type | Description |
|---|---|
list[Self]
|
One pose per dict, in input order. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If a row is invalid or lacks required fields. |
from_sdf
classmethod
¶
from_sdf(
path: str | Path,
*,
ligand: Ligand | None = None,
protein_id: str | None = None,
origin: str = "registered",
client: Optional[DeepOriginClient] = None,
sanitize: bool = True,
remove_hydrogens: bool = False
) -> Self
Register an external SDF as a platform pose and return a :class:Pose.
Syncs the parent :class:Ligand (unless ligand is supplied), uploads
the SDF, and invokes the ImportTool pose-registration path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Local SDF file path. |
required |
ligand
|
Ligand | None
|
Optional explicit parent ligand (skips auto-sync by SMILES). |
None
|
protein_id
|
str | None
|
Optional associated protein id. |
None
|
origin
|
str
|
Provenance string stored on the pose row. |
'registered'
|
client
|
Optional[DeepOriginClient]
|
Optional platform client. |
None
|
sanitize
|
bool
|
Passed to :meth: |
True
|
remove_hydrogens
|
bool
|
Passed to :meth: |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
Registered |
Self
|
class: |
Raises:
| Type | Description |
|---|---|
DeepOriginException
|
If registration fails or returns no pose row. |
sync
¶
sync(
*,
lazy: bool = False,
client: Optional[DeepOriginClient] = None,
remote_path: Optional[str] = None
) -> None
Upload the pose SDF when a local file exists.
Pose registration (platform pose id) is handled by :meth:from_sdf.
This method only uploads bytes when local_path is set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lazy
|
bool
|
Skip upload when :attr: |
False
|
client
|
Optional[DeepOriginClient]
|
Optional platform client. |
None
|
remote_path
|
Optional[str]
|
Optional explicit remote key. |
None
|
to_file
¶
to_file(file_path: str | Path | None = None) -> str
Write this pose to an SDF file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str | Path | None
|
Destination path. When omitted, writes a temp file. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
Path to the written SDF file. |
Raises:
| Type | Description |
|---|---|
DeepOriginException
|
If no local structure is available. |
to_ligand
¶
to_ligand() -> Ligand
Convert this pose to a legacy pose-hydrated :class:Ligand.
Prefer using :class:Pose directly; this exists for backward compatibility
with code paths that still expect :class:Ligand pose rows.
Collection of :class:Pose objects.
Attributes¶
Methods:¶
from_json
classmethod
¶
from_json(
data: list[dict[str, Any]],
*,
client: Optional[DeepOriginClient] = None,
sanitize: bool = True,
remove_hydrogens: bool = False
) -> Self
Build a :class:PoseSet from pose metadata dicts.
from_result
classmethod
¶
from_result(
*,
protein_id: str | None = None,
execution_id: str | None = None,
ligand_id: str | list[str] | None = None,
best_pose: bool | None = None,
scored_only: bool = False,
client: Optional[DeepOriginClient] = None
) -> Self
Load poses from the data platform result explorer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
protein_id
|
str | None
|
Optional protein filter. |
None
|
execution_id
|
str | None
|
Optional compute job / execution id filter. |
None
|
ligand_id
|
str | list[str] | None
|
Optional ligand id filter (single id or list). |
None
|
best_pose
|
bool | None
|
When set, restrict to rows whose |
None
|
scored_only
|
bool
|
When |
False
|
client
|
Optional[DeepOriginClient]
|
Optional platform client. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Matching |
Self
|
class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no pose rows match the filters. |
to_ligand_set
¶
to_ligand_set() -> LigandSet
Convert to a legacy :class:LigandSet of pose-hydrated ligands.
Overview¶
A Pose is a 3D ligand conformation stored in the platform pose result table
(result_type=pose). It has its own platform pose id (Pose.id) and a
parent ligand id (Pose.ligand_id) in the ligands table.
Use :class:Pose / :class:PoseSet when you need pose-scoped identity. Docking
outputs still return :class:~deeporigin.drug_discovery.LigandSet from
:meth:~deeporigin.drug_discovery.Docking.get_poses until a later release; prefer
:meth:PoseSet.from_result or :meth:~deeporigin.drug_discovery.Ligand.get_poses
for new code.
Register an external SDF¶
from deeporigin.drug_discovery import Pose
pose = Pose.from_sdf("cocrystal.sdf", protein_id=protein.id)
print(pose.id, pose.ligand_id)
List poses for a ligand¶
ligand.sync()
poses = ligand.get_poses()
for pose in poses:
print(pose.id, pose.pose_score)
Load poses from a docking run¶
from deeporigin.drug_discovery import PoseSet
pose_set = PoseSet.from_result(execution_id=docking.id)