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
3 changes: 0 additions & 3 deletions docs/dev/job-widget.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ To disable blocking mode, you can either unset the variable or set it to a falsy
# Unset the variable
unset JOB_WATCH_BLOCK

# Or set it to an empty string
export JOB_WATCH_BLOCK=""

# Or set it to a falsy value like 0, false, no, or off
export JOB_WATCH_BLOCK=0
```
Expand Down
186 changes: 186 additions & 0 deletions docs/notebooks/clean/abfe.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "5c618447-f60b-4290-83f0-92ca9cd03ee0",
"metadata": {},
"outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "858a2b5a-6550-4e0c-805c-c1cb92761b14",
"metadata": {},
"outputs": [],
"source": [
"from dotenv import load_dotenv\n",
"from deeporigin.drug_discovery import Complex, BRD_DATA_DIR, Protein, Ligand, LigandSet\n",
"load_dotenv()\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "de846db3-3d86-44f7-8ea6-b3c8bff2be51",
"metadata": {},
"source": [
"\n",
"# ABFE workflow\n",
"\n",
"This notebook shows you how to run ABFE on Deep Origin, and serves as a quick tutorial for running ABFE. \n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "01bd9f1d-1fc6-456c-bc18-9633d2f0023f",
"metadata": {},
"outputs": [],
"source": [
"sim = Complex.from_dir(BRD_DATA_DIR)\n",
"sim.ligands"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9dad154d-a618-403a-83a7-ee0094ccdc74",
"metadata": {},
"outputs": [],
"source": [
"sim.ligands.to_dataframe()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "045aeed9-98e1-4d2b-a078-71c8f044ac72",
"metadata": {},
"outputs": [],
"source": [
"# use this ligand\n",
"ligand = [ligand for ligand in sim.ligands if ligand.name == \"cmpd 4 (Crotyl)\"][0]\n",
"ligand"
]
},
{
"cell_type": "markdown",
"id": "edbe68a9-8aea-40b0-8726-ece63149a098",
"metadata": {},
"source": [
"## Prepare system"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0e7c793a-0095-4fb7-84fb-a5fcff23a276",
"metadata": {},
"outputs": [],
"source": [
"prepared_system = sim.prepare(ligand=ligand)\n",
"prepared_system.show()"
]
},
{
"cell_type": "markdown",
"id": "f57837f4-605b-4a1b-99c6-af90956c3483",
"metadata": {},
"source": [
"## Quote ABFE\n",
"\n",
"We can estimate the cost of an ABFE run without running it. "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5175f2a9-e4c2-49ce-8d5d-618903a869b1",
"metadata": {},
"outputs": [],
"source": [
"jobs = sim.abfe.run(ligands=[ligand], quote=True)\n",
"job = jobs[0]\n",
"job"
]
},
{
"cell_type": "markdown",
"id": "a32639b1-f247-42a5-acab-b94f775cc570",
"metadata": {},
"source": [
"If we're happy with this price, we can confirm the job (which runs it)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6deda895-5617-4fdd-ace5-306f2d181a7e",
"metadata": {},
"outputs": [],
"source": [
"job.confirm()\n",
"job"
]
},
{
"cell_type": "markdown",
"id": "010e0815-52df-4936-bfd3-49f6efdf31c4",
"metadata": {},
"source": [
"## Monitor job\n",
"\n",
"To monitor a job, use the job.watch method:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0a09eec9-a1e1-4ca4-b3e0-4ee4e98c58f2",
"metadata": {},
"outputs": [],
"source": [
"job.watch()"
]
},
{
"cell_type": "markdown",
"id": "558d5f5e-afb8-43d7-803f-abb6cea0c852",
"metadata": {},
"source": [
"## Get results"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b7094160-64c1-4b04-91db-eb54e3287b29",
"metadata": {},
"outputs": [],
"source": [
"df = sim.abfe.get_results()\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "33c5ec29-7df1-4c5c-ad43-d4ef3ec5986f",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
5 changes: 1 addition & 4 deletions docs/notebooks/clean/docking-many-ligands.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@
" DATA_DIR,\n",
" Protein,\n",
" LigandSet,\n",
")\n",
"import deeporigin\n",
"\n",
"deeporigin.__version__"
")"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [ -d "docs/notebooks/clean" ] && [ "$(ls -A docs/notebooks/clean/*.ipynb 2>/d

# Start mock server in background for local testing
echo "🚀 Starting mock server..."
uv run python -m tests.run_mock_server --port 4931 > /dev/null 2>&1 &
uv run python -m tests.run_mock_server --port 4931 --abfe-duration 5 > /dev/null 2>&1 &
MOCK_SERVER_PID=$!

# Wait a moment for server to start
Expand Down
2 changes: 1 addition & 1 deletion src/drug_discovery/complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def prepare(
self,
ligand: Optional[Ligand] = None,
*,
padding: float = 2.0,
padding: float = 1.0,
retain_waters: bool = False,
add_H_atoms: bool = False, # NOSONAR
protonate_protein: bool = False,
Expand Down
2 changes: 1 addition & 1 deletion src/functions/sysprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def run_sysprep(
*,
protein: Protein,
ligand: Ligand,
padding: float = 1.5,
padding: float = 1.0,
retain_waters: bool = False,
add_H_atoms: bool = True, # NOSONAR
protonate_protein: bool = True,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"items": [
{
"qty": 0,
"itemCode": "DO_ABFE",
"priceEach": 120,
"isApproved": true,
"priceTotal": 183.9370042608,
"actionRequest": null,
"authorizationId": "691b838fac1dc207f1cb3c3e",
"purchaseApprovalComment": null
"isApproved": true,
"itemCode": "DO_ABFE",
"priceEach": 120,
"priceTotal": 83.9370042608,
"purchaseApprovalComment": null,
"qty": 0
}
],
"orgId": "deeporigin",
"status": "Approved",
"totalCost": 183.9370042608,
"totalCost": 83.9370042608,
Comment thread
sg-s marked this conversation as resolved.
"transactionId": "691b838fac1dc207f1cb3c3c"
}
30 changes: 15 additions & 15 deletions tests/fixtures/deeporigin.abfe-end-to-end/quotation-result.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@
"failedQuotations": [],
"successfulQuotations": [
{
"qty": 0,
"orgId": "deeporigin",
"status": "OK",
"itemCode": "DO_ABFE",
"qty_vars": {
"abfe_atoms": 57337,
"abfe_repeats": 1,
"abfe_windows": 32,
"abfe_production_steps": 1250000,
"abfe_equilibration_steps": 754999
},
"orgId": "deeporigin",
"priceEach": 120,
"priceTotal": 183.9370042608,
"priceTotal": 83.9370042608,
"pricingRecordType": "regular",
"pricingRecords": [
{
"qty": 1.53280836884,
"itemKey": "DO_ABFE",
"itemName": "Absolute Binding Free Energy (ABFE)",
"priceEach": 120,
"qty": 1.53280836884,
"tierQtyFrom": 0,
"tierQtyTo": 0,
"totalPrice": 183.9370042608,
"tierQtyFrom": 0
"totalPrice": 83.9370042608
}
],
"pricingRecordType": "regular"
"qty": 0,
"qty_vars": {
"abfe_atoms": 57337,
"abfe_equilibration_steps": 754999,
"abfe_production_steps": 1250000,
"abfe_repeats": 1,
"abfe_windows": 32
},
"status": "OK"
}
]
}
Loading
Loading