Re: [Rdkit-discuss] MolsToGridImage drawing multiple conformers of single molecule

2021-06-07 Thread Sunhwan Jo
How about this?

Draw.MolsToGridImage([Chem.MolFromMolBlock(Chem.MolToMolBlock(mol, confId=i)) 
for i in range(10)])


Sunhwan

> On Jun 4, 2021, at 6:55 PM, Lewis Martin  wrote:
> 
> Hi all,
> Is there a way to draw multiple conformers of a single molecule using 
> Draw.MolsToGridImage?
> 
> Here's a first attempt but, either all conformers are exactly the same or the 
> parent molecule falls back to conformer 0, since all molecules in the grid 
> appear the same:
> 
> ```
> from rdkit import Chem
> from rdkit.Chem import AllChem, Draw
> 
> #indomethacin
> mol = Chem.MolFromSmiles('Cc1c(c2cc(ccc2n1C(=O)c3ccc(cc3)Cl)OC)CC(=O)O') 
> mol = Chem.AddHs(mol)
> AllChem.EmbedMultipleConfs(mol, numConfs=10)
> mol = Chem.RemoveHs(mol)
> 
> #drawBonds(mol)
> Draw.MolsToGridImage([mol.GetConformer(i).GetOwningMol() for i in range(10)])
> ```
> 
> Perhaps a simpler question is, how do I access a single conformer from the 10 
> available in order to draw it?
> 
> Thanks!
> Lewis
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] MolsToGridImage drawing multiple conformers of single molecule

2021-06-07 Thread Lewis Martin
Hi all,
Is there a way to draw multiple conformers of a single molecule using
Draw.MolsToGridImage?

Here's a first attempt but, either all conformers are exactly the same or
the parent molecule falls back to conformer 0, since all molecules in the
grid appear the same:

```
from rdkit import Chem
from rdkit.Chem import AllChem, Draw

#indomethacin
mol = Chem.MolFromSmiles('Cc1c(c2cc(ccc2n1C(=O)c3ccc(cc3)Cl)OC)CC(=O)O')
mol = Chem.AddHs(mol)
AllChem.EmbedMultipleConfs(mol, numConfs=10)
mol = Chem.RemoveHs(mol)

#drawBonds(mol)
Draw.MolsToGridImage([mol.GetConformer(i).GetOwningMol() for i in
range(10)])
```

Perhaps a simpler question is, how do I access a single conformer from the
10 available in order to draw it?

Thanks!
Lewis
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss