Skip to content
New issue

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

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

Already on GitHub? # to your account

Molecule.from_pdb_with_smiles() warns about the pdb having unspecified stereochemistry #1000

Closed
Yoshanuikabundi opened this issue Jun 29, 2021 · 3 comments · Fixed by #1003
Closed

Comments

@Yoshanuikabundi
Copy link
Collaborator

Describe the bug

Molecule.from_pdb_and_smiles gives a spurious warning about the PDB file having unspecified stereochemistry. This is spurious because the whole purpose of the method is to work around this limitation of the PDB format. I'm worried that the warning will be confusing to users.

To Reproduce

from openff.toolkit.topology import Molecule
smiles = "C[C@H]([NH3+])C(=O)[O-]"
path = "mol.pdb"
Molecule.from_smiles(smiles).to_file(path, "pdb")
mol = Molecule.from_pdb_and_smiles(
    path, 
    smiles, 
    allow_undefined_stereo=False
)

This succeeds, but gives a spurious warning.

Output

I've added line breaks for clarity

Warning (not error because allow_undefined_stereo=True): 
    Unable to make OFFMol from RDMol: 
        RDMol has unspecified stereochemistry. 
Undefined chiral centers are:
 - Atom C (index 1)

This is a very confusing warning, as the from_pdb_and_smiles method has the allow_undefined_stereo argument. I'm worried that users will see this error and think that they've done something wrong or that the toolkit has a bug and is unable to assign stereochemistry to the PDB from the SMILES, when in fact this is raised in the course of reading the PDB, before the SMILES is processed.

Computing environment (please complete the following information):

  • Manjaro Linux
