Dear James, Thanks for sending along the information about how you did the pymol steps; I'm sure it will be useful to others. Tighter RDKit-PyMol integration is definitely a good thing.
Best Regards, -greg On Fri, Jul 2, 2010 at 8:09 PM, James Davidson <j.david...@vernalis.com> wrote: > I just wanted to quickly update the List on how I've got on with this, in > case it is of use / interest to others. I followed Greg's advice and did > the following: > > 1. Exported molfile from PyMOL > 2. Read into RDKit > 3. Read in an SDF of already-constructed molecules based on the core (could > have built the products in RDKit, but the SDF was already available!) > 4. Iterated over the objects in the supplier to do the > AllChem.ConstrainedEmbed as discussed, then load the results into PyMOL > > NOTE - Because the molecules weren't built in RDKit, I couldn't rely on the > atom numbering when read into PyMOL (maybe this can't be relied on > anyway?). So I ran mol.GetSubstructMatch(core) for each molecule to get the > aligned product atom IDs that matched the core. I then flagged these in > PyMOL with flag 3 [Fixed Atoms (no movement allowed)] (flag 2 - harmonically > constrained may be better..?) so that I could subsequently run the mengine > 'clean' command in PyMOL to tidy-up the UFF output without allowing the > template to move: > > from rdkit import Chem > core = Chem.MolFromMolFile(mol_filepath) > supplier = Chem.SDMolSupplier(sdf_filepath) > for n,mol in enumerate(supplier): > mol = Chem.AddHs(mol) > newMol = AllChem.ConstrainedEmbed(mol, core, True) > name = "mol"+str(n) > fix = ','.join([str(n) for n in mol.GetSubstructMatch(core)]) > v.ShowMol(newMol, name=name, showOnly=False) > selection = '('+name+' and (id '+fix+'))' > v.server.do('flag 3, '+selection+', set') > > > Kind regards > > James > ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss