Hello,
for my Orchem project I'm looking into CDK SMARTS matching inside the
database. Things work pretty well, I just now encountered a particular
(non aromatic) compound that does not seem to match against itself. It
seems the hydrogen is the reason, example below.
The standalone program creates an atom container based on SMILES, and a
SMARTS query tool using that same smiles, then looks if the SMILES
container matches itself as a SMARTS query.
It doesn't work, but does work if you remove the [H]. The Universal
Isomorphism Tester looks to be the culprit, getSubgraphMaps does not
give a list back. I was wondering if this is expected behaviour.
thanks,
Mark
___________________________
Output
------
smiles is:[H][C@@]1(CCC(C)=CC1=O)C(C)=C
smarts is:[H][C@@]1(CCC(C)=CC1=O)C(C)=C
no match
smiles is:[C@@]1(CCC(C)=CC1=O)C(C)=C
smarts is:[C@@]1(CCC(C)=CC1=O)C(C)=C
match
Class
-----
package uk.ac.ebi.orchem.scratch;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.nonotify.NoNotificationChemObjectBuilder;
import org.openscience.cdk.smiles.SmilesParser;
import org.openscience.cdk.smiles.smarts.SMARTSQueryTool;
import org.openscience.cdk.tools.manipulator.AtomContainerManipulator;
public class UITTest {
public static void main(String[] args) throws Exception {
test("[H][C@@]1(CCC(C)=CC1=O)C(C)=C");
test("[C@@]1(CCC(C)=CC1=O)C(C)=C");
}
public static void test (String smiles ) throws Exception {
System.out.println("smiles is:"+smiles);
SmilesParser sp = new SmilesParser
(NoNotificationChemObjectBuilder.getInstance());
IMolecule mol = sp.parseSmiles(smiles);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol);
SMARTSQueryTool querytool = new SMARTSQueryTool(smiles);
System.out.println("smarts is:"+querytool.getSmarts());
if (querytool.matches(mol))
System.out.println("match");
else {
System.out.println("no match");
}
}
}
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user