示例#1
0
        public void TestTwoVersusDoubleBondedOxygen()
        {
            var molecule = smiles.ParseSmiles("OC(O)C([H])(C)C=O");
            var ligand1  = CIPTool.DefineLigand(molecule, new VisitedAtoms(), 3, 1);
            var ligand2  = CIPTool.DefineLigand(molecule, new VisitedAtoms(), 3, 6);
            var rule     = new CIPLigandRule();

            Assert.AreEqual(-1, rule.Compare(ligand1, ligand2));
            Assert.AreEqual(1, rule.Compare(ligand2, ligand1));
        }
示例#2
0
        public void TestDeepRecursion()
        {
            var molecule = smiles.ParseSmiles("CC([H])(CCCCCCCCCC)CCCCCCCCC");
            var ligand1  = CIPTool.DefineLigand(molecule, new VisitedAtoms(), 1, 3);
            var ligand2  = CIPTool.DefineLigand(molecule, new VisitedAtoms(), 1, 13);
            var rule     = new CIPLigandRule();

            Assert.AreEqual(1, rule.Compare(ligand1, ligand2));
            Assert.AreEqual(-1, rule.Compare(ligand2, ligand1));
        }
示例#3
0
        public void TestSideChainsRecursive()
        {
            var molecule = smiles.ParseSmiles("CCCC([H])(C)CC");
            var ligand1  = CIPTool.DefineLigand(molecule, new VisitedAtoms(), 3, 6);
            var ligand2  = CIPTool.DefineLigand(molecule, new VisitedAtoms(), 3, 1);
            var rule     = new CIPLigandRule();

            Assert.AreEqual(-1, rule.Compare(ligand1, ligand2));
            Assert.AreEqual(1, rule.Compare(ligand2, ligand1));
        }
示例#4
0
        public void TestOrder()
        {
            var molecule     = smiles.ParseSmiles("CC(Br)([13C])[H]");
            var ligands      = new List <ILigand>();
            var visitedAtoms = new VisitedAtoms();

            ligands.Add(CIPTool.DefineLigand(molecule, visitedAtoms, 1, 4));
            ligands.Add(CIPTool.DefineLigand(molecule, visitedAtoms, 1, 3));
            ligands.Add(CIPTool.DefineLigand(molecule, visitedAtoms, 1, 2));
            ligands.Add(CIPTool.DefineLigand(molecule, visitedAtoms, 1, 0));

            ligands.Sort(new CIPLigandRule());
            Assert.AreEqual("H", ligands[0].LigandAtom.Symbol);
            Assert.AreEqual("C", ligands[1].LigandAtom.Symbol);
            Assert.AreEqual("C", ligands[2].LigandAtom.Symbol);
            Assert.AreEqual(13, ligands[2].LigandAtom.MassNumber.Value);
            Assert.AreEqual("Br", ligands[3].LigandAtom.Symbol);
        }