Cannot create normalized xyzVector from vector of length() zero
Discussed in https://github.com/RosettaCommons/rosetta/discussions/258
Originally posted by pacho2 December 2, 2024 Hello,
I am contacting you because I am having issues to make BindCraft (https://github.com/martinpacesa/BindCraft) work on my system.
I reported it before to them: https://github.com/martinpacesa/BindCraft/issues/113
But it seems that the problem may be on pyrosetta side.
The problem appears when FastRelax is used. I have found similar issues but I couldn't find a solution. I also tried to change the minimization algorithm without success: https://docs.rosettacommons.org/docs/latest/rosetta_basics/structural_concepts/minimization-overview
Some comments blame on the PDB file, but I suffer the problem even with the "clean" example one: https://github.com/martinpacesa/BindCraft/blob/main/example/PDL1.pdb
I also tried to change pyrosetta version from 2024.19 to 2024.42 without success. The error happens when fastrelax.apply is called at: https://github.com/martinpacesa/BindCraft/blob/main/functions/pyrosetta_utils.py#L224
And the error is:
Running semigreedy optimization...
126 models [0] recycles 1 hard 1 soft 0 temp 1 loss 7.50 helix 1.41 pae 0.64 i_pae 0.71 con 3.36 i_con 4.13 plddt 0.42 ptm 0.77 i_ptm 0.17 rg 0.01
127 models [2] recycles 1 hard 1 soft 0 temp 1 loss 7.59 helix 1.20 pae 0.62 i_pae 0.69 con 3.41 i_con 4.02 plddt 0.45 ptm 0.78 i_ptm 0.20 rg 0.38
128 models [3] recycles 1 hard 1 soft 0 temp 1 loss 5.52 helix 1.54 pae 0.30 i_pae 0.33 con 2.63 i_con 2.92 plddt 0.71 ptm 0.85 i_ptm 0.61 rg 0.78
129 models [4] recycles 1 hard 1 soft 0 temp 1 loss 7.98 helix 1.19 pae 0.66 i_pae 0.72 con 3.55 i_con 4.12 plddt 0.38 ptm 0.77 i_ptm 0.16 rg 0.76
130 models [4] recycles 1 hard 1 soft 0 temp 1 loss 7.92 helix 1.18 pae 0.66 i_pae 0.73 con 3.48 i_con 4.17 plddt 0.39 ptm 0.77 i_ptm 0.16 rg 0.61
131 models [2] recycles 1 hard 1 soft 0 temp 1 loss 7.92 helix 1.19 pae 0.68 i_pae 0.75 con 3.31 i_con 4.29 plddt 0.43 ptm 0.77 i_ptm 0.14 rg 0.77
132 models [3] recycles 1 hard 1 soft 0 temp 1 loss 8.43 helix 1.14 pae 0.67 i_pae 0.72 con 3.79 i_con 4.20 plddt 0.36 ptm 0.77 i_ptm 0.17 rg 1.09
133 models [1] recycles 1 hard 1 soft 0 temp 1 loss 8.23 helix 1.07 pae 0.67 i_pae 0.73 con 3.69 i_con 4.18 plddt 0.36 ptm 0.77 i_ptm 0.15 rg 0.81
134 models [1] recycles 1 hard 1 soft 0 temp 1 loss 8.14 helix 1.12 pae 0.67 i_pae 0.73 con 3.70 i_con 4.16 plddt 0.34 ptm 0.77 i_ptm 0.16 rg 0.54
135 models [0] recycles 1 hard 1 soft 0 temp 1 loss 8.00 helix 1.21 pae 0.67 i_pae 0.73 con 3.57 i_con 4.18 plddt 0.35 ptm 0.76 i_ptm 0.16 rg 0.56
136 models [4] recycles 1 hard 1 soft 0 temp 1 loss 8.02 helix 1.18 pae 0.64 i_pae 0.70 con 3.51 i_con 3.96 plddt 0.36 ptm 0.78 i_ptm 0.20 rg 1.58
137 models [3] recycles 1 hard 1 soft 0 temp 1 loss 8.34 helix 1.21 pae 0.68 i_pae 0.75 con 3.40 i_con 4.20 plddt 0.36 ptm 0.77 i_ptm 0.15 rg 2.17
138 models [4] recycles 1 hard 1 soft 0 temp 1 loss 8.20 helix 1.21 pae 0.69 i_pae 0.75 con 3.53 i_con 4.13 plddt 0.34 ptm 0.77 i_ptm 0.15 rg 1.44
139 models [0] recycles 1 hard 1 soft 0 temp 1 loss 7.86 helix 1.27 pae 0.70 i_pae 0.78 con 3.28 i_con 4.43 plddt 0.38 ptm 0.75 i_ptm 0.12 rg 0.24
140 models [1] recycles 1 hard 1 soft 0 temp 1 loss 9.07 helix 1.40 pae 0.73 i_pae 0.78 con 3.93 i_con 4.30 plddt 0.29 ptm 0.76 i_ptm 0.13 rg 2.58
Trajectory successful, final pLDDT: 0.71
Starting trajectory took: 0 hours, 7 minutes, 17 seconds
Traceback (most recent call last):
File "/home/pacho/BindCraft-1.2.0_post20241124/./bindcraft.py", line 125, in <module>
pr_relax(trajectory_pdb, trajectory_relaxed)
File "/home/pacho/BindCraft-1.2.0_post20241124/functions/pyrosetta_utils.py", line 224, in pr_relax
fastrelax.apply(pose)
RuntimeError:
File: /home/benchmark/rosetta/source/src/core/kinematics/Stub.cc:106
Error in Stub::from_four_points():
File: /home/benchmark/rosetta/source/build/PyRosetta/Linux-5.4.0-84-generic-x86_64-with-glibc2.27/clang-6.0.0/python-3.10/release.serialization.thread/source/src/numeric/xyzVector.hh:654
Cannot create normalized xyzVector from vector of length() zero. Error occurred when trying to normalize the vector between points A and B. A=[56,000000,54,000000,51,000000], B=[56,000000,54,000000,51,000000].
As it seems that, somehow, vectors A and B end up having the same values (not always the same exact values, but sooner or later it dies because A and B fully coincide).
Thanks a lot for your assistance and help
If I understand correctly what BindCraft is doing, I think it ends up passing this PDB to the relax function: https://github.com/user-attachments/files/18027284/PDL1_l23_s495156.pdb.txt
Hello,
It seems the problem happens when running it from a graphical X session, while it works ok when running it on a text console https://github.com/martinpacesa/BindCraft/issues/113#issuecomment-2532631903