Hi,

I'm trying to trivially modify the coordinates of the 0th atom of the
0th conformer in a (3D) ROMol called m. To do that I need to get the
conformer:

RDKit::ROMol m = ...;
RDKit::Conformer conf = m.getConformer(-1);

int idx = 0;

// Get coordinates of 0th atom
double x = conf.getAtomPos(idx).x;
double y = conf.getAtomPos(idx).y;
double z = conf.getAtomPos(idx).z;

RDGeom::Point3D point;
point.x = 2 * x;
point.y = 2 * y;
point.z = 2 * z;
conf.setAtomPos(idx, point);

Easy-peasy. However, the molecule coordinate has not been updated:
'conf.getAtomPos(0).x' is not the same as
'm.getConformer(-1).
getAtomPos(0).x'.

To get the molecule coordinate to change, instead I need to do

m.getConformer(-1).setAtomPos(idx, point);

This is not the behaviour I wouldn't expect (and in python this
modification can be done on the conf variable; also there is no
difference in the c++ between ROMol and RWMol). Is there something I'm
doing wrong?

Thanks everybody,

Jan
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to