openforcefield / openff-toolkit

The Open Forcefield Toolkit provides implementations of the SMIRNOFF format, parameterization engine, and other tools. Documentation available at http://open-forcefield-toolkit.readthedocs.io
http://openforcefield.org
MIT License
309 stars 90 forks source link

Possible deployment issues with AmberTools on macOS 13 with x86 architecture #1548

Closed xperrylinn closed 11 months ago

xperrylinn commented 1 year ago

Description

In trying to run the quickstart guide as well as the code in OpenFF BespokeFit Workshop, I'm snagging on the following error during fragmentation. I've attached the zip file from the workshop that contains a specification for the environment dependencies in environment.yml. I've tried running with Python 3.10 and 3.9 on MacOS Ventura 13.0.1. My next steps are to run the debugger to see if I can pull more information out of the failure in running antechamber command : '['antechamber', '-i', 'molecule.sdf', '-fi', 'sdf', '-o', 'sqm.in', '-fo', 'sqmcrt', '-pf', 'yes', '-c', 'mul', '-nc', '0.0 e']'.

---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
Cell In[12], line 4
      1 from openff.fragmenter.fragment import WBOFragmenter
      3 fragmenter = WBOFragmenter()
----> 4 fragmentations = [
      5     fragmenter.fragment(molecule, target_bond_smarts=[torsion_smirks])
      6     for molecule in molecules[:1]
      7 ]

Cell In[12], line 5, in <listcomp>(.0)
      1 from openff.fragmenter.fragment import WBOFragmenter
      3 fragmenter = WBOFragmenter()
      4 fragmentations = [
----> 5     fragmenter.fragment(molecule, target_bond_smarts=[torsion_smirks])
      6     for molecule in molecules[:1]
      7 ]

File ~/Documents/Academics/MSSE/spring_2023/Capstone/bespokefit_workshop/env-bespoke/lib/python3.10/site-packages/openff/fragmenter/fragment.py:916, in Fragmenter.fragment(self, molecule, target_bond_smarts, toolkit_registry)
    912     toolkit_registry = GLOBAL_TOOLKIT_REGISTRY
    914 with global_toolkit_registry(toolkit_registry):
--> 916     result = self._fragment(molecule, target_bond_smarts)
    918     result.provenance["toolkits"] = [
    919         (toolkit.__class__.__name__, toolkit.toolkit_version)
    920         for toolkit in GLOBAL_TOOLKIT_REGISTRY.registered_toolkits
    921     ]
    923 if "options" not in result.provenance:

File ~/Documents/Academics/MSSE/spring_2023/Capstone/bespokefit_workshop/env-bespoke/lib/python3.10/site-packages/openff/fragmenter/fragment.py:1012, in WBOFragmenter._fragment(self, molecule, target_bond_smarts)
   1006 if self.wbo_options.method != "am1-wiberg-elf10":
   1008     raise NotImplementedError(
   1009         "WBOs can currently only be computed using 'am1-wiberg-elf10'."
   1010     )
-> 1012 molecule = assign_elf10_am1_bond_orders(
   1013     molecule, self.wbo_options.max_conformers, self.wbo_options.rms_threshold
   1014 )
   1016 rotatable_bonds = self.find_rotatable_bonds(molecule, target_bond_smarts)
   1017 wbo_rotor_bonds = self._get_rotor_wbo(molecule, rotatable_bonds)

File ~/Documents/Academics/MSSE/spring_2023/Capstone/bespokefit_workshop/env-bespoke/lib/python3.10/site-packages/openff/fragmenter/chemi.py:48, in assign_elf10_am1_bond_orders(molecule, max_confs, rms_threshold)
     44 per_conformer_bond_orders = []
     46 for conformer in molecule.conformers:
---> 48     molecule.assign_fractional_bond_orders("am1-wiberg", use_conformers=[conformer])
     50     per_conformer_bond_orders.append(
     51         [bond.fractional_bond_order for bond in molecule.bonds]
     52     )
     54 bond_orders = [*numpy.mean(per_conformer_bond_orders, axis=0)]

File ~/Documents/Academics/MSSE/spring_2023/Capstone/bespokefit_workshop/env-bespoke/lib/python3.10/site-packages/openff/toolkit/topology/molecule.py:3473, in FrozenMolecule.assign_fractional_bond_orders(self, bond_order_model, toolkit_registry, use_conformers)
   3443 """
   3444 Update and store list of bond orders this molecule. Bond orders are stored on each
   3445 bond, in the ``bond.fractional_bond_order`` attribute.
   (...)
   3469 
   3470 """
   3472 if isinstance(toolkit_registry, ToolkitRegistry):
-> 3473     return toolkit_registry.call(
   3474         "assign_fractional_bond_orders",
   3475         self,
   3476         bond_order_model=bond_order_model,
   3477         use_conformers=use_conformers,
   3478     )
   3479 elif isinstance(toolkit_registry, ToolkitWrapper):
   3480     toolkit = toolkit_registry

File ~/Documents/Academics/MSSE/spring_2023/Capstone/bespokefit_workshop/env-bespoke/lib/python3.10/site-packages/openff/toolkit/utils/toolkit_registry.py:366, in ToolkitRegistry.call(self, method_name, raise_exception_types, *args, **kwargs)
    364             for exception_type in raise_exception_types:
    365                 if isinstance(e, exception_type):
--> 366                     raise e
    367             errors.append((toolkit, e))
    369 # No toolkit was found to provide the requested capability
    370 # TODO: Can we help developers by providing a check for typos in expected method names?

File ~/Documents/Academics/MSSE/spring_2023/Capstone/bespokefit_workshop/env-bespoke/lib/python3.10/site-packages/openff/toolkit/utils/toolkit_registry.py:362, in ToolkitRegistry.call(self, method_name, raise_exception_types, *args, **kwargs)
    360 method = getattr(toolkit, method_name)
    361 try:
--> 362     return method(*args, **kwargs)
    363 except Exception as e:
    364     for exception_type in raise_exception_types:

File ~/Documents/Academics/MSSE/spring_2023/Capstone/bespokefit_workshop/env-bespoke/lib/python3.10/site-packages/openff/toolkit/utils/ambertools_wrapper.py:537, in AmberToolsToolkitWrapper.assign_fractional_bond_orders(self, molecule, bond_order_model, use_conformers, _cls)
    532 self._rdkit_toolkit_wrapper.to_file(
    533     temp_mol, "molecule.sdf", file_format="sdf"
    534 )
    535 # Prepare sqm.in file as if we were going to run charge calc
    536 # TODO: Add error handling if antechamber chokes
--> 537 subprocess.check_output(
    538     [
    539         "antechamber",
    540         "-i",
    541         "molecule.sdf",
    542         "-fi",
    543         "sdf",
    544         "-o",
    545         "sqm.in",
    546         "-fo",
    547         "sqmcrt",
    548         "-pf",
    549         "yes",
    550         "-c",
    551         ac_charge_keyword,
    552         "-nc",
    553         str(net_charge),
    554     ]
    555 )
    556 # Modify sqm.in to request bond order calculation
    557 self._modify_sqm_in_to_request_bond_orders("sqm.in")

File ~/Documents/Academics/MSSE/spring_2023/Capstone/bespokefit_workshop/env-bespoke/lib/python3.10/subprocess.py:421, in check_output(timeout, *popenargs, **kwargs)
    418         empty = b''
    419     kwargs['input'] = empty
--> 421 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    422            **kwargs).stdout

File ~/Documents/Academics/MSSE/spring_2023/Capstone/bespokefit_workshop/env-bespoke/lib/python3.10/subprocess.py:526, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
    524     retcode = process.poll()
    525     if check and retcode:
--> 526         raise CalledProcessError(retcode, process.args,
    527                                  output=stdout, stderr=stderr)
    528 return CompletedProcess(process.args, retcode, stdout, stderr)

