pengzhangzhi / ab_opt

Official implementation of Generative Diffusion Models for Antibody Design, Docking, and Optimization.
Apache License 2.0
45 stars 7 forks source link

Error while executing optimize_ab.py in 7DK2_AB_C.pdb #3

Open dealmeida-vm opened 3 months ago

dealmeida-vm commented 3 months ago

Hello, I was following the "Pratope-epitope Docking using AbDock" pipeline inside the AbDock folder. When executing the script optimize_ab.py, the following error came up:

$ python optimize_ab.py --num_gpus 1 --process_per_gpu 1 --docked_pose_dir "results/dock_cdr/7bsd_A_BG.pdb/H_CDR3" --seq_design_dir "results/seq_design_fixed_pos/mutation/CDRH3_7_9" --design_model_ckpt "reproduction/seq_design_fixed_pos/300000.pt" --design_contig "6-9" --screen_dir "results/screening/seq_design_fixed_pos/mutation/CDRH3_7_9" --dock_model_ckpt "reproduction/dock_single_cdr/250000.pt" --heavy_chain_id "A" --nums 100 --pdb_suffix "rosetta" ┌──────────────────────────────────────────────────────────────────────────────┐ │ PyRosetta-4 │ │ Created in JHU by Sergey Lyskov and PyRosetta Team │ │ (C) Copyright Rosetta Commons Member Institutions │ │ │ │ NOTE: USE OF PyRosetta FOR COMMERCIAL PURPOSES REQUIRE PURCHASE OF A LICENSE │ │ See LICENSE.PyRosetta.md or email license@uw.edu for details │ └──────────────────────────────────────────────────────────────────────────────┘ PyRosetta-4 2024 [Rosetta PyRosetta4.Release.python38.ubuntu 2024.19+release.a34b73c40fe9c61558d566d6a63f803cfb15a4fc 2024-05-02T16:22:03] retrieved from: http://www.pyrosetta.org /home/vitor/anaconda3/envs/antibody_dock/lib/python3.8/site-packages/Bio/Align/substitution_matrices/init.py:16: BiopythonExperimentalWarning: Bio.Align.substitution_matrices is an experimental module which may still undergo significant changes. In particular, the location of this module may change, and the Array class defined in this module may be moved to other existing or new modules in Biopython. warnings.warn("Bio.Align.substitution_matrices is an experimental module " ┌──────────────────────────────────────────────────────────────────────────────┐ │ PyRosetta-4 │ │ Created in JHU by Sergey Lyskov and PyRosetta Team │ │ (C) Copyright Rosetta Commons Member Institutions │ │ │ │ NOTE: USE OF PyRosetta FOR COMMERCIAL PURPOSES REQUIRE PURCHASE OF A LICENSE │ │ See LICENSE.PyRosetta.md or email license@uw.edu for details │ └──────────────────────────────────────────────────────────────────────────────┘ PyRosetta-4 2024 [Rosetta PyRosetta4.Release.python38.ubuntu 2024.19+release.a34b73c40fe9c61558d566d6a63f803cfb15a4fc 2024-05-02T16:22:03] retrieved from: http://www.pyrosetta.org 2024-05-15 11:02:16,657 INFO worker.py:1743 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265 Submitted 1001 tasks. (pid=31812) ┌──────────────────────────────────────────────────────────────────────────────┐ (pid=31812) │ PyRosetta-4 │ (pid=31812) │ Created in JHU by Sergey Lyskov and PyRosetta Team │ (pid=31812) │ (C) Copyright Rosetta Commons Member Institutions │ (pid=31812) │ │ (pid=31812) │ NOTE: USE OF PyRosetta FOR COMMERCIAL PURPOSES REQUIRE PURCHASE OF A LICENSE │ (pid=31812) │ See LICENSE.PyRosetta.md or email license@uw.edu for details │ (pid=31812) └──────────────────────────────────────────────────────────────────────────────┘ (pid=31812) PyRosetta-4 2024 [Rosetta PyRosetta4.Release.python38.ubuntu 2024.19+release.a34b73c40fe9c61558d566d6a63f803cfb15a4fc 2024-05-02T16:22:03] retrieved from: http://www.pyrosetta.org (pid=32832) ┌──────────────────────────────────────────────────────────────────────────────┐ [repeated 9x across cluster] (Ray deduplicates logs by default. Set RAY_DEDUP_LOGS=0 to disable log deduplication, or see https://docs.ray.io/en/master/ray-observability/ray-logging.html#log-deduplication for more options.) (pid=32832) │ │ [repeated 18x across cluster] (pid=32832) │ Created in JHU by Sergey Lyskov and PyRosetta Team │ [repeated 9x across cluster] (pid=32832) │ (C) Copyright Rosetta Commons Member Institutions │ [repeated 9x across cluster] (pid=32832) │ NOTE: USE OF PyRosetta FOR COMMERCIAL PURPOSES REQUIRE PURCHASE OF A LICENSE │ [repeated 9x across cluster] (pid=32832) │ See LICENSE.PyRosetta.md or email license@uw.edu for details │ [repeated 9x across cluster] (pid=32832) └──────────────────────────────────────────────────────────────────────────────┘ [repeated 9x across cluster] (pid=32832) PyRosetta-4 2024 [Rosetta PyRosetta4.Release.python38.ubuntu 2024.19+release.a34b73c40fe9c61558d566d6a63f803cfb15a4fc 2024-05-02T16:22:03] retrieved from: http://www.pyrosetta.org [repeated 9x across cluster] Traceback (most recent call last): File "optimize_ab.py", line 112, in relax_main(EasyDict({ File "/home/vitor/ab_opt-main/AbDock/src/tools/relax/run.py", line 121, in main ray.get(futures) File "/home/vitor/anaconda3/envs/antibody_dock/lib/python3.8/site-packages/ray/_private/auto_init_hook.py", line 21, in auto_init_wrapper return fn(*args, *kwargs) File "/home/vitor/anaconda3/envs/antibody_dock/lib/python3.8/site-packages/ray/_private/client_mode_hook.py", line 103, in wrapper return func(args, *kwargs) File "/home/vitor/anaconda3/envs/antibody_dock/lib/python3.8/site-packages/ray/_private/worker.py", line 2667, in get values, debugger_breakpoint = worker.get_objects(object_refs, timeout=timeout) File "/home/vitor/anaconda3/envs/antibody_dock/lib/python3.8/site-packages/ray/_private/worker.py", line 864, in get_objects raise value.as_instanceof_cause() ray.exceptions.RayTaskError(TypeError): ray::pipeline_openmm_pyrosetta() (pid=31814, ip=192.168.0.208) File "/home/vitor/ab_opt-main/AbDock/src/tools/relax/run.py", line 40, in pipeline_openmm_pyrosetta return ray.get(task) ray.exceptions.RayTaskError(TypeError): ray::run_pyrosetta_remote() (pid=32832, ip=192.168.0.208) At least one of the input arguments for this task could not be computed: ray.exceptions.RayTaskError: ray::run_openmm_remote() (pid=32144, ip=192.168.0.208) File "/home/vitor/ab_opt-main/AbDock/src/tools/relax/run.py", line 12, in run_openmm_remote return run_openmm(task) File "/home/vitor/ab_opt-main/AbDock/src/tools/relax/openmm_relaxer.py", line 128, in run_openmm pdb_min = minimizer( File "/home/vitor/ab_opt-main/AbDock/src/tools/relax/openmm_relaxer.py", line 109, in call pdb_min, ret = self._minimize(pdb_fixed, flexible_residue_first, flexible_residue_last) File "/home/vitor/ab_opt-main/AbDock/src/tools/relax/openmm_relaxer.py", line 88, in _minimize simulation.minimizeEnergy(maxIterations=self.max_iterations, tolerance=self.tolerance) File "/home/vitor/anaconda3/envs/antibody_dock/lib/python3.8/site-packages/openmm/app/simulation.py", line 143, in minimizeEnergy mm.LocalEnergyMinimizer.minimize(self.context, tolerance, maxIterations, reporter) File "/home/vitor/anaconda3/envs/antibody_dock/lib/python3.8/site-packages/openmm/openmm.py", line 4422, in minimize tolerance = tolerance.value_in_unit(unit.kilojoules_per_mole/unit.nanometer) File "/home/vitor/anaconda3/envs/antibody_dock/lib/python3.8/site-packages/openmm/unit/quantity.py", line 626, in value_in_unit val = self.in_units_of(unit) File "/home/vitor/anaconda3/envs/antibody_dock/lib/python3.8/site-packages/openmm/unit/quantity.py", line 662, in in_units_of raise TypeError('Unit "%s" is not compatible with Unit "%s".' % (self.unit, other_unit)) TypeError: Unit "kilocalorie/mole" is not compatible with Unit "kilojoule/(nanometermole)". (pid=32836) ┌──────────────────────────────────────────────────────────────────────────────┐ [repeated 6x across cluster] (pid=32836) │ │ [repeated 12x across cluster] (pid=32836) │ Created in JHU by Sergey Lyskov and PyRosetta Team │ [repeated 6x across cluster] (pid=32836) │ (C) Copyright Rosetta Commons Member Institutions │ [repeated 6x across cluster] (pid=32836) │ NOTE: USE OF PyRosetta FOR COMMERCIAL PURPOSES REQUIRE PURCHASE OF A LICENSE │ [repeated 6x across cluster] (pid=32836) │ See LICENSE.PyRosetta.md or email license@uw.edu for details │ [repeated 6x across cluster] (pid=32836) └──────────────────────────────────────────────────────────────────────────────┘ [repeated 6x across cluster] (pid=32836) PyRosetta-4 2024 [Rosetta PyRosetta4.Release.python38.ubuntu 2024.19+release.a34b73c40fe9c61558d566d6a63f803cfb15a4fc 2024-05-02T16:22:03] retrieved from: http://www.pyrosetta.org [repeated 6x across cluster]

