Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/level_1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
environment: ${{ matrix.env }}
strategy:
fail-fast: true
fail-fast: false
matrix:
python-version: ["3.13"]
env: ${{ fromJSON( ((github.event_name == 'workflow_call' || github.event_name == 'release') && inputs.env != '') && format('["{0}"]', inputs.env) || '["dev","staging","prod"]' ) }}
Expand Down
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,26 @@
"drugability",
"dtos",
"emeq",
"ensembl",
"fasta",
"finalizer",
"FMCS",
"hbond",
"herg",
"HETATM",
"inchi",
"interpro",
"isin",
"isoparse",
"kabsch",
"Kekulization",
"Kekulize",
"Konnektor",
"kwargs",
"ligandability",
"ligandset",
"logd",
"logp",
"marimo",
"mbar",
"molblock",
Expand All @@ -70,6 +78,7 @@
"rcsbapi",
"rdchem",
"rdkit",
"refseq",
"replex",
"resnames",
"retryable",
Expand All @@ -78,7 +87,10 @@
"SASA",
"softcore",
"Substruct",
"subtable",
"textea",
"tpsa",
"uniprot",
"venv"
]
}
31 changes: 31 additions & 0 deletions docs/dd/how-to/proteins.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,37 @@ from deeporigin.drug_discovery import Protein
protein = Protein.from_name("insulin")
```

### From a Deep Origin Data Platform ID

You can create a Protein instance directly from a Deep Origin Data Platform ID. This method fetches the protein data from the platform, downloads the structure file, and creates a Protein instance with metadata from the platform:

```python
from deeporigin.drug_discovery import Protein

protein = Protein.from_id("08AD337N5YV4Y")
```

The method automatically:
- Downloads the structure file from the Deep Origin Data Platform
- Sets the protein's ID, name, and PDB ID (if available) from the platform metadata
- Creates a Protein instance from the downloaded file

You can optionally provide a custom `DeepOriginClient` instance:

```python
from deeporigin.drug_discovery import Protein
from deeporigin.platform.client import DeepOriginClient

client = DeepOriginClient()
protein = Protein.from_id("08AD337N5YV4Y", client=client)
```

!!! warning "Requires file_path"
The protein data in the platform must contain a `file_path` field. If the protein data does not have a file_path, a `ValueError` will be raised.

!!! note "Automatic metadata"
The method automatically populates the protein's `name` field from the platform data, preferring `protein_name`, then `pdb_id`, then `gene_symbol` (in that order).


## Inspecting the Protein

Expand Down
20 changes: 20 additions & 0 deletions docs/notebooks/clean/docking-single-ligand.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@
"sim"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2d8bfa9a-c142-4deb-ac3d-d2a4f581df55",
"metadata": {},
"outputs": [],
"source": [
"protein._remote_path"
]
},
{
"cell_type": "markdown",
"id": "e2aa58aa",
Expand All @@ -115,6 +125,16 @@
"ligands"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "95f716a7-4a4c-4c23-9d61-130fc3e9a72f",
"metadata": {},
"outputs": [],
"source": [
"ligands.to_smiles()"
]
},
{
"cell_type": "markdown",
"id": "94e19bec-6bee-4dbf-9c47-1490c41fdbd0",
Expand Down
71 changes: 71 additions & 0 deletions docs/platform/ref/data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Data Platform API.

The DeepOriginClient can be used to access the data platform API using:

```{.python notest}
from deeporigin.platform.client import DeepOriginClient

client = DeepOriginClient()
```

Then, the following methods can be used, for example:

```{.python notest}
# Check the health status of the data platform
health_status = client.data.health()

# Search ligands joined with tool results
results = client.data.search_ligands_with_results(
limit=10,
experiments=[{"toolId": "deeporigin.docking"}],
)

# Search an entity (e.g., ligands)
results = client.data.search("ligands")

# Search ligands using convenience method
results = client.data.search_ligands(limit=10)

# Search proteins using convenience method
results = client.data.search_proteins(limit=10)

# Create a new ligand
ligand = client.data.create_ligand(
project_id="\\x0011223344556677",
canonical_smiles="CCOc1ccc2nc(S(=O)(=O)N3CCN(CC3)C)c(N)c2c1",
inchi_key="BSYNRYMUTXBXSQ-UHFFFAOYSA-N",
inchi="InChI=1S/C20H24N4O4S/.../h1-4,6-9H,5,10-14H2,(H,22,23)",
smiles="CCOc1ccc2nc(S(=O)(=O)N3CCN(CC3)C)c(N)c2c1",
name="Compound-12345",
formal_charge=0,
hbond_donor_count=1,
hbond_acceptor_count=6,
rotatable_bond_count=5,
tpsa=85.12,
molecular_weight=447.5,
)
Comment on lines +33 to +46
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation example shows parameters that are not accepted by the create_ligand method. The method does not accept 'canonical_smiles' or 'inchi_key' or 'inchi' as parameters - these are computed by the platform and returned in the response. Only 'smiles' should be passed as input. The example should be updated to only include valid parameters.

Copilot uses AI. Check for mistakes.

# List projects
projects = client.data.list_projects()

# List public models
models = client.data.list_models()
```


::: src.platform.data.Data
options:
heading_level: 2
docstring_style: google
show_root_heading: true
show_category_heading: true
show_object_full_path: false
show_root_toc_entry: false
inherited_members: true
members_order: alphabetical
filters:
- "!^_" # Exclude private members (names starting with "_")
show_signature: true
show_signature_annotations: true
show_if_no_docstring: true
group_by_category: true
1 change: 1 addition & 0 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ nav:
- functions: platform/ref/functions.md
- organizations: platform/ref/organizations.md
- billing: platform/ref/billing.md
- data: platform/ref/data.md
- Developing:
- Installing: dev/install.md
- Clients: dev/clients.md
Expand Down
4 changes: 3 additions & 1 deletion src/drug_discovery/structures/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

from abc import ABC, abstractmethod
from dataclasses import dataclass
from dataclasses import dataclass, field
from pathlib import Path
from typing import Optional

Expand All @@ -20,6 +20,8 @@ class Entity(ABC):
This class manages the remote path and provides an upload method to ensure that the entity's file is uploaded to the remote storage if it does not already exist there. It uses the DeepOrigin FilesClient for remote file operations.
"""

id: str | None = field(default=None, kw_only=True)

@abstractmethod
def to_hash(self) -> str:
"""computes a hash of the entity"""
Expand Down
Loading
Loading