Dear Jan,

the reason why your restraint was seemingly not applied is that MMFFAddTorsionConstraint() expected a range such as (170, 190). I have just modified the code to make it more robust in this respect and I submitted a pull request to Greg. Meanwhile, you may get the results you expect using a (170, 190) degree range. Please find attached a slightly modified version of your python script; in particular, I added a call to SetDihedralDeg() before the constrained minimization, to avoid troubles to the minimizer in case the geometry generated by EmbedMultipleConfs() has dihedral values very far from the desired target value.

Thanks for your detailed report which allowed chasing down that weakness in my code!

Cheers,
Paolo

On 05/10/2014 04:28 PM, Jan Domanski wrote:
Hi there,

Attached is a crystal_ligand.mol2 for the ACE target from DUDE. I'd like to generate a number of conformers for this ligand. The trick is it has 2 amide bonds that I'd like to keep planar. As far as I can see neither MMFF nor UFF will keep those planar by default, at least not for this input file.

One way around it, is to find all the amide bonds by smarts matching. From that, find the hydrogen connected to N and add a DihedralConstraint on the 4 atoms before running the minimization.

That's what conformers.py is attempting to do (basing on one of the test scripts). However, I still get non-planar amide bonds and I'm really confused as to why. I can filter them out manually with GetDihedralDeg().

Thanks for all the help (I'm using up all the rdkit credits this weekend ;) )

- Jan


------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce


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


--
==========================================================
Paolo Tosco, Ph.D.
Department of Drug Science and Technology
Via Pietro Giuria, 9 - 10125 Torino (Italy)
Tel: +39 011 670 7680 | Mob: +39 348 5537206
Fax: +39 011 670 7687 | E-mail: paolo.to...@unito.it
http://open3dqsar.org | http://open3dalign.org
==========================================================

import sys
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem.rdMolTransforms import GetDihedralDeg, SetDihedralDeg
mol = Chem.MolFromMol2File("crystal_ligand.mol2", removeHs=False)
patt = Chem.MolFromSmarts("[OX1]=CN")
amides = mol.GetSubstructMatches(patt)

constraints = []
for amide in amides:

    amide = [mol.GetAtomWithIdx(idx) for idx in amide]
    for a in amide: print a.GetSymbol()
    carbon = [a for a in amide if  a.GetSymbol() == "C"][0]
    oxygen = [a for a in amide if  a.GetSymbol() == "O"][0]
    nitrogen = [a for a in amide if  a.GetSymbol() == "N"][0]
    # there may be a better way of finding the N-H hydrogen
    hydrogens = [ b.GetBeginAtom()  for b in nitrogen.GetBonds() if b.GetBeginAtom().GetSymbol() == "H"] + [ b.GetEndAtom()  for b in nitrogen.GetBonds() if b.GetEndAtom().GetSymbol() == "H"]
    assert(len(hydrogens)==1)
    hydrogen = hydrogens[0]    
    constraint = (hydrogen.GetIdx(), nitrogen.GetIdx(), carbon.GetIdx(), oxygen.GetIdx());
    print constraint
    constraints.append(constraint)

confIds = AllChem.EmbedMultipleConfs(mol, 200)
prop = AllChem.MMFFGetMoleculeProperties(mol)
for confId in confIds:
    conformer = mol.GetConformer(confId)
    ff = AllChem.MMFFGetMoleculeForceField(mol, prop, confId=confId)
    for c in constraints:
        SetDihedralDeg(conformer, c[0], c[1], c[2], c[3], 180)
        ff.MMFFAddTorsionConstraint(c[0], c[1], c[2], c[3], False, 170, 190, 1.0e5)
    if (ff.Minimize(maxIts=2000)):
      print 'confId {0:04d}: insufficient iterations'
    for c in constraints:
      sys.stdout.write(str(GetDihedralDeg(conformer, c[0], c[1], c[2], c[3])) + '\t')
    print
    Chem.MolToPDBFile(mol, "conformer_{0:04d}.pdb".format(confId), confId)
------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to