CalledProcessError: Command '['antechamber', '-i', 'molecule.sdf', '-fi', 'sdf', '-o', 'sqm.in', '-fo', 'sqmcrt', '-pf', 'yes', '-c', 'mul', '-nc', '1.0 e']' returned non-zero exit status 1.

Software versions

What is the output of running `conda list`?
# Name                    Version                   Build  Channel
aiofiles                  22.1.0             pyhd8ed1ab_0    conda-forge
aiosqlite                 0.18.0             pyhd8ed1ab_0    conda-forge
amberlite                 22.0                     pypi_0    pypi
ambertools                22.0            py310h35066de_3    conda-forge
amberutils                21.0                     pypi_0    pypi
amqp                      5.1.1              pyhd8ed1ab_0    conda-forge
anyio                     3.6.2              pyhd8ed1ab_0    conda-forge
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
appnope                   0.1.3              pyhd8ed1ab_0    conda-forge
argcomplete               1.12.3             pyhd8ed1ab_0    conda-forge
argon2-cffi               21.3.0             pyhd8ed1ab_0    conda-forge
argon2-cffi-bindings      21.2.0          py310h90acd4f_3    conda-forge
arpack                    3.7.0                hefb7bc6_2    conda-forge
arrow-cpp                 11.0.0           h694c41f_2_cpu    conda-forge
asttokens                 2.2.1              pyhd8ed1ab_0    conda-forge
astunparse                1.6.3              pyhd8ed1ab_0    conda-forge
async-timeout             4.0.2              pyhd8ed1ab_0    conda-forge
attrs                     22.2.0             pyh71513ae_0    conda-forge
aws-c-auth                0.6.23               hb2f45f0_1    conda-forge
aws-c-cal                 0.5.20               h3aaaed9_4    conda-forge
aws-c-common              0.8.9                hb7f2c08_0    conda-forge
aws-c-compression         0.2.16               h980c674_1    conda-forge
aws-c-event-stream        0.2.18               h947c3fe_2    conda-forge
aws-c-http                0.7.3                h9091ec1_1    conda-forge
aws-c-io                  0.13.14              h666a9c8_3    conda-forge
aws-c-mqtt                0.8.6                h2814666_1    conda-forge
aws-c-s3                  0.2.3                h24f324c_3    conda-forge
aws-c-sdkutils            0.1.7                h980c674_1    conda-forge
aws-checksums             0.1.14               h980c674_1    conda-forge
aws-crt-cpp               0.18.16             ha2465d3_13    conda-forge
aws-sdk-cpp               1.10.57              hcf18aa8_2    conda-forge
babel                     2.11.0             pyhd8ed1ab_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                pyhd8ed1ab_3    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
basis_set_exchange        0.9                pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.11.2             pyha770c72_0    conda-forge
billiard                  3.6.4.0         py310h90acd4f_3    conda-forge
bleach                    6.0.0              pyhd8ed1ab_0    conda-forge
blosc                     1.21.2               hebb52c4_0    conda-forge
boost                     1.74.0          py310h509978a_5    conda-forge
boost-cpp                 1.74.0               h8b082ac_8    conda-forge
brotli                    1.0.9                hb7f2c08_8    conda-forge
brotli-bin                1.0.9                hb7f2c08_8    conda-forge
brotlipy                  0.7.0           py310h90acd4f_1005    conda-forge
bzip2                     1.0.8                h0d85af4_4    conda-forge
c-ares                    1.18.1               h0d85af4_0    conda-forge
ca-certificates           2022.12.7            h033912b_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cachetools                5.3.0              pyhd8ed1ab_0    conda-forge
cairo                     1.16.0            h904041c_1014    conda-forge
celery                    5.2.7              pyhd8ed1ab_0    conda-forge
certifi                   2022.12.7          pyhd8ed1ab_0    conda-forge
cffi                      1.15.1          py310ha78151a_3    conda-forge
charset-normalizer        2.1.1              pyhd8ed1ab_0    conda-forge
chemper                   1.0.1              pyhd8ed1ab_0    conda-forge
click                     8.1.3           unix_pyhd8ed1ab_2    conda-forge
click-didyoumean          0.3.0              pyhd8ed1ab_0    conda-forge
click-option-group        0.5.3              pyhd8ed1ab_1    conda-forge
click-plugins             1.1.1                      py_0    conda-forge
click-repl                0.2.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
comm                      0.1.2              pyhd8ed1ab_0    conda-forge
conda                     22.11.1         py310h2ec42d9_1    conda-forge
conda-package-handling    2.0.2              pyh38be061_0    conda-forge
conda-package-streaming   0.7.0              pyhd8ed1ab_1    conda-forge
contourpy                 1.0.7           py310ha23aa8a_0    conda-forge
cryptography              39.0.1          py310hdd0c95c_0    conda-forge
curl                      7.87.0               h6df9250_0    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
cython                    0.29.33         py310h7a76584_0    conda-forge
debugpy                   1.6.6           py310h7a76584_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
executing                 1.2.0              pyhd8ed1ab_0    conda-forge
expat                     2.5.0                hf0c8a7f_0    conda-forge
fastapi                   0.86.0             pyhd8ed1ab_0    conda-forge
fftw                      3.3.10          nompi_h4fa670e_106    conda-forge
flit-core                 3.8.0              pyhd8ed1ab_0    conda-forge
fmt                       9.1.0                hb8565cd_0    conda-forge
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                 hab24e00_0    conda-forge
fontconfig                2.14.2               h5bb23bf_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.38.0          py310h90acd4f_1    conda-forge
forcebalance              1.9.3           py310h84c6d00_0    conda-forge
freetype                  2.12.1               h3f81eb7_1    conda-forge
future                    0.18.3             pyhd8ed1ab_0    conda-forge
geometric                 1.0                pyhd8ed1ab_0    conda-forge
gettext                   0.21.1               h8a4c099_0    conda-forge
gflags                    2.2.2             hb1e8313_1004    conda-forge
glib                      2.74.1               hbc0c0cd_1    conda-forge
glib-tools                2.74.1               hbc0c0cd_1    conda-forge
glog                      0.6.0                h8ac2a54_0    conda-forge
greenlet                  2.0.2           py310h7a76584_0    conda-forge
gst-plugins-base          1.22.0               h37e1711_0    conda-forge
gstreamer                 1.22.0               h1d18e73_0    conda-forge
h11                       0.14.0             pyhd8ed1ab_0    conda-forge
h2                        4.1.0              pyhd8ed1ab_0    conda-forge
h5py                      3.8.0           nompi_py310h5555e59_100    conda-forge
hdf4                      4.2.15               h7aa5921_5    conda-forge
hdf5                      1.12.2          nompi_h48135f9_101    conda-forge
hpack                     4.0.0              pyh9f0ad1d_0    conda-forge
httpcore                  0.16.3             pyhd8ed1ab_0    conda-forge
httpx                     0.23.3             pyhd8ed1ab_0    conda-forge
hyperframe                6.0.1              pyhd8ed1ab_0    conda-forge
icu                       70.1                 h96cf925_0    conda-forge
idna                      3.4                pyhd8ed1ab_0    conda-forge
importlib-metadata        6.0.0              pyha770c72_0    conda-forge
importlib_metadata        6.0.0                hd8ed1ab_0    conda-forge
importlib_resources       5.10.2             pyhd8ed1ab_0    conda-forge
ipykernel                 6.21.1             pyh736e0ef_0    conda-forge
ipython                   8.10.0             pyhd1c38e8_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.7.3              pyhd8ed1ab_0    conda-forge
jax                       0.4.3              pyhd8ed1ab_0    conda-forge
jaxlib                    0.4.3           cpu_py310hcb8af8a_1    conda-forge
jedi                      0.18.2             pyhd8ed1ab_0    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
jpeg                      9e                   hb7f2c08_3    conda-forge
json5                     0.9.5              pyh9f0ad1d_0    conda-forge
jsonschema                4.17.3             pyhd8ed1ab_0    conda-forge
jupyter                   1.0.0           py310h2ec42d9_8    conda-forge
jupyter_client            8.0.2              pyhd8ed1ab_0    conda-forge
jupyter_console           6.4.4              pyhd8ed1ab_0    conda-forge
jupyter_core              5.2.0           py310h2ec42d9_0    conda-forge
jupyter_events            0.5.0              pyhd8ed1ab_1    conda-forge
jupyter_server            2.2.1              pyhd8ed1ab_0    conda-forge
jupyter_server_fileid     0.6.0              pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.4.4              pyhd8ed1ab_1    conda-forge
jupyter_server_ydoc       0.6.1              pyhd8ed1ab_0    conda-forge
jupyter_ydoc              0.2.2              pyhd8ed1ab_0    conda-forge
jupyterlab                3.6.1              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.2.2              pyhd8ed1ab_0    conda-forge
jupyterlab_server         2.19.0             pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        1.1.1              pyhd8ed1ab_0    conda-forge
khronos-opencl-icd-loader 2022.09.30           hb7f2c08_2    conda-forge
kiwisolver                1.4.4           py310ha23aa8a_1    conda-forge
kombu                     5.2.4           py310h2ec42d9_2    conda-forge
krb5                      1.20.1               h049b76e_0    conda-forge
lcms2                     2.14                 h29502cd_1    conda-forge
lerc                      4.0.0                hb486fe8_0    conda-forge
libabseil                 20220623.0      cxx17_h844d122_6    conda-forge
libaec                    1.0.6                hf0c8a7f_1    conda-forge
libarchive                3.6.2                h6d8d9f1_0    conda-forge
libarrow                  11.0.0           hf6017ac_2_cpu    conda-forge
libblas                   3.9.0           16_osx64_openblas    conda-forge
libbrotlicommon           1.0.9                hb7f2c08_8    conda-forge
libbrotlidec              1.0.9                hb7f2c08_8    conda-forge
libbrotlienc              1.0.9                hb7f2c08_8    conda-forge
libcblas                  3.9.0           16_osx64_openblas    conda-forge
libclang                  13.0.1          default_he082bbe_0    conda-forge
libcrc32c                 1.1.2                he49afe7_0    conda-forge
libcurl                   7.87.0               h6df9250_0    conda-forge
libcxx                    14.0.6               hccf4f1f_0    conda-forge
libdeflate                1.17                 hac1461d_0    conda-forge
libedit                   3.1.20191231         h0678c8f_2    conda-forge
libev                     4.33                 haf1e3a3_1    conda-forge
libevent                  2.1.10               h7d65743_4    conda-forge
libffi                    3.4.2                h0d85af4_5    conda-forge
libgfortran               5.0.0           11_3_0_h97931a8_27    conda-forge
libgfortran5              11.3.0              h082f757_27    conda-forge
libglib                   2.74.1               h4c723e1_1    conda-forge
libgoogle-cloud           2.7.0                hb5e37a9_1    conda-forge
libgrpc                   1.51.1               h1ddfa78_1    conda-forge
libiconv                  1.17                 hac89ed1_0    conda-forge
liblapack                 3.9.0           16_osx64_openblas    conda-forge
libllvm13                 13.0.1               h64f94b2_2    conda-forge
libmamba                  1.3.1                h9d281b0_1    conda-forge
libmambapy                1.3.1           py310hb15139c_1    conda-forge
libnetcdf                 4.8.1           nompi_hc61b76e_106    conda-forge
libnghttp2                1.51.0               he2ab024_0    conda-forge
libogg                    1.3.4                h35c211d_1    conda-forge
libopenblas               0.3.21          openmp_h429af6e_3    conda-forge
libopus                   1.3.1                hc929b4f_1    conda-forge
libpng                    1.6.39               ha978bb4_0    conda-forge
libpq                     15.2                 h3640bf0_0    conda-forge
libprotobuf               3.21.12              hbc0c0cd_0    conda-forge
libsodium                 1.0.18               hbcb3906_1    conda-forge
libsolv                   0.7.23               hbc0c0cd_0    conda-forge
libsqlite                 3.40.0               ha978bb4_0    conda-forge
libssh2                   1.10.0               h47af595_3    conda-forge
libthrift                 0.16.0               h16802d8_2    conda-forge
libtiff                   4.5.0                hee9004a_2    conda-forge
libutf8proc               2.8.0                hb7f2c08_0    conda-forge
libvorbis                 1.3.7                h046ec9c_0    conda-forge
libwebp-base              1.2.4                h775f41a_0    conda-forge
libxcb                    1.13              h0d85af4_1004    conda-forge
libxml2                   2.10.3               hb9e07b5_0    conda-forge
libxslt                   1.1.37               h5d22bc9_0    conda-forge
libzip                    1.9.2                h6db710c_1    conda-forge
libzlib                   1.2.13               hfd90126_4    conda-forge
llvm-openmp               15.0.7               h61d9ccf_0    conda-forge
lxml                      4.9.2           py310h0b20c97_0    conda-forge
lz4-c                     1.9.4                hf0c8a7f_0    conda-forge
lzo                       2.10              haf1e3a3_1000    conda-forge
mamba                     1.3.1           py310h6bde348_1    conda-forge
markdown-it-py            2.1.0              pyhd8ed1ab_0    conda-forge
markupsafe                2.1.2           py310h90acd4f_0    conda-forge
matplotlib-base           3.6.3           py310he725631_0    conda-forge
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
mctc-lib                  0.3.1                h5f0aba5_0    conda-forge
mdtraj                    1.9.7           py310h1b5c016_4    conda-forge
mdurl                     0.1.0              pyhd8ed1ab_0    conda-forge
mistune                   2.0.5              pyhd8ed1ab_0    conda-forge
mmpbsa-py                 16.0                     pypi_0    pypi
msgpack-python            1.0.4           py310ha23aa8a_1    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
mysql-common              8.0.31               hc4b2c72_0    conda-forge
mysql-libs                8.0.31               h8658499_0    conda-forge
nb_conda_kernels          2.3.1           py310h2ec42d9_2    conda-forge
nbclassic                 0.5.1              pyhd8ed1ab_0    conda-forge
nbclient                  0.7.2              pyhd8ed1ab_0    conda-forge
nbconvert                 7.2.9              pyhd8ed1ab_0    conda-forge
nbconvert-core            7.2.9              pyhd8ed1ab_0    conda-forge
nbconvert-pandoc          7.2.9              pyhd8ed1ab_0    conda-forge
nbformat                  5.7.3              pyhd8ed1ab_0    conda-forge
ncurses                   6.3                  h96cf925_1    conda-forge
nest-asyncio              1.5.6              pyhd8ed1ab_0    conda-forge
netcdf-fortran            4.6.0           nompi_h96bf37d_102    conda-forge
networkx                  3.0                pyhd8ed1ab_0    conda-forge
nglview                   3.0.3              pyh8a188c0_0    conda-forge
nomkl                     1.0                  h5ca1d4c_0    conda-forge
notebook                  6.5.2              pyha770c72_1    conda-forge
notebook-shim             0.2.2              pyhd8ed1ab_0    conda-forge
nspr                      4.35                 hea0b92c_0    conda-forge
nss                       3.88                 h78b00b3_0    conda-forge
numexpr                   2.8.3           py310hecf8f37_1    conda-forge
numpy                     1.24.2          py310h788a5b3_0    conda-forge
ocl_icd_wrapper_apple     1.0.0                hbcb3906_0    conda-forge
openff-amber-ff-ports     0.0.3              pyh6c4a22f_0    conda-forge
openff-bespokefit         0.1.3              pyhd8ed1ab_3    conda-forge
openff-forcefields        2.0.0              pyh6c4a22f_0    conda-forge
openff-fragmenter-base    0.1.2              pyhd8ed1ab_1    conda-forge
openff-interchange        0.1.4              pyhd8ed1ab_0    conda-forge
openff-interchange-base   0.1.4              pyh6c4a22f_0    conda-forge
openff-qcsubmit           0.3.2              pyhd8ed1ab_0    conda-forge
openff-toolkit            0.10.6             pyhd8ed1ab_0    conda-forge
openff-toolkit-base       0.10.6             pyhd8ed1ab_0    conda-forge
openff-units              0.2.0              pyh1a96a4e_0    conda-forge
openff-utilities          0.1.8              pyh1a96a4e_0    conda-forge
openjpeg                  2.5.0                h13ac156_2    conda-forge
openmm                    8.0.0           py310haad9867_0_khronos    conda-forge
openssl                   3.0.8                hfd90126_0    conda-forge
opt_einsum                3.3.0              pyhd8ed1ab_1    conda-forge
orc                       1.8.2                ha9d861c_2    conda-forge
packaging                 23.0               pyhd8ed1ab_0    conda-forge
packmol                   20.010               h508aa58_0    conda-forge
packmol-memgen            1.2.3rc0                 pypi_0    pypi
pandas                    1.5.3           py310hecf8f37_0    conda-forge
pandoc                    2.19.2               h694c41f_1    conda-forge
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
panedr                    0.7.1              pyhd8ed1ab_0    conda-forge
parmed                    3.4.3           py310h7a76584_3    conda-forge
parquet-cpp               1.5.1                         2    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pbr                       5.11.1             pyhd8ed1ab_0    conda-forge
pcre2                     10.40                h1c4e4bc_0    conda-forge
pdb4amber                 22.0                     pypi_0    pypi
pdbfixer                  1.8.1              pyh6c4a22f_0    conda-forge
perl                      5.32.1          2_h0d85af4_perl5    conda-forge
pexpect                   4.8.0              pyh1a96a4e_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    9.4.0           py310h306a057_1    conda-forge
pint                      0.20.1             pyhd8ed1ab_0    conda-forge
pip                       23.0               pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               hbcb3906_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_0    conda-forge
platformdirs              3.0.0              pyhd8ed1ab_0    conda-forge
plotly                    5.13.0             pyhd8ed1ab_0    conda-forge
pluggy                    1.0.0              pyhd8ed1ab_5    conda-forge
ply                       3.11                       py_1    conda-forge
pooch                     1.6.0              pyhd8ed1ab_0    conda-forge
prometheus_client         0.16.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.36             pyha770c72_0    conda-forge
prompt_toolkit            3.0.36               hd8ed1ab_0    conda-forge
psutil                    5.9.4           py310h90acd4f_0    conda-forge
pthread-stubs             0.4               hc929b4f_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
py-cpuinfo                9.0.0              pyhd8ed1ab_0    conda-forge
pyarrow                   11.0.0          py310h435aefc_2_cpu    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycairo                   1.23.0          py310h8cdeff8_0    conda-forge
pycosat                   0.6.4           py310h90acd4f_1    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pydantic                  1.10.4          py310h90acd4f_1    conda-forge
pyedr                     0.7.1              pyhd8ed1ab_0    conda-forge
pygments                  2.14.0             pyhd8ed1ab_0    conda-forge
pymbar                    4.0.1           py310h936d966_1    conda-forge
pyopenssl                 23.0.0             pyhd8ed1ab_0    conda-forge
pyparsing                 3.0.9              pyhd8ed1ab_0    conda-forge
pyqt                      5.15.7          py310hdd03f62_3    conda-forge
pyqt5-sip                 12.11.0         py310h415000c_3    conda-forge
pyrsistent                0.19.3          py310h90acd4f_0    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
pytables                  3.7.0           py310h90ba602_3    conda-forge
python                    3.10.9          he7542f4_0_cpython    conda-forge
python-constraint         1.4.0                      py_0    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-fastjsonschema     2.16.2             pyhd8ed1ab_0    conda-forge
python-json-logger        2.0.4              pyhd8ed1ab_0    conda-forge
python_abi                3.10                    3_cp310    conda-forge
pytraj                    2.0.6                    pypi_0    pypi
pytz                      2022.7.1           pyhd8ed1ab_0    conda-forge
pyyaml                    6.0             py310h90acd4f_5    conda-forge
pyzmq                     25.0.0          py310hf615a82_0    conda-forge
qcelemental               0.25.1             pyhd8ed1ab_1    conda-forge
qcengine                  0.26.0             pyhd8ed1ab_0    conda-forge
qcportal                  0.15.8             pyhd8ed1ab_0    conda-forge
qt-main                   5.15.8               h1d3b3f8_6    conda-forge
qtconsole                 5.4.0              pyhd8ed1ab_0    conda-forge
qtconsole-base            5.4.0              pyha770c72_0    conda-forge
qtpy                      2.3.0              pyhd8ed1ab_0    conda-forge
rdkit                     2022.09.1       py310h5b22e64_0    conda-forge
re2                       2023.02.01           hf0c8a7f_0    conda-forge
readline                  8.1.2                h3899abd_0    conda-forge
redis-py                  4.5.1              pyhd8ed1ab_0    conda-forge
redis-server              7.0.4                hc68d04a_0    conda-forge
regex                     2022.10.31      py310h90acd4f_0    conda-forge
reportlab                 3.6.12          py310hc0d9dca_2    conda-forge
reproc                    14.2.4               hb7f2c08_0    conda-forge
reproc-cpp                14.2.4               hf0c8a7f_0    conda-forge
requests                  2.28.2             pyhd8ed1ab_0    conda-forge
rfc3986                   1.5.0              pyhd8ed1ab_0    conda-forge
rich                      13.3.1             pyhd8ed1ab_1    conda-forge
ruamel.yaml               0.17.21         py310h90acd4f_2    conda-forge
ruamel.yaml.clib          0.2.7           py310h90acd4f_1    conda-forge
sander                    22.0                     pypi_0    pypi
scipy                     1.10.0          py310h240c617_2    conda-forge
send2trash                1.8.0              pyhd8ed1ab_0    conda-forge
setuptools                67.1.0             pyhd8ed1ab_0    conda-forge
sip                       6.7.7           py310h7a76584_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
smirnoff99frosst          1.1.0              pyh44b312d_0    conda-forge
snappy                    1.1.9                h225ccf5_2    conda-forge
sniffio                   1.3.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.3.2.post1        pyhd8ed1ab_0    conda-forge
sqlalchemy                2.0.3           py310h90acd4f_0    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
starlette                 0.20.4             pyhd8ed1ab_1    conda-forge
tenacity                  8.2.1              pyhd8ed1ab_0    conda-forge
terminado                 0.17.1             pyhd1c38e8_0    conda-forge
tinycss2                  1.2.1              pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h5dbffcc_0    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
toolz                     0.12.0             pyhd8ed1ab_0    conda-forge
tornado                   6.2             py310h90acd4f_1    conda-forge
torsiondrive              1.1.0              pyhd8ed1ab_0    conda-forge
tqdm                      4.64.1             pyhd8ed1ab_0    conda-forge
traitlets                 5.9.0              pyhd8ed1ab_0    conda-forge
typing-extensions         4.4.0                hd8ed1ab_0    conda-forge
typing_extensions         4.4.0              pyha770c72_0    conda-forge
tzdata                    2022g                h191b570_0    conda-forge
unicodedata2              15.0.0          py310h90acd4f_0    conda-forge
urllib3                   1.26.14            pyhd8ed1ab_0    conda-forge
uvicorn                   0.20.0          py310h2ec42d9_1    conda-forge
vine                      5.0.0              pyhd8ed1ab_1    conda-forge
wcwidth                   0.2.6              pyhd8ed1ab_0    conda-forge
webencodings              0.5.1                      py_1    conda-forge
websocket-client          1.5.1              pyhd8ed1ab_0    conda-forge
wheel                     0.38.4             pyhd8ed1ab_0    conda-forge
widgetsnbextension        3.6.1              pyha770c72_0    conda-forge
xmltodict                 0.13.0             pyhd8ed1ab_0    conda-forge
xorg-kbproto              1.0.7             h35c211d_1002    conda-forge
xorg-libice               1.0.10               h0d85af4_0    conda-forge
xorg-libsm                1.2.3             h0d85af4_1000    conda-forge
xorg-libx11               1.7.2                h0d85af4_0    conda-forge
xorg-libxau               1.0.9                h35c211d_0    conda-forge
xorg-libxdmcp             1.1.3                h35c211d_0    conda-forge
xorg-libxext              1.3.4                h0d85af4_1    conda-forge
xorg-libxt                1.2.1                h0d85af4_2    conda-forge
xorg-xextproto            7.3.0             h35c211d_1002    conda-forge
xorg-xproto               7.0.31            h35c211d_1007    conda-forge
xtb                       6.5.1                h5bf119a_1    conda-forge
xtb-python                22.1            py310h90acd4f_0    conda-forge
xz                        5.2.6                h775f41a_0    conda-forge
y-py                      0.5.5           py310hb28ce15_2    conda-forge
yaml                      0.2.5                h0d85af4_2    conda-forge
yaml-cpp                  0.7.0                hf0c8a7f_2    conda-forge
ypy-websocket             0.8.2              pyhd8ed1ab_0    conda-forge
zeromq                    4.3.4                he49afe7_1    conda-forge
zipp                      3.13.0             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               hfd90126_4    conda-forge
zstandard                 0.19.0          py310h3cf44b0_1    conda-forge
zstd                      1.5.2                hbc0c0cd_6    conda-forge
xperrylinn commented 1 year ago

