boltz-vsynthes 1.0.42__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.
@@ -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
- # Get all existing IDs
20
- existing_ids = set()
21
+ # Find the base ligand ID from the template
22
+ base_id = None
21
23
  for item in config["sequences"]:
22
- for key in item:
23
- if "id" in item[key]:
24
- existing_ids.add(item[key]["id"])
24
+ if "ligand" in item:
25
+ base_id = item["ligand"]["id"]
26
+ break
25
27
 
26
- # Find the first available letter
27
- for letter in string.ascii_uppercase:
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
- # If we run out of single letters, use AA, AB, etc.
32
- for first in string.ascii_uppercase:
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(config, f, default_flow_style=False)
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: boltz-vsynthes
3
- Version: 1.0.42
3
+ Version: 1.0.44
4
4
  Summary: Boltz for VSYNTHES
5
5
  Requires-Python: <3.13,>=3.10
6
6
  Description-Content-Type: text/markdown
@@ -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=0Lg7F5dQRX75_xR8jiFVokSprDmFzsNmhaITI4fHjao,3980
112
- boltz_vsynthes-1.0.42.dist-info/licenses/LICENSE,sha256=8GZ_1eZsUeG6jdqgJJxtciWzADfgLEV4LY8sKUOsJhc,1102
113
- boltz_vsynthes-1.0.42.dist-info/METADATA,sha256=IKbpa2PuzcHwROQ7sbRRf2GXL7HmlWzHRg3NUHGrZ58,7171
114
- boltz_vsynthes-1.0.42.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
115
- boltz_vsynthes-1.0.42.dist-info/entry_points.txt,sha256=n5a5I35ntu9lmyr16oZgHPFY0b0YxjiixY7m7nbMTLc,41
116
- boltz_vsynthes-1.0.42.dist-info/top_level.txt,sha256=MgU3Jfb-ctWm07YGMts68PMjSh9v26D0gfG3dFRmVFA,6
117
- boltz_vsynthes-1.0.42.dist-info/RECORD,,
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,,
@@ -0,0 +1,4 @@
1
+ [console_scripts]
2
+ boltz = boltz.main:cli
3
+ boltz-generate-yaml = boltz.utils.yaml_generator:main
4
+ boltz-split-sdf = boltz.utils.sdf_splitter:main
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- boltz = boltz.main:cli