George,

On Fri, Jul 24, 2009 at 8:06 PM, George Oakman<[email protected]> wrote:
>
> 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?

SubstructMatch() is overloaded. The first form:
http://www.rdkit.org/C++_Docs/namespaceRDKit.html#e494d544f0cbc823554f13c11b26763e
places a single match in the the matchVect argument (if there is one)
and returns whether or not a match was found.

The second form:
http://www.rdkit.org/C++_Docs/namespaceRDKit.html#9b20ad23a3197798585685fe766bae41
returns the number of matches and places the matches in the vector of
MatchVects that is provided as an argument

A MatchVect is an vector of int,int pairs, the length of the vect is
the number of atoms in the substructure query. Each pair contains an
atom index from the query and an atom index from the molecule. So for
a match of the query CCO onto the molecule OCCC, you'd have the vector
: [pair(0,2), pair(1,1), pair(2,0)]

Hope this helps,
-greg

Reply via email to