Ran the command on its own. This is what I found:

(base) xperrylinn@MacBook-Pro bespokefit_workshop % antechamber -i molecule.sdf -fi sdf -o sqm.in -fo sqmcrt -pf yes -c mul -nc 0.0 e

Welcome to antechamber 22.0: molecular input file processor.

/Users/xperrylinn/miniconda3/envs/bespoke-env/bin/wrapped_progs/antechamber: Fatal Error!
Number of arguments is odd - arguments must come in pairs.
Use antechamber -h for command-line syntax.

It appears to be related to the formatting of command line arguments. I'll check the reference documentation to see if there's a clue.

molecule.sdf:

C3H6O
APtclcactv02122312273D 0   0.00000     0.00000

 10  9  0  0  0  0  0  0  0  0999 V2000
    1.3051   -0.6772   -0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0763   -0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.0000    1.2839    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
   -1.3051   -0.6772    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.6198   -0.8588    1.0277 H   0  0  0  0  0  0  0  0  0  0  0  0
    1.1748   -1.6296   -0.5138 H   0  0  0  0  0  0  0  0  0  0  0  0
    2.0647   -0.0881   -0.5138 H   0  0  0  0  0  0  0  0  0  0  0  0
   -1.1059   -1.7488   -0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
   -1.8767   -0.4138    0.8900 H   0  0  0  0  0  0  0  0  0  0  0  0
   -1.8767   -0.4138   -0.8900 H   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0  0  0  0
  2  3  2  0  0  0  0
  2  4  1  0  0  0  0
  1  5  1  0  0  0  0
  1  6  1  0  0  0  0
  1  7  1  0  0  0  0
  4  8  1  0  0  0  0
  4  9  1  0  0  0  0
  4 10  1  0  0  0  0
