예제 #1
0
        public override void TestGetMonomerCount()
        {
            IPDBPolymer pdbPolymer = (IPDBPolymer)NewChemObject();

            Assert.AreEqual(0, pdbPolymer.GetMonomerMap().Count());

            IStrand oStrand1 = pdbPolymer.Builder.NewStrand();

            oStrand1.StrandName = "A";
            IStrand oStrand2 = pdbPolymer.Builder.NewStrand();

            oStrand2.StrandName = "B";
            IMonomer oMono1 = pdbPolymer.Builder.NewMonomer();

            oMono1.MonomerName = "TRP279";
            IMonomer oMono2 = pdbPolymer.Builder.NewMonomer();

            oMono2.MonomerName = "HOH";
            IPDBAtom oPDBAtom1 = pdbPolymer.Builder.NewPDBAtom("C");
            IPDBAtom oPDBAtom2 = pdbPolymer.Builder.NewPDBAtom("C");
            IPDBAtom oPDBAtom3 = pdbPolymer.Builder.NewPDBAtom("C");

            pdbPolymer.Add(oPDBAtom1);
            pdbPolymer.AddAtom(oPDBAtom2, oMono1, oStrand1);
            pdbPolymer.AddAtom(oPDBAtom3, oMono2, oStrand2);
            Assert.IsNotNull(pdbPolymer.Atoms[0]);
            Assert.IsNotNull(pdbPolymer.Atoms[1]);
            Assert.IsNotNull(pdbPolymer.Atoms[2]);
            Assert.AreEqual(oPDBAtom1, pdbPolymer.Atoms[0]);
            Assert.AreEqual(oPDBAtom2, pdbPolymer.Atoms[1]);
            Assert.AreEqual(oPDBAtom3, pdbPolymer.Atoms[2]);

            Assert.AreEqual(2, pdbPolymer.GetMonomerMap().Count());
        }
예제 #2
0
        public override void TestGetStrands()
        {
            IPDBPolymer pdbPolymer = (IPDBPolymer)NewChemObject();
            IStrand     oStrand1   = pdbPolymer.Builder.NewStrand();
            IStrand     oStrand2   = pdbPolymer.Builder.NewStrand();

            oStrand1.StrandName = "A";
            oStrand2.StrandName = "B";
            IMonomer oMono1 = pdbPolymer.Builder.NewMonomer();

            oMono1.MonomerName = "TRP279";
            IMonomer oMono2 = pdbPolymer.Builder.NewMonomer();

            oMono2.MonomerName = "GLY123";
            IPDBAtom oPDBAtom1 = pdbPolymer.Builder.NewPDBAtom("C");
            IPDBAtom oPDBAtom2 = pdbPolymer.Builder.NewPDBAtom("C");

            pdbPolymer.AddAtom(oPDBAtom1, oMono1, oStrand1);
            pdbPolymer.AddAtom(oPDBAtom2, oMono2, oStrand2);
            IDictionary <string, IStrand> strands = new Dictionary <string, IStrand>
            {
                { "A", oStrand1 },
                { "B", oStrand2 }
            };

            Assert.IsTrue(Compares.AreDeepEqual(strands, pdbPolymer.GetStrandMap()));
        }
예제 #3
0
        public override void TestGetMonomer_String_String()
        {
            IPDBPolymer pdbPolymer = (IPDBPolymer)NewChemObject();

            IStrand oStrand1 = pdbPolymer.Builder.NewStrand();

            oStrand1.StrandName = "A";
            IStrand oStrand2 = pdbPolymer.Builder.NewStrand();

            oStrand2.StrandName = "B";
            IMonomer oMono1 = pdbPolymer.Builder.NewMonomer();

            oMono1.MonomerName = "TRP279";
            IMonomer oMono2 = pdbPolymer.Builder.NewMonomer();

            oMono2.MonomerName = "HOH";
            IPDBAtom oPDBAtom1 = pdbPolymer.Builder.NewPDBAtom("C");
            IPDBAtom oPDBAtom2 = pdbPolymer.Builder.NewPDBAtom("C");
            IPDBAtom oPDBAtom3 = pdbPolymer.Builder.NewPDBAtom("C");

            pdbPolymer.AddAtom(oPDBAtom1, oMono1, oStrand1);
            pdbPolymer.AddAtom(oPDBAtom2, oMono1, oStrand1);
            pdbPolymer.AddAtom(oPDBAtom3, oMono2, oStrand2);

            Assert.AreEqual(oMono1, pdbPolymer.GetMonomer("TRP279", "A"));
            Assert.AreEqual(oMono2, pdbPolymer.GetMonomer("HOH", "B"));
        }
예제 #4
0
        public virtual void TestAddAtom_IPDBAtom_IMonomer_IStrand()
        {
            IPDBPolymer pdbPolymer = (IPDBPolymer)NewChemObject();
            IStrand     oStrand1   = pdbPolymer.Builder.NewStrand();

            oStrand1.StrandName = "A";
            IPDBMonomer oMono1 = pdbPolymer.Builder.NewPDBMonomer();

            oMono1.MonomerName = "TRP279";
            IPDBAtom oPDBAtom1 = pdbPolymer.Builder.NewPDBAtom("C");
            IPDBAtom oPDBAtom2 = pdbPolymer.Builder.NewPDBAtom("C");
            IPDBAtom oPDBAtom3 = pdbPolymer.Builder.NewPDBAtom("C");

            pdbPolymer.AddAtom(oPDBAtom1, oStrand1);
            pdbPolymer.AddAtom(oPDBAtom2, oStrand1);
            pdbPolymer.AddAtom(oPDBAtom3, oMono1, oStrand1);

            Assert.AreEqual(2, pdbPolymer.GetMonomer("", "A").Atoms.Count);
            Assert.AreEqual(1, pdbPolymer.GetMonomer("TRP279", "A").Atoms.Count);
            Assert.AreEqual(3, pdbPolymer.Atoms.Count);
        }
예제 #5
0
        public override void TestGetStrand_String()
        {
            IPDBPolymer pdbPolymer = (IPDBPolymer)NewChemObject();
            IStrand     oStrand1   = pdbPolymer.Builder.NewStrand();

            oStrand1.StrandName = "A";
            IMonomer oMono1 = pdbPolymer.Builder.NewMonomer();

            oMono1.MonomerName = "TRP279";
            IPDBAtom oPDBAtom1 = pdbPolymer.Builder.NewPDBAtom("C");

            pdbPolymer.AddAtom(oPDBAtom1, oMono1, oStrand1);

            Assert.AreEqual(oStrand1, pdbPolymer.GetStrand("A"));
        }
예제 #6
0
        public override void TestRemoveStrand_String()
        {
            IPDBPolymer pdbPolymer = (IPDBPolymer)NewChemObject();
            IStrand     oStrand1   = pdbPolymer.Builder.NewStrand();

            oStrand1.StrandName = "A";
            IMonomer oMono1 = pdbPolymer.Builder.NewMonomer();

            oMono1.MonomerName = "TRP279";
            IPDBAtom oPDBAtom1 = pdbPolymer.Builder.NewPDBAtom("C");

            pdbPolymer.AddAtom(oPDBAtom1, oMono1, oStrand1);

            Assert.IsTrue(pdbPolymer.GetStrandNames().Contains(oStrand1.StrandName));
            Assert.AreEqual(1, pdbPolymer.Atoms.Count);
            pdbPolymer.RemoveStrand("A");
            Assert.IsFalse(pdbPolymer.GetStrandNames().Contains(oStrand1.StrandName));
            Assert.AreEqual(0, pdbPolymer.Atoms.Count);
        }