Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fragmentation failed #177

Closed
okbckim opened this issue Apr 30, 2024 · 2 comments · Fixed by #178
Closed

Fragmentation failed #177

okbckim opened this issue Apr 30, 2024 · 2 comments · Fixed by #178

Comments

@okbckim
Copy link

okbckim commented Apr 30, 2024

Description

Please describe what you were trying to do, what you expected to happen, and what happened instead.

This molecule failed in fragmentation stage.

Reproduction
test.tar.gz

Please include a minimally reproducing example of this bug.
BEFLOW_OPTIMIZER_KEEP_FILES=True openff-bespoke executor run --directory fitting --n-fragmenter-workers 2 --n-optimizer-workers 2 --n-qc-compute-workers 2 --qc-compute-n-cores 1 --file test2.sdf --output test2.sdf.json --output-force-field test2.sdf.offxml --workflow "default" --default-qc-spec xtb gfn2xtb none

BEFLOW_OPTIMIZER_KEEP_FILES=True openff-bespoke executor run --directory fitting --n-fragmenter-workers 2 --n-optimizer-workers 2 --n-qc-compute-workers 2 --qc-compute-n-cores 1 --file test3.sdf --output test3.sdf.json --output-force-field test3.sdf.offxml --workflow "default" --default-qc-spec xtb gfn2xtb none

Output

[✓] bespoke executor launched

  1. preparing the bespoke workflow

[✓] 1 molecules found
[✓] fitting schemas generated

  1. submitting the workflow

[✓] the following workflows were submitted
┏━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━┓
┃ ID ┃ SMILES ┃ NAME ┃ FILE ┃
┡━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━┩
│ 2 │ c1cc(C2C[C@@h]3C[C@@h]3C2)n1 │ test2 │ test2.sdf │
└────┴──────────────────────────────┴───────┴───────────┘

  1. running the fitting pipeline

[x] fragmentation failed

{"type": "ValueError", "message": "not enough values to unpack (expected 2, got 0)", "traceback": "Traceback (most recent call last):\n File
"/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/celery/app/trace.py", line 477, in trace_task\n R = retval = fun(*args, **kwargs)\n File
"/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/celery/app/trace.py", line 760, in protected_call\n return self.run(*args, **kwargs)\n File
"/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/openff/bespokefit/executor/services/fragmenter/worker.py", line 36, in fragment\n
fragmenter.fragment(molecule, target_bond_smarts=target_bond_smarts)\n File
"/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py", line 916, in fragment\n result = self._fragment(molecule,
target_bond_smarts)\n File "/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py", line 1019, in _fragment\n fragments =
{\n File "/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py", line 1020, in \n bond: self._build_fragment(\n
File "/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py", line 1204, in _build_fragment\n fragment,
has_new_stereocenter = cls._add_next_substituent(\n File "/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py", line 1409,
in _add_next_substituent\n neighbour_atom_and_bond = cls._select_neighbour_by_path_length(\n File
"/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py", line 1264, in _select_neighbour_by_path_length\n path_lengths_1,
path_lengths_2 = zip(\nValueError: not enough values to unpack (expected 2, got 0)\n"}

Please include the output, including full tracebacks of any errors, resulting from the reproduction.

Software versions
[✓] bespoke executor launched

  1. preparing the bespoke workflow

[✓] 1 molecules found
[✓] fitting schemas generated

  1. submitting the workflow

[✓] the following workflows were submitted
┏━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━┓
┃ ID ┃ SMILES ┃ NAME ┃ FILE ┃
┡━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━┩
│ 2 │ c1cc(C2C[C@@h]3C[C@@h]3C2)n1 │ test2 │ test2.sdf │
└────┴──────────────────────────────┴───────┴───────────┘

  1. running the fitting pipeline

[x] fragmentation failed

{"type": "ValueError", "message": "not enough values to unpack (expected 2, got 0)", "traceback": "Traceback (most recent call last):\n File
"/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/celery/app/trace.py", line 477, in trace_task\n R = retval = fun(*args, **kwargs)\n File
"/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/celery/app/trace.py", line 760, in protected_call\n return self.run(*args, **kwargs)\n File
"/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/openff/bespokefit/executor/services/fragmenter/worker.py", line 36, in fragment\n
fragmenter.fragment(molecule, target_bond_smarts=target_bond_smarts)\n File
"/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py", line 916, in fragment\n result = self._fragment(molecule,
target_bond_smarts)\n File "/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py", line 1019, in _fragment\n fragments =
{\n File "/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py", line 1020, in \n bond: self._build_fragment(\n
File "/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py", line 1204, in _build_fragment\n fragment,
has_new_stereocenter = cls._add_next_substituent(\n File "/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py", line 1409,
in _add_next_substituent\n neighbour_atom_and_bond = cls._select_neighbour_by_path_length(\n File
"/home/bckim/mambaforge/envs/bespokefit-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py", line 1264, in _select_neighbour_by_path_length\n path_lengths_1,
path_lengths_2 = zip(\nValueError: not enough values to unpack (expected 2, got 0)\n"}

  • Which operating system and version are you using? ubuntu
  • How did you install BespokeFit? following manual
  • Are you using Apple Silicon? If so, are you running BespokeFit in Rosetta (osx-64) or natively (osx-arm64)? No
  • What is the output of running conda list?
Output of conda list

Please place the output of conda list here

@j-wags
Copy link
Member

j-wags commented Jun 3, 2024

Thanks for the great reproducing example. I think the meat of this problem is in Fragmenter - I can reproduce it without BespokeFit:

from openff.toolkit import Molecule
from openff.fragmenter.fragment import WBOFragmenter
parent_molecule = Molecule.from_file("test2.sdf")
frag_engine = WBOFragmenter()
result = frag_engine.fragment(parent_molecule)

File "/Users/jeffreywagner/conda/envs/bespokefit/lib/python3.11/site-packages/openff/fragmenter/fragment.py", line 1238, in _select_neighbour_by_path_length
path_lengths_1, path_lengths_2 = zip(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 0)

It seems similar to #127 - I could see this being an issue with stereocenters in the fused ring system. I'm going to migrate this issue to the Fragmenter repo, but fixing it there should fix it in Bespokefit as well.

@j-wags j-wags transferred this issue from openforcefield/openff-bespokefit Jun 3, 2024
@j-wags j-wags mentioned this issue Jun 4, 2024
3 tasks
@j-wags
Copy link
Member

j-wags commented Jun 6, 2024

I've made a fresh install of the env and verified that this works with fragmenter 0.2.2 (though I did need to delete the fitting/ folder so it wouldn't keep loading outdated results. Please feel free to reopen this issue if this didn't fix it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants