public void TestGetTanimotoSimilarity() { var sp = CDK.SmilesParser; var target = sp.ParseSmiles("C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C"); var queryac = sp.ParseSmiles("Nc1ccccc1"); Isomorphism smsd1 = new Isomorphism(Algorithm.Default, true); smsd1.Init(queryac, target, true, true); smsd1.SetChemFilters(true, true, true); double score = 0.35; Assert.AreEqual(score, smsd1.GetTanimotoSimilarity(), 0); }
public void TestSet_String_String() { string molfile = "NCDK.Data.MDL.decalin.mol"; string queryfile = "NCDK.Data.MDL.decalin.mol"; IAtomContainer query = new AtomContainer(); IAtomContainer target = new AtomContainer(); var ins = ResourceLoader.GetAsStream(molfile); var reader = new MDLV2000Reader(ins, ChemObjectReaderMode.Strict); reader.Read(query); ins = ResourceLoader.GetAsStream(queryfile); reader = new MDLV2000Reader(ins, ChemObjectReaderMode.Strict); reader.Read(target); Isomorphism smsd1 = new Isomorphism(Algorithm.Default, true); smsd1.Init(query, target, true, true); smsd1.SetChemFilters(true, true, true); double score = 1.0; Assert.AreEqual(score, smsd1.GetTanimotoSimilarity(), 0.0001); }