M  END
$$$$
xperrylinn commented 1 year ago

^^^ Turns out the last argument needed to be wrapped in quotes to get parsed correctly. I'm getting what looks like to be a successful out.

(base) xperrylinn@MacBook-Pro bespokefit_workshop % antechamber -i molecule.sdf -fi sdf -o sqm.in -fo sqmcrt -pf yes -c mul -nc '0.0 e'

Welcome to antechamber 22.0: molecular input file processor.

Info: acdoctor mode is on: check and diagnose problems in the input file.
Info: The atom type is set to gaff; the options available to the -at flag are
      gaff, gaff2, amber, bcc, and sybyl.

-- Check Format for sdf File --
   Status: pass
-- Check Unusual Elements --
   Status: pass
-- Check Open Valences --
   Status: pass
-- Check Geometry --
      for those bonded   
      for those not bonded   
   Status: pass
-- Check Weird Bonds --
   Status: pass
-- Check Number of Units --
   Status: pass
acdoctor mode has completed checking the input file.

Info: Total number of electrons: 32; net charge: 0

Running: /Users/xperrylinn/miniconda3/envs/bespoke-env/bin/sqm -O -i sqm.in -o sqm.out
Info: Total number of electrons: 32; net charge: 0
xperrylinn commented 1 year ago

