boltz-vsynthes 1.0.3__py3-none-any.whl → 1.0.5__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/main.py CHANGED
@@ -669,46 +669,50 @@ def process_inputs(
669
669
  processed_dir = out_dir / "processed"
670
670
  processed_dir.mkdir(parents=True, exist_ok=True)
671
671
 
672
- # Create structure directory
672
+ # Create central directories
673
673
  structure_dir = processed_dir / "structures"
674
+ msa_dir = processed_dir / "msa"
675
+ records_dir = processed_dir / "records"
676
+ processed_msa_dir = processed_dir / "processed" / "msa"
677
+ processed_constraints_dir = processed_dir / "processed" / "constraints"
678
+ processed_templates_dir = processed_dir / "processed" / "templates"
679
+ processed_mols_dir = processed_dir / "processed" / "mols"
680
+ predictions_dir = processed_dir / "predictions"
681
+
682
+ # Create all central directories
674
683
  structure_dir.mkdir(parents=True, exist_ok=True)
684
+ msa_dir.mkdir(parents=True, exist_ok=True)
685
+ records_dir.mkdir(parents=True, exist_ok=True)
686
+ processed_msa_dir.mkdir(parents=True, exist_ok=True)
687
+ processed_constraints_dir.mkdir(parents=True, exist_ok=True)
688
+ processed_templates_dir.mkdir(parents=True, exist_ok=True)
689
+ processed_mols_dir.mkdir(parents=True, exist_ok=True)
690
+ predictions_dir.mkdir(parents=True, exist_ok=True)
675
691
 
676
692
  # Process each input file in its own directory
677
693
  for input_file in data:
678
694
  # Create a subdirectory for this input file
679
695
  file_out_dir = out_dir / input_file.stem
680
696
  file_out_dir.mkdir(parents=True, exist_ok=True)
681
-
682
- # Check if records exist at output path
683
- records_dir = file_out_dir / "processed" / "records"
684
- if records_dir.exists():
685
- # Load existing records
686
- existing = [Record.load(p) for p in records_dir.glob("*.json")]
687
- processed_ids = {record.id for record in existing}
688
-
689
- # Skip if already processed
690
- if input_file.stem in processed_ids:
691
- click.echo(f"Found existing processed input for {input_file.stem}, skipping.")
692
- all_records.extend(existing)
693
- continue
694
697
 
695
698
  # Create output directories for this file
696
- msa_dir = file_out_dir / "msa"
697
- records_dir = file_out_dir / "processed" / "records"
698
- processed_msa_dir = file_out_dir / "processed" / "msa"
699
- processed_constraints_dir = file_out_dir / "processed" / "constraints"
700
- processed_templates_dir = file_out_dir / "processed" / "templates"
701
- processed_mols_dir = file_out_dir / "processed" / "mols"
702
- predictions_dir = file_out_dir / "predictions"
703
-
699
+ file_msa_dir = file_out_dir / "msa"
700
+ file_records_dir = file_out_dir / "processed" / "records"
701
+ file_processed_msa_dir = file_out_dir / "processed" / "msa"
702
+ file_processed_constraints_dir = file_out_dir / "processed" / "constraints"
703
+ file_processed_templates_dir = file_out_dir / "processed" / "templates"
704
+ file_processed_mols_dir = file_out_dir / "processed" / "mols"
705
+ file_predictions_dir = file_out_dir / "predictions"
706
+
707
+ # Create all file-specific directories
704
708
  file_out_dir.mkdir(parents=True, exist_ok=True)
705
- msa_dir.mkdir(parents=True, exist_ok=True)
706
- records_dir.mkdir(parents=True, exist_ok=True)
707
- processed_msa_dir.mkdir(parents=True, exist_ok=True)
708
- processed_constraints_dir.mkdir(parents=True, exist_ok=True)
709
- processed_templates_dir.mkdir(parents=True, exist_ok=True)
710
- processed_mols_dir.mkdir(parents=True, exist_ok=True)
711
- predictions_dir.mkdir(parents=True, exist_ok=True)
709
+ file_msa_dir.mkdir(parents=True, exist_ok=True)
710
+ file_records_dir.mkdir(parents=True, exist_ok=True)
711
+ file_processed_msa_dir.mkdir(parents=True, exist_ok=True)
712
+ file_processed_constraints_dir.mkdir(parents=True, exist_ok=True)
713
+ file_processed_templates_dir.mkdir(parents=True, exist_ok=True)
714
+ file_processed_mols_dir.mkdir(parents=True, exist_ok=True)
715
+ file_predictions_dir.mkdir(parents=True, exist_ok=True)
712
716
 
713
717
  # Load CCD
714
718
  if boltz2:
@@ -721,27 +725,34 @@ def process_inputs(
721
725
  process_input_partial = partial(
722
726
  process_input,
723
727
  ccd=ccd,
724
- msa_dir=msa_dir,
728
+ msa_dir=file_msa_dir,
725
729
  mol_dir=mol_dir,
726
730
  boltz2=boltz2,
727
731
  use_msa_server=use_msa_server,
728
732
  msa_server_url=msa_server_url,
729
733
  msa_pairing_strategy=msa_pairing_strategy,
730
734
  max_msa_seqs=max_msa_seqs,
731
- processed_msa_dir=processed_msa_dir,
732
- processed_constraints_dir=processed_constraints_dir,
733
- processed_templates_dir=processed_templates_dir,
734
- processed_mols_dir=processed_mols_dir,
735
+ processed_msa_dir=file_processed_msa_dir,
736
+ processed_constraints_dir=file_processed_constraints_dir,
737
+ processed_templates_dir=file_processed_templates_dir,
738
+ processed_mols_dir=file_processed_mols_dir,
735
739
  structure_dir=structure_dir, # Use the central structure directory
736
- records_dir=records_dir,
740
+ records_dir=file_records_dir,
737
741
  )
738
742
 
739
743
  # Process this input file
740
744
  click.echo(f"Processing {input_file.name}")
741
745
  process_input_partial(input_file)
742
746
 
747
+ # Copy MSA files to central MSA directory
748
+ for msa_file in file_processed_msa_dir.glob("*.npz"):
749
+ target_msa_file = msa_dir / msa_file.name
750
+ if not target_msa_file.exists():
751
+ import shutil
752
+ shutil.copy2(msa_file, target_msa_file)
753
+
743
754
  # Load records for this file
744
- records = [Record.load(p) for p in records_dir.glob("*.json")]
755
+ records = [Record.load(p) for p in file_records_dir.glob("*.json")]
745
756
  all_records.extend(records)
746
757
 
747
758
  # Create combined manifest
@@ -952,11 +963,6 @@ def cli() -> None:
952
963
  is_flag=True,
953
964
  help="Whether to disable the kernels. Default False",
954
965
  )
955
- @click.option(
956
- "--skip_structure",
957
- is_flag=True,
958
- help="Skip structure prediction and go straight to affinity prediction. Default is False.",
959
- )
960
966
  def predict( # noqa: C901, PLR0915, PLR0912
961
967
  data: str,
962
968
  out_dir: str,
@@ -990,7 +996,6 @@ def predict( # noqa: C901, PLR0915, PLR0912
990
996
  subsample_msa: bool = True,
991
997
  num_subsampled_msa: int = 1024,
992
998
  no_kernels: bool = False,
993
- skip_structure: bool = False,
994
999
  ) -> None:
995
1000
  """Run predictions with Boltz."""
996
1001
  # If cpu, write a friendly warning
@@ -1151,7 +1156,7 @@ def predict( # noqa: C901, PLR0915, PLR0912
1151
1156
  precision=32 if model == "boltz1" else "bf16-mixed",
1152
1157
  )
1153
1158
 
1154
- if filtered_manifest.records and not skip_structure:
1159
+ if filtered_manifest.records:
1155
1160
  msg = f"Running structure prediction for {len(filtered_manifest.records)} input"
1156
1161
  msg += "s." if len(filtered_manifest.records) > 1 else "."
1157
1162
  click.echo(msg)
@@ -1240,14 +1245,6 @@ def predict( # noqa: C901, PLR0915, PLR0912
1240
1245
  msg += "s." if len(manifest_filtered.records) > 1 else "."
1241
1246
  click.echo(msg)
1242
1247
 
1243
- # When skipping structure prediction, we need to ensure structure files exist
1244
- if skip_structure:
1245
- for record in manifest_filtered.records:
1246
- structure_path = out_dir / "predictions" / record.id / f"pre_affinity_{record.id}.npz"
1247
- if not structure_path.exists():
1248
- msg = f"Structure file not found for {record.id}. Cannot run affinity prediction without structure."
1249
- raise FileNotFoundError(msg)
1250
-
1251
1248
  pred_writer = BoltzAffinityWriter(
1252
1249
  data_dir=processed.targets_dir,
1253
1250
  output_dir=out_dir / "predictions",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: boltz-vsynthes
3
- Version: 1.0.3
3
+ Version: 1.0.5
4
4
  Summary: Boltz for V-Synthes
5
5
  Requires-Python: <3.13,>=3.10
6
6
  Description-Content-Type: text/markdown
@@ -1,5 +1,5 @@
1
1
  boltz/__init__.py,sha256=F_-so3S40iZrSZ89Ge4TS6aZqwWyZXq_H4AXGDlbA_g,187
2
- boltz/main.py,sha256=p-iXEzVh_CAkKZs2MJ7EojQQdIZnC9cYXr9Bax_PrU4,41377
2
+ boltz/main.py,sha256=sF_fNSzOElFhnlUBrnRidY1Dg_dduIHl23CREMo_ICc,41374
3
3
  boltz/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  boltz/data/const.py,sha256=1M-88Z6HkfKY6MkNtqcj3b9P-oX9xEXluh3qM_u8dNU,26779
5
5
  boltz/data/mol.py,sha256=maOpPHEGX1VVXCIFY6pQNGF7gUBZPAfgSvuPf2QO1yc,34268
@@ -104,9 +104,9 @@ boltz/model/optim/scheduler.py,sha256=nB4jz0CZ4pR4n08LQngExL_pNycIdYI8AXVoHPnZWQ
104
104
  boltz/model/potentials/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
105
105
  boltz/model/potentials/potentials.py,sha256=vev8Vjfs-ML1hyrdv_R8DynG4wSFahJ6nzPWp7CYQqw,17507
106
106
  boltz/model/potentials/schedules.py,sha256=m7XJjfuF9uTX3bR9VisXv1rvzJjxiD8PobXRpcBBu1c,968
107
- boltz_vsynthes-1.0.3.dist-info/licenses/LICENSE,sha256=8GZ_1eZsUeG6jdqgJJxtciWzADfgLEV4LY8sKUOsJhc,1102
108
- boltz_vsynthes-1.0.3.dist-info/METADATA,sha256=KQnSi_PP-_Gkz8yG3ED3-a_R4-IUlX92QZxwG8eQe8w,7171
109
- boltz_vsynthes-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
110
- boltz_vsynthes-1.0.3.dist-info/entry_points.txt,sha256=n5a5I35ntu9lmyr16oZgHPFY0b0YxjiixY7m7nbMTLc,41
111
- boltz_vsynthes-1.0.3.dist-info/top_level.txt,sha256=MgU3Jfb-ctWm07YGMts68PMjSh9v26D0gfG3dFRmVFA,6
112
- boltz_vsynthes-1.0.3.dist-info/RECORD,,
107
+ boltz_vsynthes-1.0.5.dist-info/licenses/LICENSE,sha256=8GZ_1eZsUeG6jdqgJJxtciWzADfgLEV4LY8sKUOsJhc,1102
108
+ boltz_vsynthes-1.0.5.dist-info/METADATA,sha256=-MCCHAI1TOA1tlDaX-X6npP-HgYgJZht77XK-J9CeAI,7171
109
+ boltz_vsynthes-1.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
110
+ boltz_vsynthes-1.0.5.dist-info/entry_points.txt,sha256=n5a5I35ntu9lmyr16oZgHPFY0b0YxjiixY7m7nbMTLc,41
111
+ boltz_vsynthes-1.0.5.dist-info/top_level.txt,sha256=MgU3Jfb-ctWm07YGMts68PMjSh9v26D0gfG3dFRmVFA,6
112
+ boltz_vsynthes-1.0.5.dist-info/RECORD,,