W:Substructure matching



Hi All,
 I am searching for some software that will help me to identify the atoms within
 a molecule that match a query substructure. For example I wish to find which
 atoms belong to an imidazole ring. The aim is to extract the matching
 substructure while keeping the original atomic coordinates.
 I know that several substructure matching routines exist, and some are even
 freely available but I haven't found any that return the identity of the
 matching atoms. Some return the whole molecule or a tally of how many times the
 substructure is present. They obviously "know" which atoms match but I
 am having difficulty identifying them. Similarly matching strings in SMILES
 doesn't return the initial atom ids.
 I would be very grateful for any routines that do this, or that can be modified
 for this purpose,
 Many Thanks,
 Sean O'Brien