コード例 #1
0
        private static ILigand[] LigandsMaker()
        {
            var ligand1 = new Ligand(molecule, new VisitedAtoms(), molecule.Atoms[1], molecule.Atoms[4]);
            var ligand2 = new Ligand(molecule, new VisitedAtoms(), molecule.Atoms[1], molecule.Atoms[3]);
            var ligand3 = new Ligand(molecule, new VisitedAtoms(), molecule.Atoms[1], molecule.Atoms[2]);
            var ligand4 = new Ligand(molecule, new VisitedAtoms(), molecule.Atoms[1], molecule.Atoms[0]);

            ligands = new ILigand[] { ligand1, ligand2, ligand3, ligand4 };
            return(ligands);
        }
コード例 #2
0
ファイル: CIPToolTest.cs プロジェクト: roddickchen/NCDK
        private static IReadOnlyList <ILigand> MakeLigands()
        {
            molecule = smiles.ParseSmiles("ClC(Br)(I)[H]");
            var visitedAtoms = new VisitedAtoms();
            var ligand1      = new Ligand(molecule, visitedAtoms, molecule.Atoms[1], molecule.Atoms[4]);
            var ligand2      = new Ligand(molecule, visitedAtoms, molecule.Atoms[1], molecule.Atoms[3]);
            var ligand3      = new Ligand(molecule, visitedAtoms, molecule.Atoms[1], molecule.Atoms[2]);
            var ligand4      = new Ligand(molecule, visitedAtoms, molecule.Atoms[1], molecule.Atoms[0]);

            return(new ILigand[] { ligand1, ligand2, ligand3, ligand4 });
        }
コード例 #3
0
        public void TestVisitedTracking()
        {
            var smiles   = CDK.SmilesParser;
            var molecule = smiles.ParseSmiles("ClC(Br)(I)[H]");

            var ligand = new Ligand(molecule, new VisitedAtoms(), molecule.Atoms[1], molecule.Atoms[0]);

            Assert.IsTrue(ligand.VisitedAtoms.IsVisited(molecule.Atoms[1]));
            Assert.IsTrue(ligand.IsVisited(molecule.Atoms[1]));
            Assert.IsFalse(ligand.VisitedAtoms.IsVisited(molecule.Atoms[0]));
            Assert.IsFalse(ligand.IsVisited(molecule.Atoms[0]));
        }
コード例 #4
0
        public void TestConstructorAndGetMethods()
        {
            var smiles   = CDK.SmilesParser;
            var molecule = smiles.ParseSmiles("ClC(Br)(I)[H]");

            var ligand = new Ligand(molecule, new VisitedAtoms(), molecule.Atoms[1], molecule.Atoms[0]);

            Assert.IsNotNull(ligand);
            Assert.AreEqual(molecule, ligand.AtomContainer);
            Assert.AreEqual(molecule.Atoms[1], ligand.CentralAtom);
            Assert.AreEqual(molecule.Atoms[0], ligand.LigandAtom);
        }