Okay the issue definitely appears to be with openff. There isn't error handling, so the standard output from the process error isn't returned by the API. I added some error handling to see what the issue was and this is what I got the following from standard out. Nothing in standard error and the exit code is 1:

b'\nWelcome to antechamber 22.0: molecular input file processor.\n\nInfo: acdoctor mode is on: check and diagnose problems in the input file.\nInfo: The atom type is set to gaff; the options available to the -at flag are\n gaff, gaff2, amber, bcc, and sybyl.\n\n-- Check Format for sdf File --\n Status: pass\n-- Check Unusual Elements --\n Status: pass\n-- Check Open Valences --\nWarning: This molecule has no hydrogens nor halogens.\n It is quite possible that there are unfilled valences.\n-- Check Geometry --\n for those bonded \n for those not bonded \n Status: pass\n-- Check Weird Bonds --\n Status: pass\n-- Check Number of Units --\n Status: pass\nacdoctor mode has completed checking the input file.\n\nInfo: Total number of electrons: 0; net charge: 0\n\nRunning: /Users/xperrylinn/miniconda3/envs/bespoke-env/bin/sqm -O -i sqm.in -o sqm.out\n'

Screenshot 2023-02-12 at 10 26 53 AM

xperrylinn commented 1 year ago

I think I figured out a way to get it working - if I run antechamber -i molecule.sdf -fi sdf -o sqm.in -fo sqmcrt -pf yes -c mul -nc "0.0 e" twice in the terminal it appears to unsnag running the fragmentation code. This is also after initially placing a dummy molecule.sdf file the working directory.

edit: nevermind. something weird is happening.

Yoshanuikabundi commented 1 year ago

Hi Xavier, I saw your comment on the Gist - thanks for raising this issue. Let me try and reproduce on my Mac and get back to you.

While I'm doing that - are you using an Apple Silicon Mac? If so, how did you install the Conda environment - are you using an AMD64 Conda installation and running it through Rosetta2, or something else?

Yoshanuikabundi commented 1 year ago

This is really weird. I am unable to reproduce on my Mac. The environment Conda solved for me was identical to yours, except for the version of PyMBAR and some related dependencies, but upgrading that didn't make a difference. Note that the OpenFF stack isn't yet compatible with PyMBAR 4, but that doesn't seem to be what's going on here.

I infer from the traceback that this came up when you tried to run the bespokefit.ipynb fragmentation demonstration cell - did you make any changes to the notebook? Do you get an error when you try to run BespokeFit directly, ie with something like

openff-bespoke executor run --smiles             "CC(=O)NC1=CC=C(C=C1)O" \
                            --workflow           "default"               \
                            --output             "acetaminophen.json"    \
                            --output-force-field "acetaminophen.offxml"  \
                            --n-qc-compute-workers 1                     \
                            --qc-compute-n-cores   2                     \
                            --default-qc-spec xtb gfn2xtb none

from the quickstart guide acetaminophen example?

