示例#1
0
        public void TestDefineLigandImplicitHydrogen()
        {
            var molecule = smiles.ParseSmiles("CC(C)C(C#N)(C(=C)C)");
            var ligand   = CIPTool.DefineLigand(molecule, new VisitedAtoms(), 3, CIPTool.Hydrogen);

            Assert.IsTrue(ligand is ImplicitHydrogenLigand);
        }
示例#2
0
        public void TestDefineLigand()
        {
            var ligand = CIPTool.DefineLigand(molecule, new VisitedAtoms(), 1, 2);

            Assert.AreEqual(molecule, ligand.AtomContainer);
            Assert.AreEqual(molecule.Atoms[1], ligand.CentralAtom);
            Assert.AreEqual(molecule.Atoms[2], ligand.LigandAtom);
        }
示例#3
0
        public void TestGetLigandLigandsVisitedTracking()
        {
            var molecule   = smiles.ParseSmiles("CC(C)C(CC)(C(C)(C)C)[H]");
            var ligand     = CIPTool.DefineLigand(molecule, new VisitedAtoms(), 3, 1);
            var sideChains = CIPTool.GetLigandLigands(ligand);

            foreach (var ligand2 in sideChains)
            {
                Assert.AreNotSame(ligand.VisitedAtoms, ligand2.VisitedAtoms);
            }
        }
示例#4
0
        public void TestGetLigandLigandsDoubleTriple()
        {
            var molecule   = smiles.ParseSmiles("CC(C)C(C#N)(C(=C)C)[H]");
            var ligand     = CIPTool.DefineLigand(molecule, new VisitedAtoms(), 3, 1);
            var sideChains = CIPTool.GetLigandLigands(ligand);

            Assert.AreEqual(2, sideChains.Count);
            ligand     = CIPTool.DefineLigand(molecule, new VisitedAtoms(), 3, 4);
            sideChains = CIPTool.GetLigandLigands(ligand);
            Assert.AreEqual(3, sideChains.Count);
            ligand     = CIPTool.DefineLigand(molecule, new VisitedAtoms(), 3, 6);
            sideChains = CIPTool.GetLigandLigands(ligand);
            Assert.AreEqual(3, sideChains.Count);
            ligand     = CIPTool.DefineLigand(molecule, new VisitedAtoms(), 3, 9);
            sideChains = CIPTool.GetLigandLigands(ligand);
            Assert.AreEqual(0, sideChains.Count);
        }