deeporigin.drug_discovery.uniprot_discovery¶
Bases: Execution, SyncExecutableMixin
Rank experimental PDBs for a UniProt accession via the platform tool.
Call :meth:run for ranked candidates. Call :meth:import_proteins to
sync recommended or selected PDB IDs into a project with
uniprot_accession persisted.
Attributes¶
candidates
property
¶
candidates: list[UniprotDiscoveryCandidate] | None
Cached candidates from the last successful :meth:run, if any.
project_id
property
¶
project_id: str | None
Optional project id used as a default for :meth:import_proteins.
tool_key
class-attribute
instance-attribute
¶
tool_key: str = TOOL_KEYS_AND_VERSIONS["uniprot_discovery"][
"tool_key"
]
Methods:¶
from_dto
classmethod
¶
from_dto(
dto: dict[str, Any],
*,
client: DeepOriginClient | None = None
) -> Self
Construct a UniprotDiscovery from a tools execution DTO.
Restores uniprot_accession 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. |
None
|
Returns:
| Type | Description |
|---|---|
Self
|
A |
Raises:
| Type | Description |
|---|---|
ValueError
|
If stored inputs lack |
import_proteins
¶
import_proteins(
pdb_ids: list[str] | None = None,
*,
project_id: str | None = None
) -> list[Protein]
Download and sync selected (or recommended) PDB candidates.
Runs :meth:run if candidates are not already cached. Requires a
resolvable project id. Each protein is synced with
:attr:~deeporigin.drug_discovery.structures.protein.Protein.uniprot_accession
set from this job.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pdb_ids
|
list[str] | None
|
PDB IDs to import. Must appear in this accession's
candidates. When |
None
|
project_id
|
str | None
|
Project to sync into. Falls back to the instance
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Synced |
list[Protein]
|
class: |
list[Protein]
|
instances (one per selected PDB ID). |
Raises:
| Type | Description |
|---|---|
DeepOriginException
|
If project is missing, candidates are empty, selection is invalid, or sync fails. |
run
¶
run(
*,
quote: bool = False,
approve_amount: int | None = None
) -> list[UniprotDiscoveryCandidate] | None
Run UniProt discovery synchronously and return ranked candidates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quote
|
bool
|
Shorthand for |
False
|
approve_amount
|
int | None
|
Spend cap forwarded as |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Ranked |
list[UniprotDiscoveryCandidate] | None
|
class: |
list[UniprotDiscoveryCandidate] | None
|
|
Raises:
| Type | Description |
|---|---|
DeepOriginException
|
If the execution does not succeed or
|