biology
BioNeMo ProteinMPNN
NVIDIA NIM for ProteinMPNN inverse folding and protein sequence design.
Model details
View repositoryExample usage
Call BioNeMo ProteinMPNN on Baseten using the NIM sequence design 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 "/biology/ipd/proteinmpnn/predict"
9)
10
11pdb_text = requests.get("https://files.rcsb.org/download/1R42.pdb", timeout=30).text
12atom_lines = [line for line in pdb_text.splitlines() if line.startswith("ATOM")][:200]
13input_pdb = "\n".join(atom_lines)
14
15payload = {
16 "input_pdb": input_pdb,
17 "ca_only": False,
18 "use_soluble_model": False,
19 "num_seq_per_target": 3,
20 "sampling_temp": [0.1, 0.3],
21}
22
23response = requests.post(
24 BASETEN_URL,
25 headers={
26 "Authorization": f"Bearer {BASETEN_API_KEY}",
27 "Content-Type": "application/json",
28 },
29 json=payload,
30 timeout=300,
31)
32response.raise_for_status()
33result = response.json()
34print(result)
35JSON output
1{
2 "mfasta": ">T=0.1, score=1.2345, seq=0\nMKTV...\n",
3 "scores": [
4 [
5 1.2345
6 ]
7 ],
8 "probs": [
9 [
10 "<probabilities>"
11 ]
12 ]
13}