Ejemplo n.º 1
0
            public static HMutation FromPdb
                (Pdb wtpdb, Pdb mutpdb
                , string wt_pdbid   = null, string mut_pdbid    = null
                , int?wt_pdb_model  = null, char?wt_pdb_altLoc  = null, char?wt_pdb_chainID  = null, char?wt_pdb_iCode  = null
                , int?mut_pdb_model = null, char?mut_pdb_altLoc = null, char?mut_pdb_chainID = null, char?mut_pdb_iCode = null
                )
            {
                if ((wtpdb.models.Length >= 2) && wt_pdb_model == null)
                {
                    wt_pdb_model = 0;
                }                                                                             // HDebug.Assert(false);
                if ((mutpdb.models.Length >= 2) && mut_pdb_model == null)
                {
                    mut_pdb_model = 0;
                }                                                                             // HDebug.Assert(false);

                Pdb.Atom[]            wt_atoms      = wtpdb.SelectAtoms(imodel: wt_pdb_model, altLoc: wt_pdb_altLoc, chainID: wt_pdb_chainID, iCode: wt_pdb_iCode);
                Pdb.Atom[]            mut_atoms     = mutpdb.SelectAtoms(imodel: mut_pdb_model, altLoc: mut_pdb_altLoc, chainID: mut_pdb_chainID, iCode: mut_pdb_iCode);
                Pdb.Residue[]         wt_resis      = wt_atoms.ListResidue();
                Pdb.Residue[]         mut_resis     = mut_atoms.ListResidue();
                Tuple <string, int>[] wt_resn_resi  = wt_resis.HListResNameSeq();
                Tuple <string, int>[] mut_resn_resi = mut_resis.HListResNameSeq();

                Tuple <string, string, int, string>[] mutationinfos =
                    FromResnResi
                        (wt_resn_resi
                        , mut_resn_resi
                        , rngLcsLen: new Tuple <int, int>((int)(wt_resis.Length * 0.8), (int)(wt_resis.Length * 1.2))
                        );

                return(new HMutation
                {
                    wt_pdb = wtpdb, mut_pdb = mutpdb,
                    wt_pdbid = wt_pdbid, mut_pdbid = mut_pdbid,
                    wt_ResSeq = wt_resis.HListResSeq(), mut_ResSeq = mut_resis.HListResSeq(),
                    wt_ResName = wt_resis.HListResName(), mut_ResName = mut_resis.HListResName(),
                    wt_pdb_model = wt_pdb_model, mut_pdb_model = mut_pdb_model,
                    wt_pdb_altLoc = wt_pdb_altLoc, mut_pdb_altLoc = mut_pdb_altLoc,
                    wt_pdb_chainID = wt_pdb_chainID, mut_pdb_chainID = mut_pdb_chainID,
                    wt_pdb_iCode = wt_pdb_iCode, mut_pdb_iCode = mut_pdb_iCode,
                    mutationinfos = mutationinfos
                });
            }