[Rdkit-discuss] Interacting with molecules in PyMOL

2010-07-02 Thread James Davidson
Dear All,
 
I am trying to work out the best way to accomplish some tasks involving
RDKit, using PyMOL as an interface, and would appreciate some help.  I
would like to be able to start from a PDB file of a ligand-bound crystal
structure loaded in PyMOL and be able to 'virtually' build some
analogues - initially just simple substitutions - and visually inspect
the results.
 
(1)  So my first question is - having started PyMOL with the -R option,
is there an easy or recommended way of transferring molecules from PyMOL
to RDKit?  I can accomplish this by writing molfiles to a temporary
file, but wondered if I am creating work, if eg RDKit could
automatically create Mol objects from non-biopolymer atoms in PyMol(?).
ie it would be nice if:
 
from rdkit import Chem
from rdkit.Chem import PyMol
v = PyMol.MolViewer()
 
# Invented function to create an RDKit mol object
mol = v.GetAtomsAsMol(selection)
 
(2)  Once the ligand is converted to an RDKit mol object (by whatever
means) I want to enumrate some libraries of virtual products - eg
choosing an atom in PyMol as the attachment point, then running a set of
reactions to get products with a set of substituents added.  In
principle I think this is quite straightforward; however, what I am
struggling with is a mechanism to 'freeze' the 3D coordintes of the
original ligand atoms, but still be able to use RDKit to generate
sensible 3D positions for the newly added atoms so that the products can
be passed back to PyMOL and minimised in situ (if required) using
'mengine.exe'.  Am I looking at this the wrong way, and should I
actually try aligning the virtual products back on the starting ligand
conformation?
 
(3)  Apologies that this last point is maybe a bit off-topic, but I
wondered if anyone has an opinion as to whether MMTK is the way to go
for 'simple' minimisations of modified ligands bound to proteins? (I
don't have any real experience with MMTK...
 
Kind regards
 
James

__
PLEASE READ: This email is confidential and may be privileged. It is intended 
for the named addressee(s) only and access to it by anyone else is 
unauthorised. If you are not an addressee, any disclosure or copying of the 
contents of this email or any action taken (or not taken) in reliance on it is 
unauthorised and may be unlawful. If you have received this email in error, 
please notify the sender or postmas...@vernalis.com. Email is not a secure 
method of communication and the Company cannot accept responsibility for the 
accuracy or completeness of this message or any attachment(s). Please check 
this email for virus infection for which the Company accepts no responsibility. 
If verification of this email is sought then please request a hard copy. Unless 
otherwise stated, any views or opinions presented are solely those of the 
author and do not represent those of the Company.

The Vernalis Group of Companies
Oakdene Court
613 Reading Road
Winnersh, Berkshire
RG41 5UA.
Tel: +44 118 977 3133

To access trading company registration and address details, please go to the 
Vernalis website at www.vernalis.com and click on the Company address and 
registration details link at the bottom of the page..
__--
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


Re: [Rdkit-discuss] Interacting with molecules in PyMOL

2010-07-02 Thread James Davidson
Dear Greg,

Thanks for your very rapid response - 'AllChem.ConstrainedEmbed' was
just what I was looking for!


Kind regards

James

__
PLEASE READ: This email is confidential and may be privileged. It is intended 
for the named addressee(s) only and access to it by anyone else is 
unauthorised. If you are not an addressee, any disclosure or copying of the 
contents of this email or any action taken (or not taken) in reliance on it is 
unauthorised and may be unlawful. If you have received this email in error, 
please notify the sender or postmas...@vernalis.com. Email is not a secure 
method of communication and the Company cannot accept responsibility for the 
accuracy or completeness of this message or any attachment(s). Please check 
this email for virus infection for which the Company accepts no responsibility. 
If verification of this email is sought then please request a hard copy. Unless 
otherwise stated, any views or opinions presented are solely those of the 
author and do not represent those of the Company.

The Vernalis Group of Companies
Oakdene Court
613 Reading Road
Winnersh, Berkshire
RG41 5UA.
Tel: +44 118 977 3133

To access trading company registration and address details, please go to the 
Vernalis website at www.vernalis.com and click on the Company address and 
registration details link at the bottom of the page..
__

--
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


Re: [Rdkit-discuss] Interacting with molecules in PyMOL

2010-07-02 Thread James Davidson
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

__
PLEASE READ: This email is confidential and may be privileged. It is intended 
for the named addressee(s) only and access to it by anyone else is 
unauthorised. If you are not an addressee, any disclosure or copying of the 
contents of this email or any action taken (or not taken) in reliance on it is 
unauthorised and may be unlawful. If you have received this email in error, 
please notify the sender or postmas...@vernalis.com. Email is not a secure 
method of communication and the Company cannot accept responsibility for the 
accuracy or completeness of this message or any attachment(s). Please check 
this email for virus infection for which the Company accepts no responsibility. 
If verification of this email is sought then please request a hard copy. Unless 
otherwise stated, any views or opinions presented are solely those of the 
author and do not represent those of the Company.

The Vernalis Group of Companies
Oakdene Court
613 Reading Road
Winnersh, Berkshire
RG41 5UA.
Tel: +44 118 977 3133

To access trading company registration and address details, please go to the 
Vernalis website at www.vernalis.com and click on the Company address and 
registration details link at the bottom of the page..
__--
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


Re: [Rdkit-discuss] Interacting with molecules in PyMOL

2010-07-02 Thread Greg Landrum
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