Search in sources :

Example 6 with SMARTSQueryTool

use of org.openscience.cdk.smiles.smarts.SMARTSQueryTool in project cdk by cdk.

the class RecursiveTest method testRecursive28_cdkAromaticModel.

@Test
public void testRecursive28_cdkAromaticModel() throws Exception {
    SMARTSQueryTool sqt = smarts("[NX3;H2,H1;!$(NC=O)]");
    IAtomContainer smi = smiles("Cc1ccc[n+]2c1[nH]cc(c2=O)c1n[nH]nn1");
    sqt.setAromaticity(new Aromaticity(ElectronDonation.cdk(), Cycles.cdkAromaticSet()));
    AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(smi);
    int[] result = SMARTSSearchTest.match(sqt, smi);
    Assert.assertEquals(1, result[0]);
    Assert.assertEquals(1, result[1]);
}
Also used : IAtomContainer(org.openscience.cdk.interfaces.IAtomContainer) Aromaticity(org.openscience.cdk.aromaticity.Aromaticity) SMARTSQueryTool(org.openscience.cdk.smiles.smarts.SMARTSQueryTool) Test(org.junit.Test) SlowTest(org.openscience.cdk.test.SlowTest)

Example 7 with SMARTSQueryTool

use of org.openscience.cdk.smiles.smarts.SMARTSQueryTool in project cdk by cdk.

the class RecursiveTest method testRecursiveSmarts26.

@Test
public void testRecursiveSmarts26() throws Exception {
    SMARTSQueryTool sqt = smarts("[NX3;H2,H1;!$(NC=O)]");
    IAtomContainer smi = smiles("CCCc1cc(=O)nc([nH]1)S");
    int[] result = SMARTSSearchTest.match(sqt, smi);
    Assert.assertEquals(0, result[0]);
    Assert.assertEquals(0, result[1]);
}
Also used : IAtomContainer(org.openscience.cdk.interfaces.IAtomContainer) SMARTSQueryTool(org.openscience.cdk.smiles.smarts.SMARTSQueryTool) Test(org.junit.Test) SlowTest(org.openscience.cdk.test.SlowTest)

Example 8 with SMARTSQueryTool

use of org.openscience.cdk.smiles.smarts.SMARTSQueryTool in project cdk by cdk.

the class RecursiveTest method testRecursive29.

@Test
public void testRecursive29() throws Exception {
    SMARTSQueryTool sqt = smarts("[NX3;H2,H1;!$(NC=O)]");
    IAtomContainer smi = smiles("Cc1cc(=O)c(c[nH]1)C(=O)NC(c1ccc(cc1)O)C(=O)NC1C(=O)N2C1SCC(=C2C(=O)O)CSc1nnnn1C");
    int[] result = SMARTSSearchTest.match(sqt, smi);
    Assert.assertEquals(0, result[0]);
    Assert.assertEquals(0, result[1]);
}
Also used : IAtomContainer(org.openscience.cdk.interfaces.IAtomContainer) SMARTSQueryTool(org.openscience.cdk.smiles.smarts.SMARTSQueryTool) Test(org.junit.Test) SlowTest(org.openscience.cdk.test.SlowTest)

Example 9 with SMARTSQueryTool

use of org.openscience.cdk.smiles.smarts.SMARTSQueryTool in project cdk by cdk.

the class SMARTSSearchTest method testPropertyR2.

@Test
public void testPropertyR2() throws Exception {
    SMARTSQueryTool sqt = smarts("[R2]");
    // default for daylight
    sqt.useSmallestSetOfSmallestRings();
    int[] results = match(sqt, smiles("COc1cc2c(ccnc2cc1)C(O)C4CC(CC3)C(C=C)CN34"));
    Assert.assertEquals(6, results[0]);
    Assert.assertEquals(6, results[1]);
}
Also used : SMARTSQueryTool(org.openscience.cdk.smiles.smarts.SMARTSQueryTool) Test(org.junit.Test)

Example 10 with SMARTSQueryTool

use of org.openscience.cdk.smiles.smarts.SMARTSQueryTool in project cdk by cdk.

the class SMARTSSearchTest method testLogicalOrLowAnd6_cdkAromaticity.

@Test
public void testLogicalOrLowAnd6_cdkAromaticity() throws Exception {
    SMARTSQueryTool sqt = smarts("[#7,C;+0,+1]");
    IAtomContainer smi = smiles("[Na+].[Na+].[O-]C(=O)c1ccccc1c2c3ccc([O-])cc3oc4cc(=O)ccc24");
    sqt.setAromaticity(new Aromaticity(ElectronDonation.cdk(), Cycles.cdkAromaticSet()));
    AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(smi);
    int[] results = match(sqt, smi);
    Assert.assertEquals(8, results[0]);
}
Also used : IAtomContainer(org.openscience.cdk.interfaces.IAtomContainer) Aromaticity(org.openscience.cdk.aromaticity.Aromaticity) SMARTSQueryTool(org.openscience.cdk.smiles.smarts.SMARTSQueryTool) Test(org.junit.Test)

Aggregations

SMARTSQueryTool (org.openscience.cdk.smiles.smarts.SMARTSQueryTool)26 Test (org.junit.Test)17 IAtomContainer (org.openscience.cdk.interfaces.IAtomContainer)17 SlowTest (org.openscience.cdk.test.SlowTest)10 Aromaticity (org.openscience.cdk.aromaticity.Aromaticity)6 SmilesParser (org.openscience.cdk.smiles.SmilesParser)5 FastBitArray (de.ipbhalle.metfraglib.FastBitArray)3 InputStream (java.io.InputStream)3 List (java.util.List)3 IAtom (org.openscience.cdk.interfaces.IAtom)3 InputStreamReader (java.io.InputStreamReader)2 Ignore (org.junit.Ignore)2 Category (org.junit.experimental.categories.Category)2 CDKException (org.openscience.cdk.exception.CDKException)2 RawIteratingSDFReader (ambit2.core.io.RawIteratingSDFReader)1 ISmartsPattern (ambit2.smarts.query.ISmartsPattern)1 BitArrayNeutralLoss (de.ipbhalle.metfraglib.fragment.BitArrayNeutralLoss)1 HighlightSubStructureImageGenerator (de.ipbhalle.metfraglib.imagegenerator.HighlightSubStructureImageGenerator)1 CandidateList (de.ipbhalle.metfraglib.list.CandidateList)1 ChemicalDatabase (de.unijena.bioinf.chemdb.ChemicalDatabase)1