RosettaCommons / RosettaCommons/rosetta

Cannot create normalized xyzVector from vector of length() zero

Open
#264 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
470
Forks
169
Avg merge
16d 23h
Merged PRs (30d)
2

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure at functions/pyrosetta_utils.py:224 with the reported PDL1.pdb example and inspect the traceback locations Stub.cc:106 and numeric/xyzVector.hh:654. Trace how FastRelax reaches Stub::from_four_points() when points A and B coincide. Done means the reported input no longer aborts with the zero-length normalization error, with a regression test covering the case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
bioinformatics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.