Skip to content

Commit e3cb00b

Browse files
committed
v.0.5.1 (release not out of main)
1 parent caad170 commit e3cb00b

File tree

3 files changed

+70
-3
lines changed

3 files changed

+70
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For more information on the model's performance and capabilities, see our [techn
1212

1313
```shell
1414
# version on pypi:
15-
pip install chai_lab==0.5.0
15+
pip install chai_lab==0.5.1
1616

1717
# newest available version (updates daily to test features that weren't released yet):
1818
pip install git+https://github.com/chaidiscovery/chai-lab.git
@@ -123,7 +123,7 @@ Devcontainers work on local Linux setup, and on remote machines over an SSH conn
123123
Since this is an initial release, we expect to make some breaking changes to the API and are not guaranteeing backwards compatibility. We recommend pinning the current version in your requirements, i.e.:
124124

125125
```
126-
chai_lab==0.5.0
126+
chai_lab==0.5.1
127127
```
128128

129129
## Citations

chai_lab/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Licensed under the Apache License, Version 2.0.
33
# See the LICENSE file for details.
44

5-
__version__ = "0.5.0"
5+
__version__ = "0.5.1"

examples/predict_structure.private.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import datetime
2+
from pathlib import Path
3+
4+
import numpy as np
5+
import torch
6+
7+
import chai_lab
8+
from chai_lab.chai1 import run_inference
9+
10+
# We use fasta-like format for inputs.
11+
# - each entity encodes protein, ligand, RNA or DNA
12+
# - each entity is labeled with unique name;
13+
# - ligands are encoded with SMILES; modified residues encoded like AAA(SEP)AAA
14+
15+
# Example given below, just modify it
16+
17+
18+
example_fasta = (
19+
"""
20+
>protein|name=example-of-long-protein
21+
"""
22+
+ "A" * 1700
23+
).strip()
24+
25+
fasta_path = Path("/tmp/example.fasta")
26+
fasta_path.write_text(example_fasta)
27+
28+
output_dir = (
29+
Path(__file__)
30+
.parent.parent.joinpath(
31+
f"outputs/{chai_lab.__version__}/{datetime.datetime.now().isoformat()}"
32+
)
33+
.absolute()
34+
)
35+
36+
37+
if False:
38+
from chai_lab.dispatch import MemSourceTrackingDispatchMode
39+
40+
with MemSourceTrackingDispatchMode():
41+
pass
42+
if True:
43+
x = torch.zeros(85174583296 // 2, dtype=torch.uint8, device=torch.device("cuda:0"))
44+
# x = torch.zeros(
45+
# 85174583296 // 2 - 1_000_000_000,
46+
# dtype=torch.uint8,
47+
# device=torch.device("cuda:0"),
48+
# )
49+
# assert 0 == 1
50+
candidates = run_inference(
51+
fasta_file=fasta_path,
52+
output_dir=output_dir,
53+
# 'default' setup
54+
num_trunk_recycles=2,
55+
num_diffn_timesteps=2,
56+
seed=42,
57+
device="cuda:0",
58+
use_esm_embeddings=True,
59+
low_memory=True,
60+
)
61+
62+
cif_paths = candidates.cif_paths
63+
scores = [rd.aggregate_score for rd in candidates.ranking_data]
64+
65+
66+
# Load pTM, ipTM, pLDDTs and clash scores for sample 2
67+
scores = np.load(output_dir.joinpath("scores.model_idx_2.npz"))

0 commit comments

Comments
 (0)