Replies: 1 comment
-
Peering through the bottom of my gin and tonic, I think those are both
equivalent drawings of the same molecule. If in the first picture you drag
the left hand carbon (at the 9 o’clock position) down to about the 5
o’clock position and rotate, you get the bottom picture.
On Mon, 5 Jun 2023 at 14:20, fjvico ***@***.***> wrote:
The SMILES string C12C3C1C=2-3 renders as
[image: C12C3C1C=2-3]
<https://user-images.githubusercontent.com/14311181/243362389-bd1fd0bc-03b4-494a-a0b2-0f0aa1af054f.png>
but two canonical strings obtained from it (C12=C3C1C23 and
[C]12=[C]3-[CH]-1-[CH]-2-3), both renders to
[image: C12=C3C1C23]
<https://user-images.githubusercontent.com/14311181/243362580-3bc54b23-580b-4028-989d-7b1c7fbeff06.png>
which is a different molecule, as can be seen in the 3D representation:
C12C3C1C=2-3
[image: C12C3C1C=2-3_3D]
<https://user-images.githubusercontent.com/14311181/243364286-42c4cbe5-4bf3-4f41-b346-50a5421e586e.png>
C12=C3C1C23, [C]12=[C]3-[CH]-1-[CH]-2-3
[image: C 12= C 3- CH -1- CH -2-3_3D]
<https://user-images.githubusercontent.com/14311181/243364307-5f5c7a45-1830-466f-b676-a052d01bf17d.png>
This can be reproduced with this code (RDKit version: 2023.03.1):
#!/usr/bin/python3
from rdkit import Chemfrom rdkit.Chem import Draw
SMILEScode = ['C12C3C1C=2-3']
# get canonical SMILES codesmol = Chem.MolFromSmiles(SMILEScode[0])canonicalSMILEScode = Chem.rdmolfiles.MolToSmiles(mol, allHsExplicit=False, allBondsExplicit=False)SMILEScode.append(canonicalSMILEScode)canonicalSMILEScode = Chem.rdmolfiles.MolToSmiles(mol, allHsExplicit=True, allBondsExplicit=True)SMILEScode.append(canonicalSMILEScode)
for code in SMILEScode:
mol = Chem.MolFromSmiles(code)
with open(code + '.mol', 'w') as file:
file.write(Chem.MolToMolBlock(mol))
img = Draw.MolsToGridImage([mol], molsPerRow=1)
imagefilename = code + '.png'
print(imagefilename)
img = img.resize((100,100))
img.save(imagefilename)
Why does this happen? Canonical representations are equivalent to the
original one, and they should render the same molecule.
—
Reply to this email directly, view it on GitHub
<#6442>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGF2FRQAAPBKQI2542QP6LXJXMIXANCNFSM6AAAAAAY264NKA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
David Cosgrove
Freelance computational chemistry and chemoinformatics developer
http://cozchemix.co.uk
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The SMILES string
C12C3C1C=2-3
renders asbut two canonical strings obtained from it (
C12=C3C1C23
and[C]12=[C]3-[CH]-1-[CH]-2-3
), both renders towhich is a different molecule, as can be seen in the 3D representation:
C12C3C1C=2-3
C12=C3C1C23
,[C]12=[C]3-[CH]-1-[CH]-2-3
This can be reproduced with this code (RDKit version: 2023.03.1):
Why does this happen? Canonical representations are equivalent to the original one, and they should render the same molecule.
Beta Was this translation helpful? Give feedback.
All reactions