Dear Jongyoung,

First a quick note: the correct email address to send things to the
list is rdkit-disc...@lists.sourceforge.net. Please use this address
in the future.

On Wed, Oct 6, 2010 at 2:42 AM, 정종영 <fisherman...@gmail.com> wrote:
> Dear everybody,
>
> I'm coding with ROMol class in c++.
> To change small molecule's conformation, I am trying to update coordinates
> in Conformer object in ROMol.
>
> Following code is my trial...
>
> ...
> Conformer ligConf = ligandMol->gerConformer();
> ..
> // updating coordinates in Conformer object
> ..
> ligandMol->clearConformer();
> ligandMol->addConformer(&ligConf);
>
> I repeated upper code 4 times in same function.
> And at each time Conformer object is newly generated before updating
> coordinates.
>
> The problem is that at last time addConformer() gives runtime error.
> But if I deleted last repeated code, no runtime error.
>
> Anybody can know source of error?

Yes, I do. :-)
Here's the documentation for ROMol::addConformer:

    //! Add a new conformation to the molecule
    /*!
      \param conf - conformation to be added to the molecule, this
molecule takes ownership
                    of the conformer
      \param assignId - a unique ID will be assigned to the the
conformation if true
                        otherwise it is assumed that the conformation
already has an (unique) ID set
    */
    unsigned int addConformer(Conformer * conf, bool assignId=false);

when you add conformers to a molecule you either need to (first) give
each one a unique identifier using Conformer::setId() or you need to
call addConformer() with the second argument set to true.

However, based on what you say you are trying to do, I'm not sure that
addConformer() is really what you want. If you fix your original code
so that addConformer() is correctly called repeatedly, you are going
to end up with a molecule that has multiple conformers associated with
it. You say that you would like to "update coordinates". This sounds
like you want the molecule to only have one conformer but to change
the coordinates of that conformer. If that's the case, then you should
be sure to call ROMol::removeConformer() before you call
ROMol::addConformer(). Alternatively you can just directly update the
conformer's atom positions (note that Conformer::getPositions()
returns a reference).

 Best Regards,
-greg

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to