From: Rajarshi G. <rg...@in...> - 2007-04-08 23:55:29
|
On Sun, 2007-04-08 at 19:11 +0530, sushil ronghe wrote: > > public boolean matches(IAtom atom) { > if (RING_SIZE==1){ > return atom.getFlag(CDKConstant.ISINRING); // why the CDKConstant.ISINRING is not boolean value. The constant itself is an integer, the return value is boolean. Why should the constant be boolean? > I have also convinced about the fact that we have to go above the > ringsize of 8. Agreed. > NOw we can have the method directly like getRingSizes() or > atom.getFlag(CDKConstant.RingSizes); I would rather not tack on another function to the IAtom interface. Following Egon's suggestion I've committed a SMARTSQueryTool class which allows an easier way to use SMARTS matching than directly calling the parser and handling the UniversalIsomorphismTester to get matching atoms etc For your case, as you're developing the parser, this class probably should not affect your work on the parser itself. However, it does perform pre-processing of the target molecule. As a result, if you use the query tool class, the target atomContainer will be modified so that atoms in a ring will have a property, CDKConstants.RING_SIZE whose value is a List of the sizes of each ring the atom is a member of. So in the parser code you can do List ringSizes = atom.getProperty(CDKConstants.RING_SIZE); For example usage of the query tool class see http://cheminfo.informatics.indiana.edu/~rguha/code/java/nightly/api/org/openscience/cdk/smiles/smarts/SMARTSQueryTool.html Regarding the RingAtom class - I'll hold of adding that till you're done on your side and then we can add the your stuff. PS. Please cc to the list and use meaningful subject lines ------------------------------------------------------------------- Rajarshi Guha <rg...@in...> GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE ------------------------------------------------------------------- After a number of decimal places, nobody gives a damn. |