Hi Greg,

 

That sounds pretty straightforward - thanks a lot for that.

 

If I wanted to bookmark atoms that match a particular substructure, how would I 
go about it? SubstructMatch returns the number of matches for a given 
substructure, but how can I extract information about the location of the 
matches?

 

Hope this isn't a long question to answer...

 

Thanks.
 
> From: [email protected]
> Date: Fri, 24 Jul 2009 19:28:21 +0200
> Subject: Re: [Rdkit-discuss] Bookmarks
> To: [email protected]
> CC: [email protected]
> 
> Hi George,
> 
> On Fri, Jul 24, 2009 at 5:11 PM, George Oakman<[email protected]> wrote:
> >
> > I wonder if someone would so kind as to explain very briefly the concept of
> > Bookmarks in the ROMol class. I am hoping this is something I can use to
> > identify the location of substructure after a SubstructMatch, but maybe I'm
> > completely off piste!
> 
> You certainly could use them to mark atoms that match substructures if
> you like -- bookmarks are a general purpose tool for associating atoms
> or bonds with integers. There's not a lot to explain beyond that. You
> can associate an atom with a bookmark by calling
> ROMol::setAtomBookmark with a pointer (or smart pointer) to the atom.
> The bookmark system takes no responsibility for memory allocation, so
> you don't need to worry about it deleteing atoms you might be using
> elsewhere (similarly, you should be careful not to delete an atom
> pointer that is bookmarked). Calling setAtomBookmark repeatedly with
> the same integer associates multiple atoms with the bookmark.
> getAtomWithBookmark() or getAllAtomsWithBookmark() returns the first
> atom (or all atoms) with the provided bookmark (or generates an error
> if no such bookmark exists, so be sure to call hasAtomBookmark() if
> you have any doubts). The various forms of clearAtomBookmark clear the
> bookmark for either a single atom or all associated atoms.
> 
> All of the above also holds for bonds.
> 
> That's all I can think of to say about the system... any questions
> left unanswered?
> -greg

_________________________________________________________________
Share your memories online with anyone you want.
http://clk.atdmt.com/UKM/go/134665338/direct/01/

Reply via email to