deeporigin.drug_discovery.protein_prep¶
ProteinPrep drives platform tool deeporigin.protein-prep to clean a protein
structure. The workflow is async-only: start(), then wait() /
watch(), then get_results() (an in-memory Protein). There is no
run() and no quote.
ProteinPrep -- async-only execution for expert protein preparation.
Usage::
prep = ProteinPrep(protein, pdb_id="1EBY") # pdb_id inferred if protein.pdb_id is set
prep.start()
prep.wait()
prepared = prep.get_results() # in-memory Protein; id is None
Classes¶
ProteinPrep
¶
Bases: Execution, AsyncExecutableMixin, NotebookWatchMixin
Prepare a protein structure via deeporigin.protein-prep (async-only).
Submit with :meth:start, track with :meth:wait / :meth:watch /
:meth:sync, then load an in-memory :class:Protein from
:meth:get_results. There is no run(). Quoting is unused (billing is
skipped); do not pass quote=True.
Attributes:
| Name | Type | Description |
|---|---|---|
protein |
Protein
|
Input protein structure (unchanged after the run). |
pdb_id |
str
|
4-character PDB ID used for loop-modelling templates. |
keep_chain_ids |
list[str]
|
Chain IDs to keep; empty means all chains. |
keep_cofactor_ids |
list[str]
|
Cofactor/metal residue names to keep; empty keeps none. |
keep_water_residue_names |
list[str]
|
Water residue-name classes to keep; empty keeps none. |
remove_ligand_ids |
list[str]
|
Ligand residue names to remove during cleanup. |
Attributes¶
keep_chain_ids
property
¶
keep_chain_ids: list[str]
Protein chain IDs to keep; empty means all chains.
keep_cofactor_ids
property
¶
keep_cofactor_ids: list[str]
Cofactor/metal residue names to keep; empty keeps none.
keep_water_residue_names
property
¶
keep_water_residue_names: list[str]
Water residue-name classes to keep; empty keeps none.
remove_ligand_ids
property
¶
remove_ligand_ids: list[str]
Ligand residue names to remove during cleanup.
tool_key
class-attribute
instance-attribute
¶
tool_key: str = TOOL_KEYS_AND_VERSIONS["protein_prep"][
"tool_key"
]
Methods:¶
from_dto
classmethod
¶
from_dto(
dto: dict[str, Any],
*,
client: DeepOriginClient | None = None
) -> Self
Construct a ProteinPrep from a tools execution DTO.
Rehydrates protein, pdb_id, and keep/remove lists from
userInputs (falling back to inputs).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dto
|
dict[str, Any]
|
Execution payload (same shape as |
required |
client
|
DeepOriginClient | None
|
Optional API client. Uses the default if not provided. |
None
|
Returns:
| Type | Description |
|---|---|
Self
|
A |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
get_results
¶
get_results(dto: dict[str, Any] | None = None) -> Protein
Load the prepared protein as an in-memory :class:Protein.
Tries result-explorer rows for this execution
(result_type=preparedprotein), then jobOutputs.protein. Does not
PATCH or create a proteins-table record; the returned Protein has
id is None and remote_path set to the prepared PDB.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dto
|
dict[str, Any] | None
|
Optional execution payload. Passing it avoids an extra GET
when the result-explorer path fails but |
None
|
Returns:
| Type | Description |
|---|---|
Protein
|
An in-memory :class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If :attr: |
DeepOriginException
|
If no prepared PDB path could be loaded. |