Dear Navid,

“Zero conformations” mains that EmbedMolecule function return false. There is 
no 3D. You use the default EmbedMolecule parameters.
You can try to change them to get 3D coordinates (increase maxAttempts for 
example). I don’t see another way to get realistic “Angle” between atoms.
Generally when such thing happens, you must remove molecules instead of trying 
to get wrong / approximate values.

Good luck.

BR,

Guillaume

De : Navid Shervani-Tabar <nshe...@gmail.com>
Date : vendredi, 20 septembre 2019 à 20:16
À : RDKit Discuss <rdkit-discuss@lists.sourceforge.net>
Objet : [Rdkit-discuss] GetAngleDeg alternative for the case of no conformation

Hello,

Couple weeks ago, I asked if there is an RDKit based method that can give the 
distance between two atoms between the molecule. The solution that I got was:

from rdkit.Chem import AllChem

mol = Chem.MolFromSmiles('O=CC1OC12CC1OC12')
AllChem.EmbedMolecule(mol)
conf = mol.GetConformer()

at1Coords = np.array(conf.GetAtomPosition(bond_i.GetBeginAtomIdx()))
at2Coords = np.array(conf.GetAtomPosition(bond_i.GetEndAtomIdx()))
dist = np.linalg.norm(at2Coords - at1Coords)

This was good until I tried the same for molecules such as  'CC12CCC1CC2' where 
there are zero conformations and the method did not work. I found the 
alternative

from rdkit.Chem import rdDistGeom as molDG

bound_matrix = molDG.GetMoleculeBoundsMatrix(mol)
bond_i = mol.GetBondWithIdx(idx)
d = bound_matrix[bond_i.GetBeginAtomIdx(), bond_i.GetEndAtomIdx()]

Now getting back to my current question, I am trying to find the angle between 
two atoms using the method

angle = Chem.rdMolTransforms.GetAngleDeg(conf, atom[0], atom[1], atom[2])

Again, this method does not work when there are zero conformations. I was 
wondering if there are any RDKit alternatives for this that do not use 
mol.GetConformer or my best bet is to use molDG.GetMoleculeBoundsMatrix and 
trigonometry to find them.

Thanks,
Navid



***********************************************************************************
DISCLAIMER  
This email and any files transmitted with it, including replies and forwarded 
copies (which may contain alterations) subsequently transmitted from Firmenich, 
are confidential and solely for the use of the intended recipient. The contents 
do not represent the opinion of Firmenich except to the extent that it relates 
to their official business.  
***********************************************************************************
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to