wildcard atoms and smarts with [#0]

User e469f67125

10-11-2010 15:04:09

I'm implementing an algorithm involving molecule fragmentation for which I need to remember and classify the attachment points.  To do this I'm using wildcard atoms (atomic number 0) with atom maps (MolAtom.setAtomMap).  I know atom maps are generally for use in reactions, so I hope this use is reasonable.  Any advice on this approach in general would be appreciated.


However, the current problem I'm having is with matching wildcard atoms via smarts.  As shown by the attached code, the smarts "[#0].[#0]" does indeed match the molecule from smiles "*C*" as expected.  But, when I create a molecule by hand (with Molecule.add(MolAtom) etc.) the match fails. Can this be helped?


 


$ java z '[#0].[#0]' "*C*"
JChem version: 5.3.8
input mol: *C*
input smarts: [#0].[#0]
 n_matches = 1
test mol: [#0][#6][#0]
 n_matches = 0


ChemAxon a3d59b832c

12-11-2010 18:15:19

Hi Jeremy,


 


Practically it is OK to use ANY atoms for that.


From the conceptual view of things, in version 5.4 we will soon introduce a new explicit attachment point atom type, which may be a more natural choice in the future.


 


Regarding the program:


I think there are more than one problems:


1. Atomic number zero is not defining the any atom. It would be safer to use the constants defined in MolAtom for this:


http://www.chemaxon.com/jchem/doc/dev/java/api/constant-values.html#chemaxon.struc.MolAtom


For example, http://www.chemaxon.com/jchem/doc/dev/java/api/chemaxon/struc/MolAtom.html#ANY


(But in MolSearch it is made sure that [#0] only matches to * to be compatible with Daylight.)


 


2. In the target molecule, you use MolBond.SINGLE_OR_AROMATIC. There is a chance that it will only work when Markush searching is switched on or when exact bond matching is switched on.


Your original smiles "*C*" is imported with single bonds, so you may want to stick to that in the program also. (Although, this is not a problem in case of the smarts that you used.)




Best regards,


Szabolcs

User e469f67125

17-11-2010 15:58:19

Dear Szabolcs,


Thank you very much -- that all works great, and I look forward to the attachment point atom type.


Jeremy