[Rdkit-discuss] How to get coordinates for each atom in molecule?
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Michał N. <mm...@gm...> - 2014-01-24 11:53:37
|
Hi,
Let's say I loaded a molfile containing coordinates to RDKit mol
object or loaded it from smiles but called
AllChem.Compute2DCoords(mol).
Now I would like to get coordinates for each atom. Unfortunately Atom
class doesn't have any GetCoords method but this is understandable
since position is optional. I tried to look into properties but it
seems that they are stored in some stage container exported from C++:
for atom in mol.GetAtoms():
print atom.GetPropNames()
....:
<rdkit.rdBase._vectSs object at 0xa455aec>
<rdkit.rdBase._vectSs object at 0xa455aec>
...
Some blind guesses such as: atom.GetProp('x'), atom.GetProp('X')
failed. Mol object itself doesn't provide any method that would
suggest that it can return coordinates....
So is there any way to get this data without parsing original molfile?
Regards,
Michal Nowotka
|