Closed raimis closed 2 years ago
Hi @raimis , please use Molecule.from_mapped_smiles()
which retains the atom mapping.
mol = Molecule.from_mapped_smiles(smiles, allow_undefined_stereo=True)
@pavankum thanks! I haven't noticed that in the documentation.
Thank you for the feedback, we will make sure to update the documentation.
The SMILES of the PubChem dataset are generated with OpenFF-Toolkit (https://github.com/openmm/spice-dataset/blob/main/pubchem/createPubchem.py). So,
Molecule
from OpenFF-Toolkit should be able read them correctly, but this isn't a case.Get a SMILES:
Parse the SMILES and print elements:
Despite the SMILES contains the explicit hydrogen and atom indices, the order of atom doesn't match, e.g. the 5th atom in the SMILE is
C
, but in the molecule it isH
.