I suspect there may be something going on with Apple Silicon, Rosetta, and a previously-installed copy of Antechamber, but I can't think of any way this could've come about as it should be impossible to install AmberTools in an osx-arm64 Conda environment. You could try installing a new copy of osx-64 Conda/Mamba (ie, NOT osx-arm64) and running it through Rosetta, if that's not what you've done already.

Other than that, @j-wags @mattwthompson - any ideas?

mattwthompson commented 1 year ago

It's encouraging you are as confused as me, I was at a loss from just reading things. ( I thought briefly about something sneaking in through $AMBERHOME but the paths to antechamber and sqm go through the conda environment.) I've been running Ambertools via Rosetta for about a year now without failures this cryptic. My AmberTools build is the same (py310h35066de_3). The error is bubbling up from WBO assignment but not something that strikes me as a method call with strange arguments.

The only suggestion I have is making a fresh conda environment and running some AmberToolsToolkitWrapper commands more directly. From the information available it's probably a toolkit issue and not something broken here.

from openff.toolkit.topology import Molecule
from openff.toolkit.utils.ambertools_wrapper import AmberToolsToolkitWrapper
from openff.toolkit.utils.rdkit_wrapper import RDKitToolkitWrapper
from openff.toolkit.utils.toolkit_registry import ToolkitRegistry

molecule = Molecule.from_smiles(
    "CC(=O)NC1=CC=C(C=C1)O",
    toolkit_registry=ToolkitRegistry([RDKitToolkitWrapper()]),
)
molecule.generate_conformers(n_conformers=10)
molecule.assign_partial_charges(
    partial_charge_method="am1bcc",
    toolkit_registry=ToolkitRegistry([AmberToolsToolkitWrapper()]),
)
for conformer in molecule.conformers:
    molecule.assign_fractional_bond_orders(
        "am1-wiberg",
        use_conformers=[conformer],
        toolkit_registry=ToolkitRegistry([AmberToolsToolkitWrapper()]),
    )
xperrylinn commented 1 year ago

Hi Xavier, I saw your comment on the Gist - thanks for raising this issue. Let me try and reproduce on my Mac and get back to you.

While I'm doing that - are you using an Apple Silicon Mac? If so, how did you install the Conda environment - are you using an AMD64 Conda installation and running it through Rosetta2, or something else?

Hi Josh, thank you for the quick response! Below is my Mac specification and I installed the dependencies using conda 23.1.0

Screenshot 2023-02-13 at 7 20 40 AM

and I'm managing environments with miniconda3:

xperrylinn commented 1 year ago
openff-bespoke executor run --smiles             "CC(=O)NC1=CC=C(C=C1)O" \
                            --workflow           "default"               \
                            --output             "acetaminophen.json"    \
                            --output-force-field "acetaminophen.offxml"  \
                            --n-qc-compute-workers 1                     \
                            --qc-compute-n-cores   2                     \
                            --default-qc-spec xtb gfn2xtb none

No changes were made to the notebook. This command has been affording the same error, but I just ran it again and it went successfully all the way to QC Generation before hitting a OS too many files open error. I was surprised it worked, but then I remembered I had not deleted the sqm.in, and sqm.out files, so I deleted them and now the command is failing with the same subprocess error. I added these two sqm files by running the sub-process command outside of the python package on its own as I mentioned above which seems to work fine.

(bespoke-env) MacBook-Pro:bespokefit_workshop xperrylinn$ openff-bespoke executor run --smiles             "CC(=O)NC1=CC=C(C=C1)O"                             --workflow           "default"                                           --output             "acetaminophen.json"                                --output-force-field "acetaminophen.offxml"                              --n-qc-compute-workers 1                                                 --qc-compute-n-cores   2                                                 --default-qc-spec xtb gfn2xtb none
/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/celery/fixups/django.py:42: FixupWarning: Environment variable DJANGO_SETTINGS_MODULE is defined
but Django isn't installed.  Won't apply Django fix-ups!

  warnings.warn(FixupWarning(ERR_NOT_INSTALLED))

─────────────────────────────────────────────────────────────────────────── OpenFF Bespoke ────────────────────────────────────────────────────────────────────────────

/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/celery/fixups/django.py:42: FixupWarning: Environment variable DJANGO_SETTINGS_MODULE is 
defined
but Django isn't installed.  Won't apply Django fix-ups!

  warnings.warn(FixupWarning(ERR_NOT_INSTALLED))
⠹ launching the bespoke executor/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/celery/fixups/django.py:42: FixupWarning: Environment variable DJANGO_SETTINGS_MODULE is defined
but Django isn't installed.  Won't apply Django fix-ups!

  warnings.warn(FixupWarning(ERR_NOT_INSTALLED))
/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/celery/fixups/django.py:42: FixupWarning: Environment variable DJANGO_SETTINGS_MODULE is defined
but Django isn't installed.  Won't apply Django fix-ups!

  warnings.warn(FixupWarning(ERR_NOT_INSTALLED))
/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/celery/fixups/django.py:42: FixupWarning: Environment variable DJANGO_SETTINGS_MODULE is defined
but Django isn't installed.  Won't apply Django fix-ups!

  warnings.warn(FixupWarning(ERR_NOT_INSTALLED))
⠸ launching the bespoke executor/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/celery/fixups/django.py:42: FixupWarning: Environment variable DJANGO_SETTINGS_MODULE is defined
but Django isn't installed.  Won't apply Django fix-ups!

  warnings.warn(FixupWarning(ERR_NOT_INSTALLED))
[✓] bespoke executor launched

1. preparing the bespoke workflow                                                                                                                                      

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

2. submitting the workflow                                                                                                                                             

[✓] the following workflows were submitted
┏━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━┓
┃ ID ┃ SMILES             ┃ NAME ┃ FILE ┃
┡━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━┩
│ 1  │ CC(=O)Nc1ccc(O)cc1 │      │      │
└────┴────────────────────┴──────┴──────┘

3. running the fitting pipeline                                                                                                                                        

