Dear community,

I am having problems using the constrained embed function. I want to generate 
3D coordinates for structural variants of a macrocycle, whereas the cycle 
backbone itself is stable and therefore my template. I provide the stable 
backbone as an .sdf and the structural variants as SMILES to the function. I 
have different errors, depending on the particular structure. 
On the one hand I observe a Value Error:


ValueError                                Traceback (most recent call last)
<ipython-input-23-69147410d36f> in <module>()
----> 1 out = AllChem.ConstrainedEmbed(mc, bb, useTethers=True, randomseed=1, 
getForceField=GetFF, useRandomCoords=True)

C:\ProgramData\Anaconda3\lib\site-packages\rdkit\Chem\AllChem.py in 
ConstrainedEmbed(mol, core, useTethers, coreConfId, randomseed, getForceField, 
**kwargs)
    283   ci = EmbedMolecule(mol, coordMap=coordMap, randomSeed=randomseed, 
**kwargs)
    284   if ci < 0:
--> 285     raise ValueError('Could not embed molecule.')
    286 
    287   algMap = [(j, i) for i, j in enumerate(match)]

ValueError: Could not embed molecule.


However, based on an old discussion entry with an apparent similar problem 
(https://sourceforge.net/p/rdkit/mailman/message/32082674/) I tried the very 
same preliminary solution (setting ignoreSmoothingFailures=True) which works 
fine. The post is from 2014, therefore I wonder if there is a better solution 
by now?

On the other hand, while applying the fix above, i observe a different error 
with specific compounds of my set of variants:


AttributeError                            Traceback (most recent call last)
<ipython-input-59-c91b6839ef04> in <module>()
----> 1 out = AllChem.ConstrainedEmbed(mc, bb, useTethers=True, randomseed=-1, 
getForceField=GetFF,ignoreSmoothingFailures=True, useRandomCoords=True)

C:\ProgramData\Anaconda3\lib\site-packages\rdkit\Chem\AllChem.py in 
ConstrainedEmbed(mol, core, useTethers, coreConfId, randomseed, getForceField, 
**kwargs)
    310     for i in range(core.GetNumAtoms()):
    311       p = conf.GetAtomPosition(i)
--> 312       pIdx = ff.AddExtraPoint(p.x, p.y, p.z, fixed=True) - 1
    313       ff.AddDistanceConstraint(pIdx, match[i], 0, 0, 100.)
    314     ff.Initialize()

AttributeError: 'NoneType' object has no attribute 'AddExtraPoint'


What differs the compounds, which show this error, from the rest, is a selenium 
linked phenylgroup. In fact, replacing the selenium by a carbon fixes this 
error. Interestingly, the function still outputs a structure, which is however 
chemically wrong (non-planar rings). Not applying the fix from 2014 also gives 
the "ValueError: Could not embed molecule."- error. 

I attached the .sdf of the backbone and two canonical smiles.
backbone 3d coordinates:


G:\MC_gen_test\test2_bb.pdb
 OpenBabel07191818263D

 25 25  0  0  0  0  0  0  0  0999 V2000
   81,0000   22,0000   24,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   83,0000   22,0000   23,0000 N   0  0  0  0  0  0  0  0  0  0  0  0
   81,0000   23,0000   24,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   81,0000   24,0000   24,0000 N   0  0  0  0  0  0  0  0  0  0  0  0
   81,0000   26,0000   24,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   82,0000   26,0000   26,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   83,0000   25,0000   26,0000 N   0  0  0  0  0  0  0  0  0  0  0  0
   83,0000   25,0000   28,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   84,0000   26,0000   28,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   85,0000   26,0000   27,0000 N   0  0  0  0  0  0  0  0  0  0  0  0
   86,0000   27,0000   27,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   86,0000   28,0000   25,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   86,0000   27,0000   24,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   87,0000   27,0000   23,0000 N   0  0  0  0  0  0  0  0  0  0  0  0
   88,0000   26,0000   22,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   89,0000   25,0000   23,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   90,0000   26,0000   24,0000 N   0  0  0  0  0  0  0  0  0  0  0  0
   91,0000   25,0000   24,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   91,0000   24,0000   25,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   90,0000   23,0000   25,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   84,0000   22,0000   24,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   85,0000   22,0000   23,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   86,0000   23,0000   24,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   87,0000   22,0000   24,0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   88,0000   23,0000   25,0000 N   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0  0  0  0
  1  3  1  0  0  0  0
  2 21  1  0  0  0  0
  3  4  1  0  0  0  0
  4  5  1  0  0  0  0
  5  6  1  0  0  0  0
  6  7  1  0  0  0  0
  7  8  1  0  0  0  0
  8  9  1  0  0  0  0
  9 10  1  0  0  0  0
 10 11  1  0  0  0  0
 11 12  1  0  0  0  0
 12 13  1  0  0  0  0
 13 14  1  0  0  0  0
 14 15  1  0  0  0  0
 15 16  1  0  0  0  0
 16 17  1  0  0  0  0
 17 18  1  0  0  0  0
 18 19  1  0  0  0  0
 19 20  1  0  0  0  0
 20 25  1  0  0  0  0
 21 22  1  0  0  0  0
 22 23  1  0  0  0  0
 23 24  1  0  0  0  0
 24 25  1  0  0  0  0
M  END
$$$$


A smiles which works with the 2014 "ignoreSmoothingFailures=True"-fix, but not 
without: 
C=C1C(=O)NC(C)C(=O)NC(CC(C)C)C(=O)NC(C(=O)O)C(C)C(=O)NC(CCCN=C(N)N)C(=O)NC(C=CC(C)=CC(C)C(Cc2ccccc2)OC)C(C)C(=O)NC(C(=O)O)CCC(=O)N1C

A smiles with a selenium, which additionally gives an Attribute Error:

C=C1C(=O)NC(C)C(=O)NC(CC(C)C)C(=O)NC(C(=O)O)C(C)C(=O)NC(Cc2ccccc2)C(=O)NC(C=CC(C)=CC(C)C(Cc2ccccc2)OC)C(C)C(=O)NC(C(=O)O)CCC(=O)N1[Se]c1ccccc1


Any advice is appreciated!

Best wishes,
Jahn Nitschke



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to