public void Test2LetterSMARTS() { var query = SMARTSParser.Parse("Sc1ccccc1", ChemObjectBuilder.Instance); Assert.AreEqual(7, query.Atoms.Count); Assert.AreEqual("S", query.Atoms[0].Symbol); }
public void Test2LetterSMARTS() { var query = SMARTSParser.Parse("Sc1ccccc1"); Assert.AreEqual(7, query.Atoms.Count); Assert.AreEqual("S", query.Atoms[0].Symbol); }
public void Visit(string smarts) { var parser = new SMARTSParser(new StringReader(smarts)); var start = parser.Start(); var visitor = new SmartsQueryVisitor(); visitor.Visit(start, null); }
public void Visit(string smarts) { SMARTSParser parser = new SMARTSParser(new StringReader(smarts)); ASTStart start = parser.Start(); SmartsQueryVisitor visitor = new SmartsQueryVisitor(ChemObjectBuilder.Instance); visitor.Visit(start, null); }
public void Dump(string smarts) { SMARTSParser parser = new SMARTSParser(new StringReader(smarts)); ASTStart start = parser.Start(); SmartsDumpVisitor visitor = new SmartsDumpVisitor(); visitor.Visit(start, null); }
public void TestAliphaticAtom() { var container = SMARTSParser.Parse("A"); Assert.AreEqual(1, container.Atoms.Count); IAtom atom = container.Atoms[0]; Assert.IsTrue(atom is SMARTSAtom); }
public void TestQueryAtomCreation() { var container = SMARTSParser.Parse("*"); Assert.AreEqual(1, container.Atoms.Count); IAtom atom = container.Atoms[0]; Assert.IsTrue(atom is SMARTSAtom); }
static void Main() { #region 1 SMARTSParser parser = new SMARTSParser(new StringReader("C*C")); ASTStart ast = parser.Start(); SmartsQueryVisitor visitor = new SmartsQueryVisitor(); QueryAtomContainer query = (QueryAtomContainer)visitor.Visit(ast, null); #endregion }
public void TestImplicitHCount() { var container = SMARTSParser.Parse("[h3]"); Assert.AreEqual(1, container.Atoms.Count); IAtom atom = container.Atoms[0]; Assert.IsTrue(atom is SMARTSAtom); }
private void InitializeQuery() { mappings = null; if (!cache.TryGetValue(smarts, out query)) { query = SMARTSParser.Parse(smarts); cache[smarts] = query; } }
public void TestTotalHCount() { var container = SMARTSParser.Parse("[H2]", ChemObjectBuilder.Instance); Assert.AreEqual(1, container.Atoms.Count); IAtom atom = container.Atoms[0]; Assert.IsTrue(atom is SMARTSAtom); }
public void TestDegree() { var container = SMARTSParser.Parse("[D2]"); Assert.AreEqual(1, container.Atoms.Count); IAtom atom = container.Atoms[0]; Assert.IsTrue(atom is SMARTSAtom); }
public void TestAnyOrderBond() { var container = SMARTSParser.Parse("C~C"); Assert.AreEqual(2, container.Atoms.Count); Assert.AreEqual(1, container.Bonds.Count); var bond = container.Bonds[0]; Assert.IsTrue(bond is AnyOrderQueryBond); }
public void TestAromaticBond() { var container = SMARTSParser.Parse("C:C"); Assert.AreEqual(2, container.Atoms.Count); Assert.AreEqual(1, container.Bonds.Count); IBond bond = container.Bonds[0]; Assert.IsTrue(bond is AromaticQueryBond); }
public void TestAnyOrderBond() { var container = SMARTSParser.Parse("C~C", ChemObjectBuilder.Instance); Assert.AreEqual(2, container.Atoms.Count); Assert.AreEqual(1, container.Bonds.Count); IBond bond = container.Bonds[0]; Assert.IsTrue(bond is AnyOrderQueryBond); }
public void TestAromaticBond() { var container = SMARTSParser.Parse("C:C", ChemObjectBuilder.Instance); Assert.AreEqual(2, container.Atoms.Count); Assert.AreEqual(1, container.Bonds.Count); var bond = container.Bonds[0]; Assert.IsTrue(bond is AromaticQueryBond); }
public void TestTripleBond() { var container = SMARTSParser.Parse("C#C", ChemObjectBuilder.Instance); Assert.AreEqual(2, container.Atoms.Count); Assert.AreEqual(1, container.Bonds.Count); IBond bond = container.Bonds[0]; Assert.IsTrue(bond is OrderQueryBond); OrderQueryBond qBond = (OrderQueryBond)bond; Assert.AreEqual(BondOrder.Triple, qBond.Order); }
public void TestSingleBond() { var container = SMARTSParser.Parse("C-C"); Assert.AreEqual(2, container.Atoms.Count); Assert.AreEqual(1, container.Bonds.Count); IBond bond = container.Bonds[0]; Assert.IsTrue(bond is OrderQueryBond); OrderQueryBond qBond = (OrderQueryBond)bond; Assert.AreEqual(BondOrder.Single, qBond.Order); }
public void TestTripleBond() { var container = SMARTSParser.Parse("C#C"); Assert.AreEqual(2, container.Atoms.Count); Assert.AreEqual(1, container.Bonds.Count); var bond = container.Bonds[0]; Assert.IsTrue(bond is OrderQueryBond); var qBond = (OrderQueryBond)bond; Assert.AreEqual(BondOrder.Triple, qBond.Order); }
void Main() { UniversalIsomorphismTester universalIsomorphismTester = null; #region 1 SmilesParser sp = new SmilesParser(); IAtomContainer atomContainer = sp.ParseSmiles("CC(=O)OC(=O)C"); QueryAtomContainer query = SMARTSParser.Parse("C*C"); bool queryMatch = universalIsomorphismTester.IsSubgraph(atomContainer, query); #endregion #region 2 SMARTSParser parser = new SMARTSParser(new StringReader("C*C")); ASTStart start = parser.Start(); #endregion }
public ASTRingConnectivity(SMARTSParser p, int id) : base(p, id) { }
public ASTTotalHCount(SMARTSParser p, int id) : base(p, id) { }
public ASTRingMembership(SMARTSParser p, int id) : base(p, id) { }
public ASTAtomicNumber(SMARTSParser p, int id) : base(p, id) { }
public ASTExplicitAtom(SMARTSParser p, int id) : base(p, id) { }
public ASTExplicitHighAndExpression(SMARTSParser p, int id) : base(p, id) { }
public ASTTotalConnectivity(SMARTSParser p, int id) : base(p, id) { }
public ASTStart(SMARTSParser p, int id) : base(p, id) { }
/// <summary> /// Creates a new instance. /// </summary> public ASTPrimitiveAtomExpression(SMARTSParser p, int id) : base(p, id) { }
public ASTLowAndExpression(SMARTSParser p, int id) : base(p, id) { }