[x] fragmentation failed

 {"type": "CalledProcessError", "message": "Command '['antechamber', '-i', 'molecule.sdf', '-fi', 'sdf', '-o', 'sqm.in', '-fo', 'sqmcrt', '-pf', 'yes', '-c', 'mul',   
 '-nc', '0.0 e']' returned non-zero exit status 1.", "traceback": "Traceback (most recent call last):\n  File                                                          
 \"/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/celery/app/trace.py\", line 451, in trace_task\n    R = retval = fun(*args, **kwargs)\n  
 File \"/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/celery/app/trace.py\", line 734, in __protected_call__\n    return self.run(*args,  
 **kwargs)\n  File \"/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/openff/bespokefit/executor/services/fragmenter/worker.py\", line 37, in
 fragment\n    fragmenter.fragment(molecule, target_bond_smarts=target_bond_smarts)\n  File                                                                            
 \"/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py\", line 916, in fragment\n    result =                     
 self._fragment(molecule, target_bond_smarts)\n  File \"/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py\",    
 line 1019, in _fragment\n    fragments = {\n  File \"/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py\", line 
 1020, in <dictcomp>\n    bond: self._build_fragment(\n  File                                                                                                          
 \"/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py\", line 1198, in _build_fragment\n    wbo_difference =     
 cls._compare_wbo(\n  File \"/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/openff/fragmenter/fragment.py\", line 1108, in _compare_wbo\n  
 fragment = assign_elf10_am1_bond_orders(fragment, **kwargs)\n  File                                                                                                   
 \"/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/openff/fragmenter/chemi.py\", line 48, in assign_elf10_am1_bond_orders\n                 
 molecule.assign_fractional_bond_orders(\"am1-wiberg\", use_conformers=)\n  File                                                                                       
 \"/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/openff/toolkit/topology/molecule.py\", line 3473, in assign_fractional_bond_orders\n     
 return toolkit_registry.call(\n  File \"/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/openff/toolkit/utils/toolkit_registry.py\", line   
 366, in call\n    raise e\n  File \"/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/openff/toolkit/utils/toolkit_registry.py\", line 362,  
 in call\n    return method(*args, **kwargs)\n  File                                                                                                                   
 \"/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/site-packages/openff/toolkit/utils/ambertools_wrapper.py\", line 538, in                               
 assign_fractional_bond_orders\n    result = subprocess.check_output(\n  File \"/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/subprocess.py\", line 421,
 in check_output\n    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,\n  File                                                                         
 \"/Users/xperrylinn/miniconda3/envs/bespoke-env/lib/python3.10/subprocess.py\", line 526, in run\n    raise CalledProcessError(retcode,                               
 process.args,\nsubprocess.CalledProcessError: Command '['antechamber', '-i', 'molecule.sdf', '-fi', 'sdf', '-o', 'sqm.in', '-fo', 'sqmcrt', '-pf', 'yes', '-c', 'mul',
 '-nc', '0.0 e']' returned non-zero exit status 1.\n"}                                                                                                                 

outputs have been saved to acetaminophen.json                                                                                                                          

worker: Warm shutdown (MainProcess)

worker: Warm shutdown (MainProcess)

worker: Warm shutdown (MainProcess)
xperrylinn commented 1 year ago

It's encouraging you are as confused as me, I was at a loss from just reading things. ( I thought briefly about something sneaking in through $AMBERHOME but the paths to antechamber and sqm go through the conda environment.) I've been running Ambertools via Rosetta for about a year now without failures this cryptic. My AmberTools build is the same (py310h35066de_3). The error is bubbling up from WBO assignment but not something that strikes me as a method call with strange arguments.

The only suggestion I have is making a fresh conda environment and running some AmberToolsToolkitWrapper commands more directly. From the information available it's probably a toolkit issue and not something broken here.

from openff.toolkit.topology import Molecule
from openff.toolkit.utils.ambertools_wrapper import AmberToolsToolkitWrapper
from openff.toolkit.utils.rdkit_wrapper import RDKitToolkitWrapper
from openff.toolkit.utils.toolkit_registry import ToolkitRegistry

molecule = Molecule.from_smiles(
    "CC(=O)NC1=CC=C(C=C1)O",
    toolkit_registry=ToolkitRegistry([RDKitToolkitWrapper()]),
)
molecule.generate_conformers(n_conformers=10)
molecule.assign_partial_charges(
    partial_charge_method="am1bcc",
    toolkit_registry=ToolkitRegistry([AmberToolsToolkitWrapper()]),
)
for conformer in molecule.conformers:
    molecule.assign_fractional_bond_orders(
        "am1-wiberg",
        use_conformers=[conformer],
        toolkit_registry=ToolkitRegistry([AmberToolsToolkitWrapper()]),
    )

This code snippet is producing the same behavior as the others that I have been running.

I'll try Josh's recommendation of installing a new copy of osx-64 Conda/Mamba (ie, NOT osx-arm64) and running it through Rosetta later today and let you know how it goes.

mattwthompson commented 1 year ago

You have an Intel mac so you shouldn't need to worry at all about Rosetta/ARM/Apple Silicon. As long as your Miniconda distribution uses osx-64 it shouldn't look at the osx-arm64 directories at all.

Something is definitely wrong somewhere, though, and I'm curious what happens with a fresh environment and/or Miniconda installation.

xperrylinn commented 1 year ago
Yoshanuikabundi commented 1 year ago

OK that is mystifying. If Matt's code causes the same exception then I think this is a Toolkit issue, so I'll transfer this issue there in a moment.

Your edits adding error reporting to the AmberTools wrapper are (I think) our best lead at the moment. Could you please run that again, with the following additions to the else block:

except subprocess.CalledProcessError as e:
    from pathlib import Path
    import shutil

    print("stdout:", e.stdout)
    print("stderr:", e.stderr)
    print("molecule_smiles:", molecule.to_smiles())
    print("temp_mol_smiles:", temp_mol.to_smiles())
    print("sdf:", Path("molecule.sdf").read_text())
    print("sqm.in:", Path("sqm.in").read_text())
    print("which antechamber:", shutil.which("antechamber"))
    raise e

Should be line 540-something in openff/toolkit/utils/ambertools_wrapper.py. That should let us figure out if the problem is in Antechamber or our input to it.

Could you also do a conda env export of the environment and send us the resulting yaml file? That'll let us reproduce the environment exactly.

Was I reading you right that you were getting different behavior when you created an sqm.in or molecule.sdf file in the working directory? That is very strange as the call to antechamber happens within a temporary directory, not the working directory. I'm not sure what to make of that.

j-wags commented 1 year ago

There's some discussion on the AMBER mailing list about issues building with OSX 13. I'll keep following that thread as it develops.

http://archive.ambermd.org/202302/0078.html

mattwthompson commented 1 year ago

I'm on 13.0.1 (22A400) with no issues. The conda packages are built on a much older version, though

j-wags commented 1 year ago

Ahh, ok. So scratch that idea.

xperrylinn commented 1 year ago

Your edits adding error reporting to the AmberTools wrapper are (I think) our best lead at the moment. Could you please run that again, with the following additions to the else block:

/Users/xperrylinn/miniconda3/envs/bespokefit-wrkshp/bin/wrapped_progs/antechamber: Fatal Error!
Cannot properly run "/Users/xperrylinn/miniconda3/envs/bespokefit-wrkshp/bin/sqm -O -i sqm.in -o sqm.out".
stdout: b'\nWelcome to antechamber 22.0: molecular input file processor.\n\nInfo: acdoctor mode is on: check and diagnose problems in the input file.\nInfo: The atom type is set to gaff; the options available to the -at flag are\n      gaff, gaff2, amber, bcc, and sybyl.\n\n-- Check Format for sdf File --\n   Status: pass\n-- Check Unusual Elements --\n   Status: pass\n-- Check Open Valences --\nWarning: This molecule has no hydrogens nor halogens.\n         It is quite possible that there are unfilled valences.\n-- Check Geometry --\n      for those bonded   \n      for those not bonded   \n   Status: pass\n-- Check Weird Bonds --\n   Status: pass\n-- Check Number of Units --\n   Status: pass\nacdoctor mode has completed checking the input file.\n\nInfo: Total number of electrons: -1; net charge: 1\nInfo: The number of electrons is odd (-1).\n      Please check the total charge (-nc flag) and spin multiplicity (-m flag).\n\nRunning: /Users/xperrylinn/miniconda3/envs/bespokefit-wrkshp/bin/sqm -O -i sqm.in -o sqm.out\n'
stderr: None
molecule_smiles: [H][c]1[c]([H])[c]([Cl])[c]([H])[c](-[c]2[c]([H])[c]([H])[c]([H])[c]([C@]3([C]([H])([H])[H])[C](=[O])[N]([C]([H])([H])[H])[C]([N]([H])[H])=[N+]3[H])[c]2[H])[c]1[H]
temp_mol_smiles: [H][c]1[c]([H])[c]([Cl])[c]([H])[c](-[c]2[c]([H])[c]([H])[c]([H])[c]([C@]3([C]([H])([H])[H])[C](=[O])[N]([C]([H])([H])[H])[C]([N]([H])[H])=[N+]3[H])[c]2[H])[c]1[H]
sdf: 
     RDKit          3D
 39 41  0  0  0  0  0  0  0  0999 V2000
   -2.3542   -1.0446    2.0769 O   0  0  0  0  0  0  0  0  0  0  0  0
    6.7952   -0.3181   -1.9806 Cl  0  0  0  0  0  0  0  0  0  0  0  0
   -2.6119   -0.4313    1.0245 C   0  0  0  0  0  0  0  0  0  0  0  0
   -3.6308    0.4340   -0.8432 C   0  0  0  0  0  0  0  0  0  0  0  0
    4.8572    1.3819    1.0821 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.5237   -2.3244   -1.0290 C   0  0  0  0  0  0  0  0  0  0  0  0
    5.8545    1.0350    0.2145 C   0  0  0  0  0  0  0  0  0  0  0  0
    3.5770    0.8864    0.9338 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.7938   -1.7751   -0.8421 C   0  0  0  0  0  0  0  0  0  0  0  0
    4.3043   -0.3154   -0.9720 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.5791   -1.5665   -0.6444 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.7983    0.2042    0.0788 C   0  0  0  0  0  0  0  0  0  0  0  0
    5.5700    0.1769   -0.8221 C   0  0  0  0  0  0  0  0  0  0  0  0
    3.2786    0.0143   -0.1159 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.9358   -0.5210   -0.2928 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.4656   -0.3205   -0.0975 C   0  0  0  0  0  0  0  0  0  0  0  0
   -4.6542    0.6898   -1.8169 N   0  0  0  0  0  0  0  0  0  0  0  0
   -3.8213   -0.4086    0.2871 N   0  0  0  0  0  0  0  0  0  0  0  0
   -2.4245    0.9095   -0.8414 N   0  0  0  0  0  4  0  0  0  0  0  0
   -5.0683   -1.1144    0.6012 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.3099    1.6554    1.1214 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.6642    0.4408    0.2930 C   0  0  1  0  0  0  0  0  0  0  0  0
    5.1062    2.0698    1.9048 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.4129   -3.3003   -1.4563 H   0  0  0  0  0  0  0  0  0  0  0  0
    6.8799    1.4213    0.3190 H   0  0  0  0  0  0  0  0  0  0  0  0
    2.8055    1.1659    1.6200 H   0  0  0  0  0  0  0  0  0  0  0  0
    2.6910   -2.3098   -1.1184 H   0  0  0  0  0  0  0  0  0  0  0  0
    4.0886   -0.9863   -1.7855 H   0  0  0  0  0  0  0  0  0  0  0  0
   -1.5721   -1.9795   -0.7833 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.9236    1.1906    0.5103 H   0  0  0  0  0  0  0  0  0  0  0  0
   -5.3413   -0.0431   -2.0596 H   0  0  0  0  0  0  0  0  0  0  0  0
   -4.7147    1.6088   -2.2851 H   0  0  0  0  0  0  0  0  0  0  0  0
   -2.0635    1.5488   -1.5737 H   0  0  0  0  0  0  0  0  0  0  0  0
   -5.5162   -1.5803   -0.2851 H   0  0  0  0  0  0  0  0  0  0  0  0
   -4.8100   -1.9532    1.3039 H   0  0  0  0  0  0  0  0  0  0  0  0
   -5.7590   -0.3966    1.0544 H   0  0  0  0  0  0  0  0  0  0  0  0
   -0.7994    1.3569    2.0413 H   0  0  0  0  0  0  0  0  0  0  0  0
   -0.7542    2.3498    0.4779 H   0  0  0  0  0  0  0  0  0  0  0  0
   -2.2822    2.1491    1.3772 H   0  0  0  0  0  0  0  0  0  0  0  0
  1  3  2  0
  2 13  1  0
  3 18  1  0
  3 22  1  0
  4 17  1  0
  4 18  1  0
  4 19  2  0
  5  7  2  0
  5  8  1  0
  5 23  1  0
  6  9  2  0
  6 11  1  0
  6 24  1  0
  7 13  1  0
  7 25  1  0
  8 14  2  0
  8 26  1  0
  9 15  1  0
  9 27  1  0
 10 13  2  0
 10 14  1  0
 10 28  1  0
 11 16  2  0
 11 29  1  0
 12 15  2  0
 12 16  1  0
 12 30  1  0
 14 15  1  0
 16 22  1  0
 17 31  1  0
 17 32  1  0
 18 20  1  0
 19 22  1  0
 19 33  1  0
 20 34  1  0
 20 35  1  0
 20 36  1  0
 22 21  1  1
 21 37  1  0
 21 38  1  0
 21 39  1  0
M  CHG  1  19   1
M  END
$$$$
sqm.in: Run semi-empirical minimization
 &qmmm
    qm_theory='AM1', grms_tol=0.0005,
 scfconv=1.d-10, ndiis_attempts=700,   qmcharge=1,
 /
which antechamber: /Users/xperrylinn/miniconda3/envs/bespokefit-wrkshp/bin/antechamber

Here's the result of conda env export: bespokefit-wrkshp.txt

Was I reading you right that you were getting different behavior when you created an sqm.in or molecule.sdf file in the working directory? That is very strange as the call to antechamber happens within a temporary directory, not the working directory. I'm not sure what to make of that.

I had wondered about the temporary folder idea because I wasn't seeing an sqm.in and molecule.sdf being created in my working directory. If these files are getting created in a completely different directory, I think I must have been miscorrelating the creation of those files from running the isolated command antechamber -i molecule.sdf -fi sdf -o sqm.in -fo sqmcrt -pf yes -c mul -nc 0.0 e with the fragmentation suddenly running successfully (and then continuously failings afterward). I don't know what to make of this either..

From the debugging output above, the Cannot properly run "/Users/xperrylinn/miniconda3/envs/bespokefit-wrkshp/bin/sqm -O -i sqm.in -o sqm.out" bit seems like a clue. 🤔

j-wags commented 1 year ago

Getting into this now. For what it's worth, the "-nc 0.0 e" stands out to me - To the best of my understanding, antechamber wants a single unitless integer like 0 for the -nc argument, so I could see 0.0 e possibly causing trouble here.

I wonder if this is involving something finnicky with our partial charge setter/getter being "sometimes integer, sometimes Quantity" that's causing this to happen. I'll report back once I've found anything!

j-wags commented 1 year ago

Well, the "1.0 e" thing is certainly unintended, but it works fine on my M1 OSX 12 dev machine and doesn't seem to be fatal.

I also booted up my backup computer, a 2017 intel macbook with OSX 12.3.1 and successfully ran Matt's example a few times with Toolkit 0.10.6. Then I upgraded it to OSX 13 and now I'm getting nearly the same error as @xperrylinn. That's.... crazy.

There's some particularly concerning stuff in @xperrylinn's most recent output - In particular:

I'm getting the "no hydrogens and halogens" myself as well, but not the positron situation.

So - I guess this is an update that you're not crazy. I'll report back when I find more.

xperrylinn commented 1 year ago

@j-wags, thank you for the update and the all of the effort you are putting into triaging! Glad to hear you've been able to reproduce some of the errors I ecnountered.

j-wags commented 1 year ago

@xperrylinn I was able to get it to work by downgrading AmberTools to version 21. Could you try that and let me know how it goes? It should be something like mamba install -c conda-forge ambertools=21.

I'm also following up with the package feedstock, will link that issue here shortly.

xperrylinn commented 1 year ago

Hi @j-wags, happy to report after setting up my environment and ran the quickstart command below it appears to be working. I ran it a couple of times to confirm it wasn't a fluke 😉. I'm also noticing I'm not getting the OS too many files error during the qc-generation step.

conda create -n bespokefit -y -c conda-forge mamba python=3.9
conda activate bespokefit 
mamba install -y -c conda-forge openff-bespokefit xtb-python ambertools=21
openff-bespoke executor run --smiles             "CC(=O)NC1=CC=C(C=C1)O" \
                            --workflow           "default"               \
                            --output             "acetaminophen.json"    \
                            --output-force-field "acetaminophen.offxml"  \
                            --n-qc-compute-workers 2                     \
                            --qc-compute-n-cores   1                     \
                            --default-qc-spec xtb gfn2xtb none
j-wags commented 1 year ago

@xperrylinn I just updated xcode on my macbook and that seemed to get AT22 working again. Could you let me know if that works for you?