pengzhangzhi commented 3 months ago

This is an error from pyrosetta, I suggest download the same version as what I used in the README.

Please obtain the username and password on the PyRosetta website.

wget --user={user} --password={psw} https://graylab.jhu.edu/download/PyRosetta4/archive/release/PyRosetta4.Release.python38.linux/PyRosetta4.Release.python38.linux.release-350.tar.bz2
tar -xvjf PyRosetta4.Release.python38.linux.release-350.tar.bz2
cd PyRosetta4.Release.python38.linux.release-350
python setup/setup.py install
cd ..
TangYiChing commented 2 months ago

Hi, I am encountering the same error, but the python38.linux.release-350 tarball is not available now. Do you know which existing version could solve the error?

pengzhangzhi commented 2 months ago

You want to go to the PyRosetta website and follow the official instructions.

TangYiChing commented 2 months ago

It turns out to be the openmm problem. I modified the code at line 28 in the script: /ab_opt/AbDock/src/tools/relax/openmm_relaxer.py

from: def __init__(self, stiffness=10.0, max_iterations=0, tolerance=2.39*unit.kilocalories_per_mole, platform='CUDA'): to: def __init__(self, stiffness=10.0, max_iterations=0, tolerance=2.39*unit.kilojoules_per_mole/unit.nanometer, platform='CUDA')