boltz-vsynthes 1.0.43__py3-none-any.whl → 1.0.44__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- boltz/utils/yaml_generator.py +19 -20
- {boltz_vsynthes-1.0.43.dist-info → boltz_vsynthes-1.0.44.dist-info}/METADATA +1 -1
- {boltz_vsynthes-1.0.43.dist-info → boltz_vsynthes-1.0.44.dist-info}/RECORD +7 -7
- {boltz_vsynthes-1.0.43.dist-info → boltz_vsynthes-1.0.44.dist-info}/WHEEL +0 -0
- {boltz_vsynthes-1.0.43.dist-info → boltz_vsynthes-1.0.44.dist-info}/entry_points.txt +0 -0
- {boltz_vsynthes-1.0.43.dist-info → boltz_vsynthes-1.0.44.dist-info}/licenses/LICENSE +0 -0
- {boltz_vsynthes-1.0.43.dist-info → boltz_vsynthes-1.0.44.dist-info}/top_level.txt +0 -0
boltz/utils/yaml_generator.py
CHANGED
@@ -3,39 +3,33 @@ import yaml
|
|
3
3
|
from typing import Optional, Dict, Any
|
4
4
|
import string
|
5
5
|
|
6
|
-
def get_next_ligand_id(config: Dict[str, Any]) -> str:
|
6
|
+
def get_next_ligand_id(config: Dict[str, Any], index: int) -> str:
|
7
7
|
"""Get the next available ligand ID based on existing IDs in the config.
|
8
8
|
|
9
9
|
Parameters
|
10
10
|
----------
|
11
11
|
config : Dict[str, Any]
|
12
12
|
The configuration dictionary.
|
13
|
+
index : int
|
14
|
+
The index of the current ligand.
|
13
15
|
|
14
16
|
Returns
|
15
17
|
-------
|
16
18
|
str
|
17
19
|
The next available ligand ID.
|
18
20
|
"""
|
19
|
-
#
|
20
|
-
|
21
|
+
# Find the base ligand ID from the template
|
22
|
+
base_id = None
|
21
23
|
for item in config["sequences"]:
|
22
|
-
|
23
|
-
|
24
|
-
|
24
|
+
if "ligand" in item:
|
25
|
+
base_id = item["ligand"]["id"]
|
26
|
+
break
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
-
if letter not in existing_ids:
|
29
|
-
return letter
|
28
|
+
if base_id is None:
|
29
|
+
raise ValueError("No ligand ID found in template")
|
30
30
|
|
31
|
-
#
|
32
|
-
|
33
|
-
for second in string.ascii_uppercase:
|
34
|
-
new_id = first + second
|
35
|
-
if new_id not in existing_ids:
|
36
|
-
return new_id
|
37
|
-
|
38
|
-
raise ValueError("Ran out of available ligand IDs!")
|
31
|
+
# Append the index to the base ID
|
32
|
+
return f"{base_id}{index}"
|
39
33
|
|
40
34
|
def generate_yamls_from_sdfs(
|
41
35
|
template_yaml: Path,
|
@@ -75,7 +69,7 @@ def generate_yamls_from_sdfs(
|
|
75
69
|
config = template.copy()
|
76
70
|
|
77
71
|
# Get next available ligand ID
|
78
|
-
ligand_id = get_next_ligand_id(config)
|
72
|
+
ligand_id = get_next_ligand_id(config, i + 1)
|
79
73
|
|
80
74
|
# Update ligand information
|
81
75
|
for item in config["sequences"]:
|
@@ -92,7 +86,12 @@ def generate_yamls_from_sdfs(
|
|
92
86
|
# Write YAML file
|
93
87
|
output_file = output_dir / f"{yaml_prefix}{start_index + i}.yaml"
|
94
88
|
with open(output_file, "w") as f:
|
95
|
-
yaml.dump(
|
89
|
+
yaml.dump(
|
90
|
+
config,
|
91
|
+
f,
|
92
|
+
default_flow_style=False,
|
93
|
+
sort_keys=False, # Maintain original order
|
94
|
+
)
|
96
95
|
|
97
96
|
print(f"Created {output_file} with ligand ID {ligand_id}")
|
98
97
|
|
@@ -108,10 +108,10 @@ boltz/model/potentials/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
108
108
|
boltz/model/potentials/potentials.py,sha256=vev8Vjfs-ML1hyrdv_R8DynG4wSFahJ6nzPWp7CYQqw,17507
|
109
109
|
boltz/model/potentials/schedules.py,sha256=m7XJjfuF9uTX3bR9VisXv1rvzJjxiD8PobXRpcBBu1c,968
|
110
110
|
boltz/utils/sdf_splitter.py,sha256=ZHn_syOcmm-fDnJ3YEGyGv_vYz2IRzUW7vbbMSU2JBY,2108
|
111
|
-
boltz/utils/yaml_generator.py,sha256=
|
112
|
-
boltz_vsynthes-1.0.
|
113
|
-
boltz_vsynthes-1.0.
|
114
|
-
boltz_vsynthes-1.0.
|
115
|
-
boltz_vsynthes-1.0.
|
116
|
-
boltz_vsynthes-1.0.
|
117
|
-
boltz_vsynthes-1.0.
|
111
|
+
boltz/utils/yaml_generator.py,sha256=EiF_jX2H9aYfYDP_6AW7avdRRTAh81nusj_t7s8iPK8,3868
|
112
|
+
boltz_vsynthes-1.0.44.dist-info/licenses/LICENSE,sha256=8GZ_1eZsUeG6jdqgJJxtciWzADfgLEV4LY8sKUOsJhc,1102
|
113
|
+
boltz_vsynthes-1.0.44.dist-info/METADATA,sha256=LiuapPmWR_SnvEuoFiSogDnh57KTAoZmGCEl58frByU,7171
|
114
|
+
boltz_vsynthes-1.0.44.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
115
|
+
boltz_vsynthes-1.0.44.dist-info/entry_points.txt,sha256=R_G5TQWoiTDF3a2n7WQfpMLGufFd1lm5tZXVNaczlss,143
|
116
|
+
boltz_vsynthes-1.0.44.dist-info/top_level.txt,sha256=MgU3Jfb-ctWm07YGMts68PMjSh9v26D0gfG3dFRmVFA,6
|
117
|
+
boltz_vsynthes-1.0.44.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|