conda list
# packages in environment at /home/joshm/conda/envs/offdev:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
abseil-cpp                20210324.1           h9c3ff4c_0    conda-forge
alabaster                 0.7.12                     py_0    conda-forge
amberlite                 16.0                     pypi_0    pypi
ambertools                21.0             py37h13c71af_0    conda-forge
amberutils                21.0                     pypi_0    pypi
anyio                     3.2.0            py37h89c1867_0    conda-forge
argon2-cffi               20.1.0           py37h5e8e339_2    conda-forge
arpack                    3.7.0                hdefa2d7_2    conda-forge
arrow-cpp                 4.0.1           py37h6a8ff91_1_cpu    conda-forge
astunparse                1.6.3              pyhd8ed1ab_0    conda-forge
async_generator           1.10                       py_0    conda-forge
attrs                     20.3.0             pyhd3deb0d_0    conda-forge
autodoc-pydantic          1.3.0                    pypi_0    pypi
autodocsumm               0.2.4              pyhd8ed1ab_0    conda-forge
aws-c-cal                 0.5.9                h3622835_0    conda-forge
aws-c-common              0.5.11               h7f98852_0    conda-forge
aws-c-event-stream        0.2.7                h8fbaa10_8    conda-forge
aws-c-io                  0.10.1               h8007ed0_0    conda-forge
aws-checksums             0.1.11               hc0e0e8b_6    conda-forge
aws-sdk-cpp               1.8.186              h9ad65fb_2    conda-forge
babel                     2.9.1              pyh44b312d_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.9.3              pyhb0f4dca_0    conda-forge
bleach                    3.3.0              pyh44b312d_0    conda-forge
blosc                     1.21.0               h9c3ff4c_0    conda-forge
boost                     1.74.0           py37h6dcda5c_3    conda-forge
boost-cpp                 1.74.0               h312852a_4    conda-forge
brotli                    1.0.9                h9c3ff4c_4    conda-forge
brotlipy                  0.7.0           py37h5e8e339_1001    conda-forge
bson                      0.5.9                      py_0    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.17.1               h7f98852_1    conda-forge
ca-certificates           2021.5.30            ha878542_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cairo                     1.16.0            h6cf1ce9_1008    conda-forge
certifi                   2021.5.30        py37h89c1867_0    conda-forge
cffi                      1.14.5           py37hc58025e_0    conda-forge
chardet                   4.0.0            py37h89c1867_1    conda-forge
click                     8.0.1            py37h89c1867_0    conda-forge
click-completion          0.5.2            py37h89c1867_2    conda-forge
click-log                 0.3.2              pyh9f0ad1d_0    conda-forge
cloud-sptheme             1.10.1.post20200504175005          pypi_0    pypi
codecov                   2.1.11             pyhd3deb0d_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
commonmark                0.9.1                      py_0    conda-forge
coverage                  5.5              py37h5e8e339_0    conda-forge
cryptography              3.4.7            py37h5d9358c_0    conda-forge
css-html-js-minify        2.5.5            py37h89c1867_3    conda-forge
cudatoolkit               11.2.2               he111cf0_8    conda-forge
curl                      7.77.0               hea6ffbf_0    conda-forge
cycler                    0.10.0                     py_2    conda-forge
cython                    0.29.23          py37hcd2ae1e_0    conda-forge
dataclasses               0.8                pyhc8e2a94_1    conda-forge
decorator                 4.4.2                      py_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
docstring-parser          0.7.3                    pypi_0    pypi
docutils                  0.17.1           py37h89c1867_0    conda-forge
entrypoints               0.3             pyhd8ed1ab_1003    conda-forge
fftw                      3.3.9           nompi_h74d3f13_101    conda-forge
fontconfig                2.13.1            hba837de_1005    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
future                    0.18.2           py37h89c1867_3    conda-forge
gettext                   0.19.8.1          h0b5b191_1005    conda-forge
gflags                    2.2.2             he1b5a44_1004    conda-forge
gitdb                     4.0.7              pyhd8ed1ab_0    conda-forge
gitpython                 3.1.18             pyhd8ed1ab_0    conda-forge
glog                      0.5.0                h48cff8f_0    conda-forge
greenlet                  1.1.0            py37hcd2ae1e_0    conda-forge
gromacs                   2021.1          nompi_hcc3dda7_101    bioconda
grpc-cpp                  1.38.0               h2a12866_1    conda-forge
h5py                      3.2.1           nompi_py37ha3df211_100    conda-forge
hdf4                      4.2.15               h10796ff_3    conda-forge
hdf5                      1.10.6          nompi_h6a2412b_1114    conda-forge
icu                       68.1                 h58526e2_0    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
imagesize                 1.2.0                      py_0    conda-forge
importlib-metadata        4.5.0            py37h89c1867_0    conda-forge
importlib_metadata        4.5.0                hd8ed1ab_0    conda-forge
importlib_resources       5.1.4              pyhd8ed1ab_0    conda-forge
iniconfig                 1.1.1              pyh9f0ad1d_0    conda-forge
ipykernel                 5.5.5            py37h085eea5_0    conda-forge
ipython                   7.24.1           py37h085eea5_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.6.3              pyhd3deb0d_0    conda-forge
jbig                      2.1               h7f98852_2003    conda-forge
jedi                      0.18.0           py37h89c1867_2    conda-forge
jinja2                    2.11.3             pyh44b312d_0    conda-forge
joblib                    1.0.1              pyhd8ed1ab_0    conda-forge
jpeg                      9d                   h36c2ea0_0    conda-forge
jsonschema                3.2.0              pyhd8ed1ab_3    conda-forge
jupyter-cache             0.4.2              pyhd8ed1ab_0    conda-forge
jupyter-server-mathjax    0.2.3              pyhd8ed1ab_0    conda-forge
jupyter-sphinx            0.3.2                      py_0    conda-forge
jupyter_client            6.1.12             pyhd8ed1ab_0    conda-forge
jupyter_core              4.7.1            py37h89c1867_0    conda-forge
jupyter_server            1.8.0              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
jupyterlab_widgets        1.0.0              pyhd8ed1ab_1    conda-forge
kiwisolver                1.3.1            py37h2527ec5_1    conda-forge
krb5                      1.19.1               hcc1bbae_0    conda-forge
latexcodec                2.0.1              pyh9f0ad1d_0    conda-forge
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.35.1               hea4e1c9_2    conda-forge
lerc                      2.2.1                h9c3ff4c_0    conda-forge
libblas                   3.9.0                9_openblas    conda-forge
libcblas                  3.9.0                9_openblas    conda-forge
libcurl                   7.77.0               h2574ce0_0    conda-forge
libdeflate                1.7                  h7f98852_5    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libevent                  2.1.10               hcdb4288_3    conda-forge
libffi                    3.3                  h58526e2_2    conda-forge
libgcc-ng                 9.3.0               h2828fa1_19    conda-forge
libgfortran-ng            9.3.0               hff62375_19    conda-forge
libgfortran5              9.3.0               hff62375_19    conda-forge
libglib                   2.68.2               h3e27bee_2    conda-forge
libgomp                   9.3.0               h2828fa1_19    conda-forge
libhwloc                  2.4.1                h6746aa3_0    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
liblapack                 3.9.0                9_openblas    conda-forge
libnetcdf                 4.8.0           nompi_hcd642e3_103    conda-forge
libnghttp2                1.43.0               h812cca2_0    conda-forge
libopenblas               0.3.15          pthreads_h8fe5266_1    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libprotobuf               3.16.0               h780b84a_0    conda-forge
libsass                   0.20.1           py37hcd2ae1e_2    conda-forge
libsodium                 1.0.18               h36c2ea0_1    conda-forge
libssh2                   1.9.0                ha56f1ee_6    conda-forge
libstdcxx-ng              9.3.0               h6de172a_19    conda-forge
libthrift                 0.14.1               he6d91bd_1    conda-forge
libtiff                   4.3.0                hf544144_1    conda-forge
libutf8proc               2.6.1                h7f98852_0    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libwebp-base              1.2.0                h7f98852_2    conda-forge
libxcb                    1.13              h7f98852_1003    conda-forge
libxml2                   2.9.12               h72842e0_0    conda-forge
libxslt                   1.1.33               h15afd5d_2    conda-forge
libzip                    1.7.3                h4de3113_0    conda-forge
livereload                2.6.3              pyh9f0ad1d_0    conda-forge
lunr                      0.5.8              pyhd8ed1ab_2    conda-forge
lxml                      4.6.3            py37h77fd288_0    conda-forge
lz4-c                     1.9.3                h9c3ff4c_0    conda-forge
lzo                       2.10              h516909a_1000    conda-forge
markdown                  3.3.4              pyhd8ed1ab_0    conda-forge
markdown-it-py            0.6.2              pyhd8ed1ab_0    conda-forge
markupsafe                2.0.1            py37h5e8e339_0    conda-forge
matplotlib-base           3.4.2            py37hdd32ed1_0    conda-forge
matplotlib-inline         0.1.2              pyhd8ed1ab_2    conda-forge
mdit-py-plugins           0.2.6              pyhd8ed1ab_0    conda-forge
mdtraj                    1.9.5            py37hd0d7e5a_1    conda-forge
mistune                   0.8.4           py37h5e8e339_1003    conda-forge
mkapi                     1.0.14             pyhd8ed1ab_0    conda-forge
mkdocs                    1.1.2                      py_0    conda-forge
mkdocs-autorefs           0.2.1              pyhd8ed1ab_0    conda-forge
mkdocs-material           7.1.7              pyhd8ed1ab_0    conda-forge
mkdocs-material-extensions 1.0.1                      py_0    conda-forge
mkdocstrings              0.15.1             pyhd8ed1ab_0    conda-forge
mmpbsa-py                 16.0                     pypi_0    pypi
mock                      4.0.3            py37h89c1867_1    conda-forge
more-itertools            8.8.0              pyhd8ed1ab_0    conda-forge
msgpack-python            1.0.2            py37h2527ec5_1    conda-forge
myst-nb                   0.12.3             pyhd8ed1ab_0    conda-forge
myst-parser               0.13.7             pyhd8ed1ab_0    conda-forge
nbclient                  0.5.3              pyhd8ed1ab_0    conda-forge
nbconvert                 5.6.1            py37hc8dfbb8_1    conda-forge
nbdime                    3.1.0              pyhd8ed1ab_0    conda-forge
nbformat                  5.1.3              pyhd8ed1ab_0    conda-forge
nbsphinx                  0.8.5              pyhd8ed1ab_1    conda-forge
nbsphinx-link             1.3.0              pyh9f0ad1d_0    conda-forge
nbval                     0.9.6              pyh9f0ad1d_0    conda-forge
ncurses                   6.2                  h58526e2_4    conda-forge
nest-asyncio              1.5.1              pyhd8ed1ab_0    conda-forge
netcdf-fortran            4.5.3           nompi_hf3f1587_104    conda-forge
networkx                  2.5.1              pyhd8ed1ab_0    conda-forge
nglview                   3.0.1              pyh59e0f4d_0    conda-forge
nltk                      3.6.2              pyhd8ed1ab_0    conda-forge
notebook                  6.4.0              pyha770c72_0    conda-forge
numexpr                   2.7.3            py37hdc94413_0    conda-forge
numpy                     1.20.2           py37h038b26d_0    conda-forge
numpydoc                  1.1.0                      py_1    conda-forge
ocl-icd                   2.3.0                h7f98852_0    conda-forge
ocl-icd-system            1.0.0                         1    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openeye-toolkits          2020.2.2                 py37_0    openeye
openff-evaluator          0.3.4+0.g6e6f0a4.dirty           dev_0    
openff-forcefields        1.3.0              pyh44b312d_0    conda-forge
openff-sphinx-theme       0.0.32+57.gdf5714d.dirty           dev_0    
openff-toolkit            0.9.2+37.g7b6bfee4.dirty           dev_0    
openjpeg                  2.4.0                hb52868f_1    conda-forge
openmm                    7.5.1            py37h96c4ddf_0    conda-forge
openmmforcefields         0.9.0              pyhd8ed1ab_0    conda-forge
openssl                   1.1.1k               h7f98852_0    conda-forge
orc                       1.6.8                h58a87f1_0    conda-forge
packaging                 20.9               pyh44b312d_0    conda-forge
packmol                   20.010               h86c2bf4_0    conda-forge
packmol-memgen            1.1.0rc0                 pypi_0    pypi
pandas                    1.2.4            py37h219a48f_0    conda-forge
pandoc                    2.14.0.1             h7f98852_0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
parmed                    3.4.1            py37hcd2ae1e_0    conda-forge
parquet-cpp               1.5.1                         2    conda-forge
parso                     0.8.2              pyhd8ed1ab_0    conda-forge
pcre                      8.44                 he1b5a44_0    conda-forge
pdb4amber                 20.1                     pypi_0    pypi
perl                      5.32.1          0_h7f98852_perl5    conda-forge
pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    8.2.0            py37h4600e1f_1    conda-forge
pint                      0.17               pyhd8ed1ab_0    conda-forge
pip                       21.1.1             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h36c2ea0_0    conda-forge
plotly                    4.14.3             pyh44b312d_0    conda-forge
pluggy                    0.13.1           py37h89c1867_4    conda-forge
prometheus_client         0.11.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.18             pyha770c72_0    conda-forge
psutil                    5.8.0            py37h5e8e339_1    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
py                        1.10.0             pyhd3deb0d_0    conda-forge
py-cpuinfo                8.0.0              pyhd8ed1ab_0    conda-forge
pyarrow                   4.0.1           py37he2832ee_1_cpu    conda-forge
pybtex                    0.24.0           py37h89c1867_0    conda-forge
pybtex-docutils           1.0.0            py37h89c1867_0    conda-forge
pycairo                   1.20.1           py37hfff247e_0    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pydantic                  1.8.2            py37h5e8e339_0    conda-forge
pygments                  2.9.0              pyhd8ed1ab_0    conda-forge
pymdown-extensions        8.2                pyhd8ed1ab_0    conda-forge
pyopenssl                 20.0.1             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyrsistent                0.17.3           py37h5e8e339_2    conda-forge
pysocks                   1.7.1            py37h89c1867_3    conda-forge
pytables                  3.6.1            py37h0c4f3e0_3    conda-forge
pytest                    6.2.4            py37h89c1867_0    conda-forge
pytest-cov                2.12.0             pyhd8ed1ab_0    conda-forge
python                    3.7.10          hffdb5ce_100_cpython    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python-slugify            5.0.2              pyhd8ed1ab_0    conda-forge
python_abi                3.7                     1_cp37m    conda-forge
pytkdocs                  0.11.1           py37h89c1867_0    conda-forge
pytraj                    2.0.6                    pypi_0    pypi
pytz                      2021.1             pyhd8ed1ab_0    conda-forge
pyyaml                    5.4.1            py37h5e8e339_0    conda-forge
pyzmq                     22.1.0           py37h336d617_0    conda-forge
qcelemental               0.19.0             pyhd8ed1ab_0    conda-forge
qcengine                  0.18.0             pyhd8ed1ab_0    conda-forge
qcportal                  0.14.0                     py_1    conda-forge
rdkit                     2021.03.2        py37haf5a968_0    conda-forge
re2                       2021.06.01           h9c3ff4c_0    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
recommonmark              0.7.1              pyhd8ed1ab_0    conda-forge
regex                     2021.4.4         py37h5e8e339_0    conda-forge
reportlab                 3.5.67           py37h69800bb_0    conda-forge
requests                  2.25.1             pyhd3deb0d_0    conda-forge
retrying                  1.3.3                      py_2    conda-forge
s2n                       1.0.9                h9b69904_0    conda-forge
sander                    16.0                     pypi_0    pypi
scipy                     1.6.3            py37h29e03ee_0    conda-forge
send2trash                1.5.0                      py_0    conda-forge
setuptools                49.6.0           py37h89c1867_3    conda-forge
shellingham               1.4.0              pyh44b312d_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
slugify                   0.0.1                      py_2    conda-forge
smirnoff99frosst          1.1.0              pyh44b312d_0    conda-forge
smmap                     3.0.5              pyh44b312d_0    conda-forge
snappy                    1.1.8                he1b5a44_3    conda-forge
sniffio                   1.2.0            py37h89c1867_1    conda-forge
snowballstemmer           2.1.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.0.1                      py_1    conda-forge
sphinx                    3.5.3              pyhd8ed1ab_0    conda-forge
sphinx-autobuild          2021.3.14          pyhd8ed1ab_0    conda-forge
sphinx-press-theme        0.6.1                    pypi_0    pypi
sphinx-togglebutton       0.2.3              pyhd3deb0d_0    conda-forge
sphinx_bootstrap_theme    0.8.0                      py_0    conda-forge
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
sphinxcontrib-bibtex      2.3.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
sphinxcontrib-htmlhelp    2.0.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.5              pyhd8ed1ab_0    conda-forge
sqlalchemy                1.4.17           py37h5e8e339_0    conda-forge
sqlite                    3.35.5               h74cdb3f_0    conda-forge
terminado                 0.10.0           py37h89c1867_0    conda-forge
testpath                  0.3.1                    py37_1    conda-forge
text-unidecode            1.3                        py_0    conda-forge
tinydb                    4.4.0              pyh44b312d_0    conda-forge
tk                        8.6.10               h21135ba_1    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tornado                   6.1              py37h5e8e339_1    conda-forge
tqdm                      4.61.0             pyhd8ed1ab_0    conda-forge
traitlets                 5.0.5                      py_0    conda-forge
typing-extensions         3.10.0.0             hd8ed1ab_0    conda-forge
typing_extensions         3.10.0.0           pyha770c72_0    conda-forge
unidecode                 1.2.0              pyhd8ed1ab_0    conda-forge
urllib3                   1.26.5             pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
webencodings              0.5.1                      py_1    conda-forge
websocket-client          0.58.0           py37h06a4308_4  
wheel                     0.36.2             pyhd3deb0d_0    conda-forge
widgetsnbextension        3.5.1            py37h89c1867_4    conda-forge
xmltodict                 0.12.0                     py_0    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.0.10               h7f98852_0    conda-forge
xorg-libsm                1.2.3             hd9c2040_1000    conda-forge
xorg-libx11               1.7.2                h7f98852_0    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h7f98852_1    conda-forge
xorg-libxrender           0.9.10            h7f98852_1003    conda-forge
xorg-libxt                1.2.1                h7f98852_2    conda-forge
xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
xorg-xextproto            7.3.0             h7f98852_1002    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
yaml                      0.2.5                h516909a_0    conda-forge
zeromq                    4.3.4                h9c3ff4c_0    conda-forge
zipp                      3.4.1              pyhd8ed1ab_0    conda-forge
zlib                      1.2.11            h516909a_1010    conda-forge
zstd                      1.5.0                ha95c52a_0    conda-forge

Additional context

The offending call to from_rdkit is made here:

https://github.com/openforcefield/openff-toolkit/blob/cb46142b84690103b60dbf2de12cd65bcd3d74ea/openff/toolkit/utils/toolkits.py#L2910-2915

@Yoshanuikabundi
Copy link
Collaborator Author

Woo! Issue 1000!

@Yoshanuikabundi
Copy link
Collaborator Author

This seems to not happen when the PDB coordinates are not all zero; the following code provides no warning:

from openff.toolkit.topology import Molecule
smiles = "C[C@H]([NH3+])C(=O)[O-]"
path = "mol.pdb"
from_smiles = Molecule.from_smiles(smiles)
from_smiles.generate_conformers()
from_smiles.to_file(path, "pdb")
mol = Molecule.from_pdb_and_smiles(
    path, 
    smiles, 
    allow_undefined_stereo=False
)

Perhaps because RdKit is inferring the stereochemistry from the coordinates?

@j-wags
Copy link
Member

j-wags commented Jul 1, 2021

Oh, this problem isn't what I thought it was. This function is really well-written and is behaving safely (the resulting molecule DOES get its stereochemistry from the SMILES, and NOT from the PDB), the warning just needs to be squelched.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants