boltz-vsynthes 0.1.3__py3-none-any.whl → 0.1.4__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/data/parse/pdb.py CHANGED
@@ -8,6 +8,9 @@ from Bio.PDB.Polypeptide import PPBuilder
8
8
  from Bio.Data.IUPACData import protein_letters_3to1
9
9
  from rdkit import Chem
10
10
  from rdkit.Chem.rdchem import Mol
11
+ from Bio.SeqUtils import seq1
12
+ from collections import defaultdict
13
+
11
14
 
12
15
  from boltz.data.types import Target
13
16
  from boltz.data.parse.schema import parse_boltz_schema
@@ -38,27 +41,35 @@ def parse_pdb(
38
41
  Dictionary containing sequences and bonds.
39
42
  """
40
43
  # Read PDB file
41
- parser = PDBParser(QUIET=True)
42
- structure = parser.get_structure("protein", str(pdb_path))
43
- ppb = PPBuilder()
44
-
45
- # Convert to yaml format
46
44
  sequences = []
47
- for model in structure:
48
- for chain in model:
49
- for pp in ppb.build_peptides(chain):
50
- seq = str(pp.get_sequence())
51
- if seq: # Only add if sequence is not empty
52
- sequences.append({
53
- "protein": {
54
- "id": chain.id,
55
- "sequence": seq,
56
- "modifications": [],
57
- }
58
- })
45
+ sequence_by_chain = defaultdict(list)
46
+
47
+ # Parse SEQRES records directly
48
+ with open(pdb_path) as f:
49
+ for line in f:
50
+ if line.startswith("SEQRES"):
51
+ parts = line.split()
52
+ chain_id = parts[2]
53
+ residues = parts[4:]
54
+ for res in residues:
55
+ try:
56
+ aa = seq1(res)
57
+ except KeyError:
58
+ aa = 'X'
59
+ sequence_by_chain[chain_id].append(aa)
59
60
 
61
+ # Convert to yaml-style list
62
+ for chain_id, aa_list in sequence_by_chain.items():
63
+ sequences.append({
64
+ "protein": {
65
+ "id": chain_id,
66
+ "sequence": ''.join(aa_list),
67
+ "modifications": [],
68
+ }
69
+ })
70
+ print(sequences)
60
71
  return {
61
72
  "sequences": sequences,
62
73
  "bonds": [],
63
74
  "version": 1,
64
- }
75
+ }
@@ -8,6 +8,8 @@ from Bio.PDB.PDBParser import PDBParser
8
8
  from Bio.PDB.Polypeptide import PPBuilder
9
9
  from rdkit import Chem
10
10
  from rdkit.Chem.rdchem import Mol
11
+ from Bio.SeqUtils import seq1
12
+ from collections import defaultdict
11
13
 
12
14
  from boltz.data.types import Target
13
15
  from boltz.data.parse.schema import parse_boltz_schema
@@ -79,28 +81,36 @@ def parse_pdb_id(
79
81
  # Download PDB file
80
82
  pdb_path = download_pdb(pdb_id, cache_dir)
81
83
 
82
- # Read PDB file
83
- parser = PDBParser(QUIET=True)
84
- structure = parser.get_structure("protein", str(pdb_path))
85
- ppb = PPBuilder()
86
-
87
- # Convert to yaml format
88
84
  sequences = []
89
- for model in structure:
90
- for chain in model:
91
- for pp in ppb.build_peptides(chain):
92
- seq = str(pp.get_sequence())
93
- if seq: # Only add if sequence is not empty
94
- sequences.append({
95
- "protein": {
96
- "id": chain.id,
97
- "sequence": seq,
98
- "modifications": [],
99
- }
100
- })
85
+ sequence_by_chain = defaultdict(list)
86
+
87
+ # Parse SEQRES records directly
88
+ with open(pdb_path) as f:
89
+ for line in f:
90
+ if line.startswith("SEQRES"):
91
+ parts = line.split()
92
+ chain_id = parts[2]
93
+ residues = parts[4:]
94
+ for res in residues:
95
+ try:
96
+ aa = seq1(res)
97
+ except KeyError:
98
+ aa = 'X'
99
+ sequence_by_chain[chain_id].append(aa)
100
+
101
+ # Convert to yaml-style list
102
+ for chain_id, aa_list in sequence_by_chain.items():
103
+ sequences.append({
104
+ "protein": {
105
+ "id": chain_id,
106
+ "sequence": ''.join(aa_list),
107
+ "modifications": [],
108
+ }
109
+ })
110
+ print(sequences)
101
111
 
102
112
  return {
103
113
  "sequences": sequences,
104
114
  "bonds": [],
105
115
  "version": 1,
106
- }
116
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: boltz-vsynthes
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Boltz for VSYNTHES
5
5
  Requires-Python: <3.13,>=3.10
6
6
  Description-Content-Type: text/markdown
@@ -38,8 +38,8 @@ boltz/data/parse/csv.py,sha256=Hcq8rJW2njczahEr8jfd_o-zxLaNSgJ3YIoC9srIqpw,2518
38
38
  boltz/data/parse/fasta.py,sha256=taI4s_CqPtyF0XaLJAsVAJHCL0GXm2g1g8Qeccdxikk,3906
39
39
  boltz/data/parse/mmcif.py,sha256=25kEXCkx-OuaawAs7cdz0fxdRu5_CCO0AV00u84PrjQ,36822
40
40
  boltz/data/parse/mmcif_with_constraints.py,sha256=WHYZckSqUwu-Nb9vmVmxHmC7uxwVrF7AVUeVKsc5wGQ,51473
41
- boltz/data/parse/pdb.py,sha256=iybk4p2UgUy_ABGprDq_xxyPSdm1HAZsGTM0lhxVEwM,1654
42
- boltz/data/parse/pdb_download.py,sha256=wge-scX-lOatX0q83W1wOsaql99rYp-6uGWSHEc995M,2718
41
+ boltz/data/parse/pdb.py,sha256=873jPx4D-OTBTd4lIn3GquYt0OLX4gbfzyAldxtzIIA,1913
42
+ boltz/data/parse/pdb_download.py,sha256=Ys2fepXD6RLYyq6xjHFNsoAStxISuvQ_EUEt0JwmrK0,2958
43
43
  boltz/data/parse/schema.py,sha256=kNu28U2_MGiecwWNlcxgaDH3WOcO0P-q2LdoSPSb66w,63826
44
44
  boltz/data/parse/sdf.py,sha256=fs3MQVClDcCzxJaeVYiDuoh-fUrYc8Tcd5Bz8ws3FKI,2052
45
45
  boltz/data/parse/yaml.py,sha256=GRFRMtDD4PQ4PIpA_S1jj0vRaEu2LlZd_g4rN1zUrNo,1505
@@ -110,9 +110,9 @@ boltz/model/potentials/schedules.py,sha256=m7XJjfuF9uTX3bR9VisXv1rvzJjxiD8PobXRp
110
110
  boltz/utils/sdf_splitter.py,sha256=ZHn_syOcmm-fDnJ3YEGyGv_vYz2IRzUW7vbbMSU2JBY,2108
111
111
  boltz/utils/sdf_to_pre_affinity_npz.py,sha256=ro0KGe24JexbJm47J8S8w8Lmr_KaQbzOAb_dKZO2G9I,40384
112
112
  boltz/utils/yaml_generator.py,sha256=ermWIG-BE6nNWHFvpEwpk92N9J-YATpGXZGLvD1I2oQ,4012
113
- boltz_vsynthes-0.1.3.dist-info/licenses/LICENSE,sha256=8GZ_1eZsUeG6jdqgJJxtciWzADfgLEV4LY8sKUOsJhc,1102
114
- boltz_vsynthes-0.1.3.dist-info/METADATA,sha256=HBpb17_3dujv6tXG1SdhhsMBMckGUhJ8ZDT6ou_G06Y,7234
115
- boltz_vsynthes-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
116
- boltz_vsynthes-0.1.3.dist-info/entry_points.txt,sha256=nZNYPKKrmAr-MVA0K-ClNRT2p90FV1_14d7HpsESZFQ,211
117
- boltz_vsynthes-0.1.3.dist-info/top_level.txt,sha256=MgU3Jfb-ctWm07YGMts68PMjSh9v26D0gfG3dFRmVFA,6
118
- boltz_vsynthes-0.1.3.dist-info/RECORD,,
113
+ boltz_vsynthes-0.1.4.dist-info/licenses/LICENSE,sha256=8GZ_1eZsUeG6jdqgJJxtciWzADfgLEV4LY8sKUOsJhc,1102
114
+ boltz_vsynthes-0.1.4.dist-info/METADATA,sha256=_MxyMdy8K71CIe85VHRqIvHArfBjy7pd-fZjoDpInJo,7234
115
+ boltz_vsynthes-0.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
116
+ boltz_vsynthes-0.1.4.dist-info/entry_points.txt,sha256=nZNYPKKrmAr-MVA0K-ClNRT2p90FV1_14d7HpsESZFQ,211
117
+ boltz_vsynthes-0.1.4.dist-info/top_level.txt,sha256=MgU3Jfb-ctWm07YGMts68PMjSh9v26D0gfG3dFRmVFA,6
118
+ boltz_vsynthes-0.1.4.dist-info/RECORD,,