Navid-

If there aren't any conformers, then atoms don't have coordinates. In that
case, I'm not sure that it makes sense to measure an angle between the
atoms. Maybe you want to generate the 3d coordinates using embedmol, or a
2d depiction using rddepict.

*dan nealschneider* | senior developer
[image: Schrodinger Logo] <https://www.schrodinger.com/>


On Fri, Sep 20, 2019 at 11:16 AM Navid Shervani-Tabar <nshe...@gmail.com>
wrote:

> 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
>
>
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to