示例#1
0
            public static void Align(List <Pdb.Atom> atoms1, ref List <Pdb.Atom> atoms2)
            {
                PdbStatic.SelectCommonAtoms(ref atoms1, ref atoms2);
                List <Vector> coords1 = atoms1.ListCoord();
                List <Vector> coords2 = atoms2.ListCoord();

                Trans3        trans    = GetTrans(coords1, coords2);
                List <Vector> coords2a = new List <Vector>(trans.GetTransformed(coords2));

                atoms2 = atoms2.CloneByUpdateCoord(coords2a);
            }
        public static void SelectCommonAtoms <Atom>(IList <Atom> pdb1_atoms, string ChainIDs1, out List <Atom> atoms1
                                                    , IList <Atom> pdb2_atoms, string ChainIDs2, out List <Atom> atoms2
                                                    )
            where Atom : IAtom
        {
            HDebug.Assert(ChainIDs1.Length == ChainIDs2.Length);

            atoms1 = new List <Atom>();
            atoms2 = new List <Atom>();

            for (int i = 0; i < ChainIDs1.Length; i++)
            {
                char        ChainID1 = ChainIDs1[i];
                char        ChainID2 = ChainIDs2[i];
                List <Atom> latoms1  = new List <Atom>(pdb1_atoms.SelectByChainID(ChainID1).SelectByAltLoc());
                List <Atom> latoms2  = new List <Atom>(pdb2_atoms.SelectByChainID(ChainID2).SelectByAltLoc());
                PdbStatic.SelectCommonAtoms(ref latoms1, ref latoms2);
                atoms1.AddRange(latoms1);
                atoms2.AddRange(latoms2);
            }
        }