Model details
View repositoryExample usage
Call BioNeMo DiffDock on Baseten using the NIM molecular docking route.
Note: You need to procure your own NVAIE licenses to access this NIM.
Input
1import os
2import requests
3
4MODEL_ID = os.environ["BASETEN_MODEL_ID"]
5BASETEN_API_KEY = os.environ["BASETEN_API_KEY"]
6BASETEN_URL = (
7 f"https://model-{MODEL_ID}.api.baseten.co/environments/production/sync"
8 "/molecular-docking/diffdock/generate"
9)
10
11pdb_text = requests.get("https://files.rcsb.org/download/8G43.pdb", timeout=30).text
12protein = "\n".join(line for line in pdb_text.splitlines() if line.startswith("ATOM"))
13ligand = requests.get(
14 "https://files.rcsb.org/ligands/download/ZU6_ideal.sdf",
15 timeout=30,
16).text
17
18payload = {
19 "protein": protein,
20 "ligand": ligand,
21 "ligand_file_type": "sdf",
22 "num_poses": 5,
23 "time_divisions": 20,
24 "steps": 18,
25 "save_trajectory": False,
26 "is_staged": False,
27}
28
29response = requests.post(
30 BASETEN_URL,
31 headers={
32 "Authorization": f"Bearer {BASETEN_API_KEY}",
33 "Content-Type": "application/json",
34 },
35 json=payload,
36 timeout=300,
37)
38response.raise_for_status()
39result = response.json()
40print(result)
41JSON output
1{
2 "ligand_positions": [
3 "<ranked SDF pose>"
4 ],
5 "position_confidence": [
6 0.82
7 ]
8}