Skip to content

SMILES without property info #3837

Answered by greglandrum
rajathsalegame asked this question in Q&A
Discussion options

You must be logged in to vote

I've commented on #3835 itself, but that's not a bug.

If you want to output a SMILES that doesn't include atom map numbers, you can just remove the atom map numbers from the molecule by setting them to zero:

>>> m = Chem.MolFromSmiles('[CH3:1][OH:2]')
>>> Chem.MolToSmiles(m)
'[CH3:1][OH:2]'
>>> for atom in m.GetAtoms():
...     atom.SetAtomMapNum(0)
... 
>>> Chem.MolToSmiles(m)
'CO'

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rajathsalegame
Comment options

Answer selected by greglandrum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants