You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to align different sets of molecules with a common core with the core structure always drawn in the same orientation. I'm doing this by using a template for the core specified as a mol file aligning a rdkit mol generated from a SMARTS string with attachment points specified as *, and then aligning all the target molecules to that rdkit mol (See the code below).
The issue I seem to be running into is that when I turn on coordgen I get roughly the same layout of the core, but atoms around the core have switched positions. I'd prefer to use coordgen as it does do the layout better for the attached groups, and also standardizes bond lengths (my mol file template seems to have shorter bonds than are the default in RDKit) I can fix the bond lengths, but as my molecules get bogger, coordGen does a better job of laying out the attached groups
In the example below, the template specifies the double bond to the sulfur as up, the Florine down, the ether to the right, and any unspecified group to the left. Without Coordgen turned on it correctly lays out SMILES: CC(C)OP(=S)(C)F, with coordgen turned on it still orients the atoms around the P correctly (e.g. it's not tilted as if I just generated the mol directly from the SMILES), but it switches the order, or layout of the atoms around the P.
Chem.rdDepictor.SetPreferCoordGen(True) #Template layout with coordGen doesn't work ... the P arrangement gets messed up
orient = Chem.MolFromMolFile('Template_test.mol', sanitize=False)
template = Chem.MolFromSmarts('FP(=S)(O[*])[*]') #Note this should match the template with [*] connections as R groups
AllChem.GenerateDepictionMatching2DStructure(template, orient)
m=Chem.inchi.MolFromInchi('InChI=1/C7H16FOPS/c1-6(7(2,3)4)9-10(5,8)11/h6H,1-5H3')
AllChem.GenerateDepictionMatching2DStructure(m,template)
m
This is what I get with coordgen turned off, correct core, but additional structure isn't the best (although not bad for this simple example ... much worse for a lot of the more complicated molecules)
And this is what I get when turning coordgen on, core gets messed up, but side chain looks better:
For reference this is what I get going directly from an InChI:
So coordgen seems to be partially obeying the template in terms of aligning the atoms attached to P directly up and down and side by side.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to align different sets of molecules with a common core with the core structure always drawn in the same orientation. I'm doing this by using a template for the core specified as a mol file aligning a rdkit mol generated from a SMARTS string with attachment points specified as *, and then aligning all the target molecules to that rdkit mol (See the code below).
The issue I seem to be running into is that when I turn on coordgen I get roughly the same layout of the core, but atoms around the core have switched positions. I'd prefer to use coordgen as it does do the layout better for the attached groups, and also standardizes bond lengths (my mol file template seems to have shorter bonds than are the default in RDKit) I can fix the bond lengths, but as my molecules get bogger, coordGen does a better job of laying out the attached groups
In the example below, the template specifies the double bond to the sulfur as up, the Florine down, the ether to the right, and any unspecified group to the left. Without Coordgen turned on it correctly lays out SMILES: CC(C)OP(=S)(C)F, with coordgen turned on it still orients the atoms around the P correctly (e.g. it's not tilted as if I just generated the mol directly from the SMILES), but it switches the order, or layout of the atoms around the P.
Example Code:
Template_test.mol:
Python Code:
This is what I get with coordgen turned off, correct core, but additional structure isn't the best (although not bad for this simple example ... much worse for a lot of the more complicated molecules)



And this is what I get when turning coordgen on, core gets messed up, but side chain looks better:
For reference this is what I get going directly from an InChI:
So coordgen seems to be partially obeying the template in terms of aligning the atoms attached to P directly up and down and side by side.
Beta Was this translation helpful? Give feedback.
All reactions