openfe
openfe copied to clipboard
KeyError from topologyhelpers.py possibly caused by duplicate constraints
Describe the bug
During an openfe quickrun (after setting up the transformation), a KeyError sometimes occur in the topologyhelpers.py script when removing old onstraints: https://github.com/OpenFreeEnergy/openfe/blob/main/openfe/protocols/openmm_rfe/_rfe_utils/topologyhelpers.py#L506. The error happens because the to_del list sometimes contains duplicate constraint indices. The code then attempts to remove the same constraint multiple times, leading to the KeyError when it tries to remove a constraint that's already gone. We have an example that fails, but it is proprietary. We would be happy to tests any proposed fixes.
As a temporary workaround, removing duplicates from the to_del list (e.g., converting it to a set and back) prevents the crash. However, we aren't sure if this addresses the root cause. Pleases clarify if the presence of duplicate indices in the to_del list is expected behavior? Or, is the bug that duplicates are being generated, and the fix should be upstream to prevent the duplicates?
Our guess is that this might be related to the specific transformation involving the movement of an NH2+ group within a 6-membered ring to a different position within the ring.
topologyhelpers.py del no_const_old_to_new_atom_map[idx]
To Reproduce Steps to reproduce the behavior (ideally a minimally reproducible example):
Software versions
- Which operating system and version did you use? (e.g. ubuntu 22.04.5)
- Which method did you use to install this package? (e.g. conda-forge)
- Installed with miniforge, running on Linux. openfe version: 1.0.1+0.g48dcbb26.dirty
- Copy/paste the output of
conda list(or the equivalent for your package manager):
packages in environment at /home/surianap/scratch/conda/envs/openfe_env:
Name Version Build Channel
_libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 2_gnu conda-forge _sysroot_linux-64_curr_repodata_hack 3 h69a702a_16 conda-forge adjusttext 1.2.0 pyhd8ed1ab_0 conda-forge aiobotocore 2.15.0 pypi_0 pypi aiohappyeyeballs 2.4.0 pypi_0 pypi aiohttp 3.10.5 pypi_0 pypi aioitertools 0.12.0 pypi_0 pypi aiosignal 1.3.1 pypi_0 pypi amberlite 22.0 pypi_0 pypi ambertools 22.5 py310hd182041_0 conda-forge amberutils 21.0 pypi_0 pypi annotated-types 0.7.0 pyhd8ed1ab_0 conda-forge antlr4-python3-runtime 4.9.3 pypi_0 pypi anyio 4.4.0 pyhd8ed1ab_0 conda-forge argon2-cffi 23.1.0 pyhd8ed1ab_0 conda-forge argon2-cffi-bindings 21.2.0 py310h2372a71_4 conda-forge arpack 3.7.0 hdefa2d7_2 conda-forge arrow 1.3.0 pyhd8ed1ab_0 conda-forge asttokens 2.4.1 pyhd8ed1ab_0 conda-forge astunparse 1.6.3 pyhd8ed1ab_0 conda-forge async-lru 2.0.4 pyhd8ed1ab_0 conda-forge async-timeout 4.0.3 pypi_0 pypi atk-1.0 2.38.0 h04ea711_2 conda-forge attrs 24.2.0 pyh71513ae_0 conda-forge awscli 1.34.16 pypi_0 pypi babel 2.14.0 pyhd8ed1ab_0 conda-forge bcrypt 4.2.0 pypi_0 pypi beautifulsoup4 4.12.3 pyha770c72_0 conda-forge binaryornot 0.4.4 pypi_0 pypi biopandas 0.5.1 pypi_0 pypi biopython 1.84 py310hc51659f_0 conda-forge bleach 6.1.0 pyhd8ed1ab_0 conda-forge blosc 1.21.6 hef167b5_0 conda-forge boost 1.78.0 py310hcb52e73_5 conda-forge boost-cpp 1.78.0 h2c5509c_4 conda-forge boto3 1.35.16 pypi_0 pypi botocore 1.35.16 pypi_0 pypi brotli 1.1.0 hd590300_1 conda-forge brotli-bin 1.1.0 hd590300_1 conda-forge brotli-python 1.1.0 py310hc6cd4ac_1 conda-forge bson 0.5.9 py_0 conda-forge bzip2 1.0.8 h4bc722e_7 conda-forge c-ares 1.33.0 ha66036c_0 conda-forge c-blosc2 2.15.1 hc57e6cf_0 conda-forge ca-certificates 2024.8.30 hbcca054_0 conda-forge cached-property 1.5.2 hd8ed1ab_1 conda-forge cached_property 1.5.2 pyha770c72_1 conda-forge cachetools 5.5.0 pyhd8ed1ab_0 conda-forge cairo 1.18.0 hbb29018_2 conda-forge certifi 2024.8.30 pyhd8ed1ab_0 conda-forge cffi 1.17.0 py310h2fdcea3_0 conda-forge cfgv 3.4.0 pypi_0 pypi cftime 1.6.4 py310h261611a_0 conda-forge chardet 5.2.0 py310hff52083_1 conda-forge charset-normalizer 3.3.2 pyhd8ed1ab_0 conda-forge cinnabar 0.4.1 pyhd8ed1ab_1 conda-forge click 8.1.7 unix_pyh707e725_0 conda-forge colorama 0.4.6 pyhd8ed1ab_0 conda-forge comm 0.2.2 pyhd8ed1ab_0 conda-forge contourpy 1.2.1 py310hd41b1e2_0 conda-forge cookiecutter 2.6.0 pypi_0 pypi coverage 7.6.1 py310h5b4e0ec_0 conda-forge cryptography 43.0.1 pypi_0 pypi cudatoolkit 11.8.0 h4ba93d1_13 conda-forge cycler 0.12.1 pyhd8ed1ab_0 conda-forge cython 3.0.11 py310hea249c9_0 conda-forge debugpy 1.8.5 py310hea249c9_0 conda-forge decorator 5.1.1 pyhd8ed1ab_0 conda-forge defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge deprecated 1.2.14 pypi_0 pypi dill 0.3.8 pyhd8ed1ab_0 conda-forge distlib 0.3.8 pypi_0 pypi docutils 0.16 pypi_0 pypi edlib 1.3.9.post1 pypi_0 pypi entrypoints 0.4 pyhd8ed1ab_0 conda-forge exceptiongroup 1.2.2 pyhd8ed1ab_0 conda-forge executing 2.0.1 pyhd8ed1ab_0 conda-forge expat 2.6.2 h59595ed_0 conda-forge fabric 3.2.2 pypi_0 pypi fasteners 0.17.3 pyhd8ed1ab_0 conda-forge fftw 3.3.10 nompi_hf1063bd_110 conda-forge filelock 3.16.0 pypi_0 pypi font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge font-ttf-inconsolata 3.000 h77eed37_0 conda-forge font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge font-ttf-ubuntu 0.83 h77eed37_2 conda-forge fontconfig 2.14.2 h14ed4e7_0 conda-forge fonts-conda-ecosystem 1 0 conda-forge fonts-conda-forge 1 0 conda-forge fonttools 4.53.1 py310h5b4e0ec_0 conda-forge fqdn 1.5.1 pyhd8ed1ab_0 conda-forge freetype 2.12.1 h267a509_2 conda-forge freetype-py 2.3.0 pyhd8ed1ab_0 conda-forge fribidi 1.0.10 h36c2ea0_0 conda-forge frozenlist 1.4.1 pypi_0 pypi fsspec 2024.9.0 pypi_0 pypi gdk-pixbuf 2.42.12 hb9ae30d_0 conda-forge giflib 5.2.2 hd590300_0 conda-forge graphite2 1.3.13 h59595ed_1003 conda-forge graphviz 12.0.0 hba01fac_0 conda-forge greenlet 3.0.3 py310hc6cd4ac_0 conda-forge griddataformats 1.0.2 pyhd8ed1ab_0 conda-forge gsd 3.3.1 py310h91a95bf_0 conda-forge gtk2 2.24.33 h6470451_5 conda-forge gts 0.7.6 h977cf35_4 conda-forge gufe 1.0.0 pyhd8ed1ab_0 conda-forge h11 0.14.0 pyhd8ed1ab_0 conda-forge h2 4.1.0 pyhd8ed1ab_0 conda-forge h5py 3.11.0 nompi_py310hf054cd7_102 conda-forge harfbuzz 9.0.0 hfac3d4d_0 conda-forge hdf4 4.2.15 h2a13503_7 conda-forge hdf5 1.14.3 nompi_hdf9ad27_105 conda-forge hpack 4.0.0 pyh9f0ad1d_0 conda-forge httpcore 1.0.5 pyhd8ed1ab_0 conda-forge httpx 0.27.0 pyhd8ed1ab_0 conda-forge hydra-core 1.3.2 pypi_0 pypi hyperframe 6.0.1 pyhd8ed1ab_0 conda-forge icu 73.2 h59595ed_0 conda-forge identify 2.6.1 pypi_0 pypi idna 3.7 pyhd8ed1ab_0 conda-forge importlib-metadata 8.2.0 pyha770c72_0 conda-forge importlib_metadata 8.2.0 hd8ed1ab_0 conda-forge importlib_resources 6.4.3 pyhd8ed1ab_0 conda-forge iniconfig 2.0.0 pyhd8ed1ab_0 conda-forge invoke 2.2.0 pypi_0 pypi ipykernel 6.29.5 pyh3099207_0 conda-forge ipython 8.26.0 pyh707e725_0 conda-forge ipywidgets 8.1.3 pyhd8ed1ab_0 conda-forge isoduration 20.11.0 pyhd8ed1ab_0 conda-forge jedi 0.19.1 pyhd8ed1ab_0 conda-forge jinja2 3.1.4 pyhd8ed1ab_0 conda-forge jmespath 1.0.1 pypi_0 pypi joblib 1.4.2 pyhd8ed1ab_0 conda-forge json5 0.9.25 pyhd8ed1ab_0 conda-forge jsonpointer 3.0.0 py310hff52083_0 conda-forge jsonschema 4.23.0 pyhd8ed1ab_0 conda-forge jsonschema-specifications 2023.12.1 pyhd8ed1ab_0 conda-forge jsonschema-with-format-nongpl 4.23.0 hd8ed1ab_0 conda-forge jupyter 1.1.1 pypi_0 pypi jupyter-console 6.6.3 pypi_0 pypi jupyter-lsp 2.2.5 pyhd8ed1ab_0 conda-forge jupyter_client 8.6.2 pyhd8ed1ab_0 conda-forge jupyter_core 5.7.2 py310hff52083_0 conda-forge jupyter_events 0.10.0 pyhd8ed1ab_0 conda-forge jupyter_server 2.14.2 pyhd8ed1ab_0 conda-forge jupyter_server_terminals 0.5.3 pyhd8ed1ab_0 conda-forge jupyterlab 4.2.4 pyhd8ed1ab_0 conda-forge jupyterlab_pygments 0.3.0 pyhd8ed1ab_1 conda-forge jupyterlab_server 2.27.3 pyhd8ed1ab_0 conda-forge jupyterlab_widgets 3.0.11 pyhd8ed1ab_0 conda-forge kartograf 1.0.1 pyhd8ed1ab_0 conda-forge kernel-headers_linux-64 3.10.0 h4a8ded7_16 conda-forge keyutils 1.6.1 h166bdaf_0 conda-forge kiwisolver 1.4.5 py310hd41b1e2_1 conda-forge krb5 1.21.3 h659f571_0 conda-forge lcms2 2.16 hb7c19ff_0 conda-forge ld_impl_linux-64 2.40 hf3520f5_7 conda-forge lerc 4.0.0 h27087fc_0 conda-forge libaec 1.1.3 h59595ed_0 conda-forge libblas 3.9.0 23_linux64_openblas conda-forge libbrotlicommon 1.1.0 hd590300_1 conda-forge libbrotlidec 1.1.0 hd590300_1 conda-forge libbrotlienc 1.1.0 hd590300_1 conda-forge libcblas 3.9.0 23_linux64_openblas conda-forge libcurl 8.9.1 hdb1bdb2_0 conda-forge libdeflate 1.21 h4bc722e_0 conda-forge libedit 3.1.20191231 he28a2e2_2 conda-forge libev 4.33 hd590300_2 conda-forge libexpat 2.6.2 h59595ed_0 conda-forge libffi 3.4.2 h7f98852_5 conda-forge libgcc 14.1.0 h77fa898_1 conda-forge libgcc-ng 14.1.0 h69a702a_1 conda-forge libgd 2.3.3 h119a65a_9 conda-forge libgfortran-ng 14.1.0 h69a702a_0 conda-forge libgfortran5 14.1.0 hc5f4f2c_0 conda-forge libglib 2.80.3 h315aac3_2 conda-forge libgomp 14.1.0 h77fa898_1 conda-forge libiconv 1.17 hd590300_2 conda-forge libjpeg-turbo 3.0.0 hd590300_1 conda-forge liblapack 3.9.0 23_linux64_openblas conda-forge libllvm14 14.0.6 hcd5def8_4 conda-forge libnetcdf 4.9.2 nompi_h135f659_114 conda-forge libnghttp2 1.58.0 h47da74e_1 conda-forge libnsl 2.0.1 hd590300_0 conda-forge libopenblas 0.3.27 pthreads_hac2b453_1 conda-forge libpng 1.6.43 h2797004_0 conda-forge librsvg 2.58.3 h9564881_0 conda-forge libsodium 1.0.18 h36c2ea0_1 conda-forge libsqlite 3.46.0 hde9e2c9_0 conda-forge libssh2 1.11.0 h0841786_0 conda-forge libstdcxx 14.1.0 hc0a3c3a_1 conda-forge libstdcxx-ng 14.1.0 h4852527_1 conda-forge libtiff 4.6.0 h46a8edc_4 conda-forge libuuid 2.38.1 h0b41bf4_0 conda-forge libwebp 1.4.0 h2c329e2_0 conda-forge libwebp-base 1.4.0 hd590300_0 conda-forge libxcb 1.16 hd590300_0 conda-forge libxcrypt 4.4.36 hd590300_1 conda-forge libxml2 2.12.7 h4c95cb1_3 conda-forge libxslt 1.1.39 h76b75d6_0 conda-forge libzip 1.10.1 h2629f0a_3 conda-forge libzlib 1.3.1 h4ab18f5_1 conda-forge lightning 2.4.0 pypi_0 pypi lightning-utilities 0.11.7 pypi_0 pypi llvmlite 0.43.0 py310h4c7c693_0 conda-forge loguru 0.7.2 pypi_0 pypi lomap2 3.1.0 pyhff2d567_0 conda-forge looseversion 1.1.2 pypi_0 pypi lxml 5.3.0 py310h0b03162_0 conda-forge lz4-c 1.9.4 hcb278e6_0 conda-forge lzo 2.10 hd590300_1001 conda-forge markdown-it-py 3.0.0 pypi_0 pypi markupsafe 2.1.5 py310h2372a71_0 conda-forge matplotlib-base 3.8.4 py310hef631a5_2 conda-forge matplotlib-inline 0.1.7 pyhd8ed1ab_0 conda-forge mda-xdrlib 0.2.0 pyhd8ed1ab_0 conda-forge mdanalysis 2.7.0 py310hcc13569_1 conda-forge mdtraj 1.10.0 py310he673748_0 conda-forge mdurl 0.1.2 pypi_0 pypi mistune 3.0.2 pyhd8ed1ab_0 conda-forge mmpbsa-py 16.0 pypi_0 pypi mmtf-python 1.1.3 pyhd8ed1ab_0 conda-forge mpiplus v0.0.2 pyhd8ed1ab_0 conda-forge mplcursors 0.6 pypi_0 pypi mpmath 1.3.0 pypi_0 pypi mrcfile 1.5.3 pyhd8ed1ab_0 conda-forge msgpack-python 1.0.8 py310h25c7140_0 conda-forge multidict 6.1.0 pypi_0 pypi munkres 1.1.4 pyh9f0ad1d_0 conda-forge nbclient 0.10.0 pyhd8ed1ab_0 conda-forge nbconvert-core 7.16.4 pyhd8ed1ab_1 conda-forge nbformat 5.10.4 pyhd8ed1ab_0 conda-forge ncurses 6.5 h59595ed_0 conda-forge nest-asyncio 1.6.0 pyhd8ed1ab_0 conda-forge netcdf-fortran 4.6.1 nompi_h228c76a_104 conda-forge netcdf4 1.7.1 nompi_py310hf3005e6_101 conda-forge networkx 3.3 pyhd8ed1ab_1 conda-forge nodeenv 1.9.1 pypi_0 pypi nomkl 1.0 h5ca1d4c_0 conda-forge nose 1.3.7 py_1006 conda-forge notebook 7.2.1 pyhd8ed1ab_0 conda-forge notebook-shim 0.2.4 pyhd8ed1ab_0 conda-forge numba 0.60.0 py310h5dc88bb_0 conda-forge numexpr 2.10.0 py310h3ea09b0_100 conda-forge numpy 1.26.4 py310hb13e2d6_0 conda-forge nvidia-cublas-cu12 12.1.3.1 pypi_0 pypi nvidia-cuda-cupti-cu12 12.1.105 pypi_0 pypi nvidia-cuda-nvrtc-cu12 12.1.105 pypi_0 pypi nvidia-cuda-runtime-cu12 12.1.105 pypi_0 pypi nvidia-cudnn-cu12 9.1.0.70 pypi_0 pypi nvidia-cufft-cu12 11.0.2.54 pypi_0 pypi nvidia-curand-cu12 10.3.2.106 pypi_0 pypi nvidia-cusolver-cu12 11.4.5.107 pypi_0 pypi nvidia-cusparse-cu12 12.1.0.106 pypi_0 pypi nvidia-nccl-cu12 2.20.5 pypi_0 pypi nvidia-nvjitlink-cu12 12.6.68 pypi_0 pypi nvidia-nvtx-cu12 12.1.105 pypi_0 pypi ocl-icd 2.3.2 hd590300_1 conda-forge ocl-icd-system 1.0.0 1 conda-forge omegaconf 2.3.0 pypi_0 pypi openbabel-wheel 3.1.1.21 pypi_0 pypi openfe 1.0.1 pyhd8ed1ab_2 conda-forge openfe-analysis 0.2.0 pyhd8ed1ab_0 conda-forge openfe-app 2024.4.20.0.post1.dev1095+g1af5b6292 pypi_0 pypi openff-amber-ff-ports 0.0.4 pyhca7485f_0 conda-forge openff-forcefields 2024.07.0 pyhff2d567_0 conda-forge openff-interchange 0.3.29 pyhd8ed1ab_0 conda-forge openff-interchange-base 0.3.29 pyhd8ed1ab_0 conda-forge openff-models 0.1.2 pyhca7485f_0 conda-forge openff-toolkit 0.15.2 pyhd8ed1ab_0 conda-forge openff-toolkit-base 0.15.2 pyhd8ed1ab_0 conda-forge openff-units 0.2.2 pyhca7485f_0 conda-forge openff-utilities 0.1.12 pyhd8ed1ab_0 conda-forge openjpeg 2.5.2 h488ebb8_0 conda-forge openmm 8.1.2 py310h6b72300_3 conda-forge openmmforcefields 0.12.0 pyhd8ed1ab_0 conda-forge openmmtools 0.23.1 pyhd8ed1ab_0 conda-forge openssl 3.3.2 hb9d3cd8_0 conda-forge overrides 7.7.0 pyhd8ed1ab_0 conda-forge packaging 24.1 pyhd8ed1ab_0 conda-forge packmol 20.15.1 hc8b2c43_1 conda-forge packmol-memgen 1.2.3rc0 pypi_0 pypi pandas 2.2.2 py310hf9f9076_1 conda-forge pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge panedr 0.8.0 pyhd8ed1ab_0 conda-forge pango 1.54.0 h4c5309f_1 conda-forge paramiko 3.4.1 pypi_0 pypi parmed 4.2.2 py310hc6cd4ac_1 conda-forge parso 0.8.4 pyhd8ed1ab_0 conda-forge patsy 0.5.6 pyhd8ed1ab_0 conda-forge pcre2 10.44 hba22ea6_2 conda-forge pdb4amber 22.0 pypi_0 pypi pdbfixer 1.9 pyh1a96a4e_0 conda-forge perl 5.32.1 7_hd590300_perl5 conda-forge pexpect 4.9.0 pyhd8ed1ab_0 conda-forge pickleshare 0.7.5 py_1003 conda-forge pillow 10.4.0 py310hebfe307_0 conda-forge pint 0.23 pyhd8ed1ab_1 conda-forge pip 24.2 pyhd8ed1ab_0 conda-forge pixman 0.43.2 h59595ed_0 conda-forge pkgutil-resolve-name 1.3.10 pyhd8ed1ab_1 conda-forge platformdirs 4.2.2 pyhd8ed1ab_0 conda-forge plotly 5.23.0 pyhd8ed1ab_0 conda-forge plugcli 0.2.0 pyhd8ed1ab_0 conda-forge pluggy 1.5.0 pyhd8ed1ab_0 conda-forge pooch 1.8.2 pyhd8ed1ab_0 conda-forge pre-commit 3.8.0 pypi_0 pypi prescient 2024.4.20.0.post1.dev1095+g1af5b6292 pypi_0 pypi prescient-bolt-template 2024.9.17.0.post1.dev16+ga356b0e82.d20240918 pypi_0 pypi prometheus_client 0.20.0 pyhd8ed1ab_0 conda-forge prompt-toolkit 3.0.47 pyha770c72_0 conda-forge psutil 6.0.0 py310hc51659f_0 conda-forge pthread-stubs 0.4 h36c2ea0_1001 conda-forge ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge pure_eval 0.2.3 pyhd8ed1ab_0 conda-forge py-cpuinfo 9.0.0 pyhd8ed1ab_0 conda-forge py3dmol 2.3.0 pyhd8ed1ab_0 conda-forge pyarrow 17.0.0 pypi_0 pypi pyasn1 0.6.1 pypi_0 pypi pycairo 1.26.1 py310he029307_0 conda-forge pycparser 2.22 pyhd8ed1ab_0 conda-forge pydantic 2.8.2 pyhd8ed1ab_0 conda-forge pydantic-core 2.20.1 py310h42e942d_0 conda-forge pyedr 0.8.0 pyhd8ed1ab_0 conda-forge pygments 2.18.0 pyhd8ed1ab_0 conda-forge pygraphviz 1.13 py310h0ca91bb_2 conda-forge pymbar 3.1.1 py310h8a78493_3 conda-forge pynacl 1.5.0 pypi_0 pypi pyparsing 3.1.2 pyhd8ed1ab_0 conda-forge pysocks 1.7.1 pyha2e5f31_6 conda-forge pytables 3.9.2 py310h73b55d5_3 conda-forge pytest 8.3.2 pyhd8ed1ab_0 conda-forge pytest-mock 3.14.0 pypi_0 pypi python 3.10.14 hd12c33a_0_cpython conda-forge python-constraint 1.4.0 py_0 conda-forge python-dateutil 2.9.0 pyhd8ed1ab_0 conda-forge python-fastjsonschema 2.20.0 pyhd8ed1ab_0 conda-forge python-json-logger 2.0.7 pyhd8ed1ab_0 conda-forge python-slugify 8.0.4 pypi_0 pypi python-tzdata 2024.1 pyhd8ed1ab_0 conda-forge python_abi 3.10 5_cp310 conda-forge pytng 0.3.3 py310h6ea5394_0 conda-forge pytorch-lightning 2.4.0 pypi_0 pypi pytraj 2.0.6 pypi_0 pypi pytz 2024.1 pyhd8ed1ab_0 conda-forge pyyaml 6.0.2 py310h5b4e0ec_0 conda-forge pyzmq 26.1.1 py310h7d2b5bf_0 conda-forge rdkit 2024.3.5 pypi_0 pypi readline 8.2 h8228510_1 conda-forge referencing 0.35.1 pyhd8ed1ab_0 conda-forge reportlab 4.2.2 py310hc51659f_0 conda-forge requests 2.32.3 pyhd8ed1ab_0 conda-forge rfc3339-validator 0.1.4 pyhd8ed1ab_0 conda-forge rfc3986-validator 0.1.1 pyh9f0ad1d_0 conda-forge rich 13.8.1 pypi_0 pypi rlpycairo 0.2.0 pyhd8ed1ab_0 conda-forge rpds-py 0.20.0 py310h42e942d_0 conda-forge rsa 4.7.2 pypi_0 pypi ruamel-yaml 0.18.6 pypi_0 pypi ruamel-yaml-clib 0.2.8 pypi_0 pypi s3fs 2024.9.0 pypi_0 pypi s3transfer 0.10.2 pypi_0 pypi sander 22.0 pypi_0 pypi scikit-learn 1.5.1 py310h146d792_0 conda-forge scipy 1.13.1 py310h93e2701_0 conda-forge seaborn 0.13.2 hd8ed1ab_2 conda-forge seaborn-base 0.13.2 pyhd8ed1ab_2 conda-forge send2trash 1.8.3 pyh0d859eb_0 conda-forge setuptools 72.1.0 pyhd8ed1ab_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge smirnoff99frosst 1.1.0 pyh44b312d_0 conda-forge snappy 1.2.1 ha2e4443_0 conda-forge sniffio 1.3.1 pyhd8ed1ab_0 conda-forge soupsieve 2.5 pyhd8ed1ab_1 conda-forge sqlalchemy 2.0.32 py310h5b4e0ec_0 conda-forge stack_data 0.6.2 pyhd8ed1ab_0 conda-forge statsmodels 0.14.2 py310h261611a_0 conda-forge sympy 1.13.2 pypi_0 pypi sysroot_linux-64 2.17 h4a8ded7_16 conda-forge tenacity 9.0.0 pyhd8ed1ab_0 conda-forge terminado 0.18.1 pyh0d859eb_0 conda-forge text-unidecode 1.3 pypi_0 pypi threadpoolctl 3.5.0 pyhc1e730c_0 conda-forge tidynamics 1.1.2 pyhd8ed1ab_0 conda-forge tinycss2 1.3.0 pyhd8ed1ab_0 conda-forge tinydb 4.8.0 pyhd8ed1ab_0 conda-forge tk 8.6.13 noxft_h4845f30_101 conda-forge tomli 2.0.1 pyhd8ed1ab_0 conda-forge torch 2.4.1 pypi_0 pypi torchmetrics 1.4.2 pypi_0 pypi tornado 6.4.1 py310hc51659f_0 conda-forge tqdm 4.66.5 pyhd8ed1ab_0 conda-forge tqdm-joblib 0.0.4 pypi_0 pypi traitlets 5.14.3 pyhd8ed1ab_0 conda-forge triton 3.0.0 pypi_0 pypi types-python-dateutil 2.9.0.20240316 pyhd8ed1ab_0 conda-forge typing-extensions 4.12.2 hd8ed1ab_0 conda-forge typing_extensions 4.12.2 pyha770c72_0 conda-forge typing_utils 0.1.0 pyhd8ed1ab_0 conda-forge tzdata 2024a h0c530f3_0 conda-forge unicodedata2 15.1.0 py310h2372a71_0 conda-forge universal-pathlib 0.2.5 pypi_0 pypi uri-template 1.3.0 pyhd8ed1ab_0 conda-forge urllib3 2.2.2 pyhd8ed1ab_1 conda-forge validators 0.33.0 pyhd8ed1ab_0 conda-forge virtualenv 20.26.5 pypi_0 pypi wcwidth 0.2.13 pyhd8ed1ab_0 conda-forge webcolors 24.8.0 pyhd8ed1ab_0 conda-forge webencodings 0.5.1 pyhd8ed1ab_2 conda-forge websocket-client 1.8.0 pyhd8ed1ab_0 conda-forge wheel 0.44.0 pyhd8ed1ab_0 conda-forge widgetsnbextension 4.0.11 pyhd8ed1ab_0 conda-forge wrapt 1.16.0 pypi_0 pypi xmltodict 0.13.0 pyhd8ed1ab_0 conda-forge xorg-kbproto 1.0.7 h7f98852_1002 conda-forge xorg-libice 1.1.1 hd590300_0 conda-forge xorg-libsm 1.2.4 h7391055_0 conda-forge xorg-libx11 1.8.9 hb711507_1 conda-forge xorg-libxau 1.0.11 hd590300_0 conda-forge xorg-libxdmcp 1.1.3 h7f98852_0 conda-forge xorg-libxext 1.3.4 h0b41bf4_2 conda-forge xorg-libxrender 0.9.11 hd590300_0 conda-forge xorg-libxt 1.3.0 hd590300_1 conda-forge xorg-renderproto 0.11.1 h7f98852_1002 conda-forge xorg-xextproto 7.3.0 h0b41bf4_1003 conda-forge xorg-xproto 7.0.31 h7f98852_1007 conda-forge xz 5.2.6 h166bdaf_0 conda-forge yaml 0.2.5 h7f98852_2 conda-forge yarl 1.11.1 pypi_0 pypi zeromq 4.3.5 h75354e8_4 conda-forge zipp 3.20.0 pyhd8ed1ab_0 conda-forge zlib 1.3.1 h4ab18f5_1 conda-forge zlib-ng 2.2.1 he02047a_0 conda-forge zstandard 0.23.0 py310h64cae3c_0 conda-forge zstd 1.5.6 ha6fb4c9_0 conda-forge Output
Expected behavior
Please advise if our workaround really solves the problem, even temporarily. Additional context
Hi @BillSwope,
Thanks so much for this bug report!
We have seen similar cases in the past. Under normal operations you shouldn't end up with duplicate entries in to_del, although the exact cause is unclear (we definitely need to improve the error messages coming out of that code!).
From my understanding this tends to happen when you have issues with your ligand atom mapping. I believe one such case is when you have one atom mapped to more than one atom, or to a disconnected part of the mapping.
For the system you report, have inspected your ligand mapping (we can provide you some materials to do this if necessary)? Which mapper are you currently using (i.e. Lomap or Kartograf)?
I'll cc @jthorton here who has been dealing with some of this lately and might be able to provide better insights.
I’m trying to simplify the proprietary failure case to something I can pass on to you but so far everything seems to work. I need to try it in exactly the same environment as my colleague used. Maybe we can have something tomorrow. Fingers crossed. Also I’m not sure what mapper was used in her case. Let me know if you have any experiments you’d like me to try. …BillSent from iPhoneOn Apr 18, 2025, at 10:58 AM, Irfan Alibay @.> wrote: Hi @BillSwope, Thanks so much for this bug report! We have seen similar cases in the past. Under normal operations you shouldn't end up with duplicate entries in to_del, although the exact cause is unclear (we definitely need to improve the error messages coming out of that code!). From my understanding this tends to happen when you have issues with your ligand atom mapping. I believe one such case is when you have one atom mapped to more than one atom, or to a disconnected part of the mapping. For the system you report, have inspected your ligand mapping (we can provide you some materials to do this if necessary)? Which mapper are you currently using (i.e. Lomap or Kartograf)? I'll cc @jthorton here who has been dealing with some of this lately and might be able to provide better insights.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.>
IAlibay left a comment (OpenFreeEnergy/openfe#1231) Hi @BillSwope, Thanks so much for this bug report! We have seen similar cases in the past. Under normal operations you shouldn't end up with duplicate entries in to_del, although the exact cause is unclear (we definitely need to improve the error messages coming out of that code!). From my understanding this tends to happen when you have issues with your ligand atom mapping. I believe one such case is when you have one atom mapped to more than one atom, or to a disconnected part of the mapping. For the system you report, have inspected your ligand mapping (we can provide you some materials to do this if necessary)? Which mapper are you currently using (i.e. Lomap or Kartograf)? I'll cc @jthorton here who has been dealing with some of this lately and might be able to provide better insights.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
From @BillSwope (via slack):
Kartograf was used for the mapper. Here is how the network was constructed for the case that failed.
mapping_filters = [
filter_ringbreak_changes, # default
filter_ringsize_changes, # default
filter_whole_rings_only, # default
]
mapper = kartograf.KartografAtomMapper(
atom_map_hydrogens=True,
additional_mapping_filter_functions=mapping_filters,
)
scorer = partial(openfe.lomap_scorers.default_lomap_score, charge_changes_score=0.1)
ligand_network = openfe.ligand_network_planning.generate_lomap_network(
molecules=smcs,
mappers=mapper,
scorer=scorer,
require_cycle_covering=False,
radial=True,
hub=None,
)
Hi @BillSwope thanks for the bug report. This does seem very similar to a case I had in this issue where I also used the Kartograf mapper with atom_map_hydrogens=True. I think this is a symptom of a bad mapping and normally indicates that a hydrogen involved in one constraint is being transformed to a hydrogen involved in a different constraint which would change the atom it is bonded to. I have found that you can avoid this by using atom_map_hydrogens=False in the KartografAtomMapper for now and future versions of Kartograf will not produce these mappings as we now have an extra filter to remove bond breaking mappings which should be released soon!
Thanks, Josh. Great detective work! I’ll pass along the temporary “fix” and let you know how it works out. Sent from iPhoneOn Apr 23, 2025, at 12:54 AM, Josh Horton @.> wrote: Hi @BillSwope thanks for the bug report. This does seem very similar to a case I had in this issue where I also used the Kartograf mapper with atom_map_hydrogens=True. I think this is a symptom of a bad mapping and normally indicates that a hydrogen involved in one constraint is being transformed to a hydrogen involved in a different constraint which would change the atom it is bonded to. I have found that you can avoid this by using atom_map_hydrogens=False in the KartografAtomMapper for now and future versions of Kartograf will not produce these mappings as we now have an extra filter to remove bond breaking mappings which should be released soon!—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.>
jthorton left a comment (OpenFreeEnergy/openfe#1231) Hi @BillSwope thanks for the bug report. This does seem very similar to a case I had in this issue where I also used the Kartograf mapper with atom_map_hydrogens=True. I think this is a symptom of a bad mapping and normally indicates that a hydrogen involved in one constraint is being transformed to a hydrogen involved in a different constraint which would change the atom it is bonded to. I have found that you can avoid this by using atom_map_hydrogens=False in the KartografAtomMapper for now and future versions of Kartograf will not produce these mappings as we now have an extra filter to remove bond breaking mappings which should be released soon!
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
Josh, my colleague confirmed that your fix (atom_map_hydrogens=False) worked to fix her problem. Will you be in Boston for the FE meetings? If so, see you there. … BillSent from iPhoneOn Apr 23, 2025, at 12:54 AM, Josh Horton @.> wrote: Hi @BillSwope thanks for the bug report. This does seem very similar to a case I had in this issue where I also used the Kartograf mapper with atom_map_hydrogens=True. I think this is a symptom of a bad mapping and normally indicates that a hydrogen involved in one constraint is being transformed to a hydrogen involved in a different constraint which would change the atom it is bonded to. I have found that you can avoid this by using atom_map_hydrogens=False in the KartografAtomMapper for now and future versions of Kartograf will not produce these mappings as we now have an extra filter to remove bond breaking mappings which should be released soon!—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.>
jthorton left a comment (OpenFreeEnergy/openfe#1231) Hi @BillSwope thanks for the bug report. This does seem very similar to a case I had in this issue where I also used the Kartograf mapper with atom_map_hydrogens=True. I think this is a symptom of a bad mapping and normally indicates that a hydrogen involved in one constraint is being transformed to a hydrogen involved in a different constraint which would change the atom it is bonded to. I have found that you can avoid this by using atom_map_hydrogens=False in the KartografAtomMapper for now and future versions of Kartograf will not produce these mappings as we now have an extra filter to remove bond breaking mappings which should be released soon!
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
Thats great news, glad I could help! Yes see you at the meeting!
@jthorton - was this addressed by https://github.com/OpenFreeEnergy/kartograf/pull/89, and if so can we close this issue?
https://github.com/OpenFreeEnergy/kartograf/pull/89 fixes the issue of kartograf giving bad mappings covering this case, but there might be other cases or other mappers which hit this issue. I think we need to update the error to be more descriptive, we should advise that its probably a bad mapping which changes the connectivity of an atom and that they should raise an error here as the key error is not helpful.
Moving tracking the error message fix to #1093 but otherwise we can consider this as "solved".