11
11
import org .openscience .cdk .DefaultChemObjectBuilder ;
12
12
import org .openscience .cdk .interfaces .IAtomContainer ;
13
13
import org .openscience .cdk .smiles .SmilesParser ;
14
+ import org .openscience .smsd .AtomAtomMapping ;
15
+ import org .openscience .smsd .Isomorphism ;
16
+ import org .openscience .smsd .interfaces .Algorithm ;
14
17
15
18
/**
16
19
*
@@ -35,9 +38,9 @@ public void testSet_IMolecule_IMolecule() throws Exception {
35
38
mcs .search_cliques ();
36
39
List <List <Integer >> overlaps = mcs .getFinalMappings ();
37
40
assertEquals (overlaps .size (), 2 );
38
- assertEquals ((mcs .getFinalMappings ().iterator ().next ().size () / 2 ), 7 );
41
+ assertEquals (7 , (mcs .getFinalMappings ().iterator ().next ().size () / 2 ));
39
42
}
40
-
43
+
41
44
/**
42
45
* Test of set method, of class MCSPlusHandler.
43
46
*
@@ -51,11 +54,61 @@ public void testSet_count() throws Exception {
51
54
IAtomContainer target = sp .parseSmiles ("*[P](=O)(O)OCC1O[CH]C(OC(=O)C(N)CC2=CC=C(O)C=C2)C1O" );
52
55
53
56
org .openscience .smsd .algorithm .mcsplus .mcsplus1 .MCSPlus mcs
54
- = new org .openscience .smsd .algorithm .mcsplus .mcsplus1 .MCSPlus (query , target , true , false , false );
55
- mcs .search_cliques ();
57
+ = new org .openscience .smsd .algorithm .mcsplus .mcsplus1 .MCSPlus (query , target , true , false , false );
58
+ mcs .search_cliques ();
56
59
List <List <Integer >> overlaps = mcs .getFinalMappings ();
57
60
assertEquals (overlaps .size (), 1 );
58
- assertEquals ((mcs .getFinalMappings ().iterator ().next ().size () / 2 ), 9 );
61
+ assertEquals (9 , (mcs .getFinalMappings ().iterator ().next ().size () / 2 ));
62
+ }
63
+
64
+ /**
65
+ * Test of set method, of class MCSPlusHandler.
66
+ *
67
+ * @throws Exception
68
+ */
69
+ @ Test
70
+ public void test_MCS_count () throws Exception {
71
+ ////////System.out.println("3");
72
+ SmilesParser sp = new SmilesParser (DefaultChemObjectBuilder .getInstance ());
73
+ //CHEBI:58504
74
+ IAtomContainer query = sp .parseSmiles ("CC1=C2N3[C@H]([C@H](CC(N)=O)[C@@]2"
75
+ + "(C)CCC([O-])=O)[C@]2(C)[N+]4=C([C@@H](CCC(N)=O)[C@]2(C)CC(N)=O)"
76
+ + "C(C)=C2[N+]5=C(C=C6[N+](=C1[C@@H](CCC(N)=O)C6(C)C)[Co--]345"
77
+ + "C[C@H]1O[C@H]([C@H](O)[C@@H]1O)n1cnc3c(N)ncnc13)[C@@H]"
78
+ + "(CCC(N)=O)[C@]2(C)CC(N)=O" );
79
+ //CHEBI:2480
80
+ IAtomContainer target = sp .parseSmiles ("[H][C@@]12[C@H](CC(N)=O)[C@@](C)"
81
+ + "(CCC(=O)NC[C@@H](C)O)C3=C(C)C4=[N+]5C(=CC6=[N+]7C(=C(C)C8=[N+]"
82
+ + "([C@]1(C)[C@@](C)(CC(N)=O)[C@@H]8CCC(N)=O)[Co--]57(C[C@H]1O[C@H]"
83
+ + "([C@H](O)[C@@H]1O)n1cnc5c(N)ncnc15)N23)[C@@](C)(CC(N)=O)"
84
+ + "[C@@H]6CCC(N)=O)C(C)(C)[C@@H]4CCC(N)=O" );
85
+
86
+ Isomorphism mcs
87
+ //= new Isomorphism(query, target, Algorithm.VFLibMCS, true, true, true);
88
+ = new Isomorphism (query , target , Algorithm .DEFAULT , false , false , false );
89
+
90
+ List <AtomAtomMapping > allAtomMapping = mcs .getAllAtomMapping ();
91
+ assertEquals (81 , mcs .getFirstAtomMapping ().getCount ());
92
+ }
93
+
94
+ @ Test
95
+ public void test_VFMCS_count () throws Exception {
96
+ ////////System.out.println("3");
97
+ SmilesParser sp = new SmilesParser (DefaultChemObjectBuilder .getInstance ());
98
+ // IAtomContainer query = sp.parseSmiles("*C1OC(CO)C(OP=O)C1O");
99
+ // IAtomContainer target = sp.parseSmiles("*[P](=O)(O)OCC1O[CH]C(OC(=O)C(N)CC2=CC=C(O)C=C2)C1O");
100
+
101
+ IAtomContainer query = sp .parseSmiles ("[N].[N]=C[N].[CH].[O].[NH2]" );
102
+ IAtomContainer target = sp .parseSmiles ("[C]C(=O)N.[N].[N]C=[N].[NH2]" );
103
+
104
+ Isomorphism mcs
105
+ //= new Isomorphism(query, target, Algorithm.VFLibMCS, true, true, true);
106
+ = new Isomorphism (query , target , Algorithm .VFLibMCS , false , false , false );
107
+
108
+ System .out .println ("mcs.getFirstAtomMapping() " + mcs .getFirstAtomMapping ());
109
+ List <AtomAtomMapping > allAtomMapping = mcs .getAllAtomMapping ();
110
+ // assertEquals(2, allAtomMapping.size());
111
+ assertEquals (7 , mcs .getFirstAtomMapping ().getCount ());
59
112
}
60
113
61
114
}
0 commit comments