Esempio n. 1
0
        public virtual void TestGetStrands()
        {
            IBioPolymer oBioPolymer = (IBioPolymer)NewChemObject();
            IStrand     oStrand1    = oBioPolymer.Builder.NewStrand();
            IStrand     oStrand2    = oBioPolymer.Builder.NewStrand();

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

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

            oMono2.MonomerName = "GLY123";
            IAtom oAtom1 = oBioPolymer.Builder.NewAtom("C");
            IAtom oAtom2 = oBioPolymer.Builder.NewAtom("C");

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

            Assert.IsTrue(Compares.AreDeepEqual(strands, oBioPolymer.GetStrandMap()));
        }
Esempio n. 2
0
        public void TestCreateProtein()
        {
            IBioPolymer protein = ProteinBuilderTool.CreateProtein("GAGA", CDK.Builder);

            Assert.IsNotNull(protein);
            Assert.AreEqual(4, protein.GetMonomerMap().Count());
            Assert.AreEqual(1, protein.GetStrandMap().Count());
            Assert.AreEqual(18 + 1, protein.Atoms.Count);
            // 1=terminal oxygen
            Assert.AreEqual(14 + 3 + 1, protein.Bonds.Count);
            // 3 = extra back bone bonds, 1=bond to terminal oxygen
        }
Esempio n. 3
0
        public virtual void TestGetStrandCount()
        {
            IBioPolymer oBioPolymer = (IBioPolymer)NewChemObject();
            IStrand     oStrand1    = oBioPolymer.Builder.NewStrand();

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

            oMono1.MonomerName = "TRP279";
            IAtom oAtom1 = oBioPolymer.Builder.NewAtom("C");

            oBioPolymer.AddAtom(oAtom1, oMono1, oStrand1);

            Assert.AreEqual(1, oBioPolymer.GetStrandMap().Count());
        }
Esempio n. 4
0
        private static List <IMonomer> GetMonomers(IBioPolymer iBioPolymer)
        {
            var monomList = new List <IMonomer>();

            var strands    = iBioPolymer.GetStrandMap();
            var strandKeys = strands.Keys;

            foreach (var key in strandKeys)
            {
                var aStrand = strands[key];
                var tmp     = aStrand.GetMonomerMap();
                var keys    = tmp.Keys;
                foreach (var o1 in keys)
                {
                    monomList.Add(tmp[o1]);
                }
            }

            return(monomList);
        }