Ejemplo n.º 1
0
        public static Barrel runBetaBarrel(string pdb, ref Dictionary <string, AminoAcid> _aaDict, ref Dictionary <Tuple <string, string>, double> partialChargesDict)
        {
            Directory.SetCurrentDirectory(Global.MONO_DB_DIR);

            string PDB         = pdb.Substring(0, 4).ToUpper();
            string pdbFileName = PDB + ".pdb";

            AtomParser.AtomCategory myAtomCat = new AtomParser.AtomCategory();

            if (File.Exists(pdbFileName))
            {
                Console.WriteLine("opened {0}", pdbFileName);
                myAtomCat = readPdbFile(pdbFileName, ref Global.partialChargesDict);
            }

            int chainNum = 0;

            int stop = myAtomCat.ChainAtomList.Count();

            Console.Write("Protein Class {0}", chainNum);

            Protein newProt = new MonoProtein(ref myAtomCat, chainNum, PDB);

            Console.Write("creating barrel class..");

            Barrel myBarrel = new MonoBarrel(newProt.Chains[0], newProt);

            return(myBarrel);
        }
Ejemplo n.º 2
0
        public static void run()
        {
            /*string head = Global.DB_DIR;
             * head = "U:\\v5\\pdb_files";
             * string tail = ".pdb";
             * Console.WriteLine("head: " + head);
             * Console.WriteLine("tail: " + tail);
             * String[] files = Directory.GetFiles(head);
             */
            string fileOfPDBs = "U:/v4/MonoDBList_v4_85.txt";

            string[]      pdb_files;
            List <String> files = new List <String>();

            if (File.Exists(fileOfPDBs))
            {
                using (StreamReader sr = new StreamReader(fileOfPDBs))
                {
                    String line;
                    while ((line = sr.ReadLine()) != null)
                    {
                        files.Add(line);
                    }
                }
            }
            foreach (String f in files)
            {
                //Console.Write(f);


                Protein m_Protein = null;
                Barrel  m_Barrel  = null;
                AtomParser.AtomCategory myAtomCat = new AtomParser.AtomCategory();
                ////Console.WriteLine("opened {0}", pdbFileName);
                try
                {
                    string head    = Global.DB_DIR;
                    string pattern = f + "*";
                    pdb_files = Directory.GetFiles(head, pattern);
                    //Console.WriteLine(pdb_files);
                    string pdb_file = pdb_files[0];

                    string pdb = f;

                    myAtomCat = Program.readPdbFile(pdb_file, ref Global.partialChargesDict);
                    int chainNum = 0;

                    int stop = myAtomCat.ChainAtomList.Count();
                    ////Console.Write("Protein Class {0}", chainNum);


                    Console.WriteLine(pdb_file);
                    m_Protein = new MonoProtein(ref myAtomCat, chainNum, pdb);

                    ////Console.Write("creating barrel class..");

                    m_Barrel = new MonoBarrel(m_Protein.Chains[0], m_Protein);



                    SharedFunctions.writePymolScriptForStrands(m_Barrel.Strands, Global.OUTPUT_DIR, Global.DB_DIR, pdb);
                }

                catch (Exception e)
                {
                }
            }
        }
Ejemplo n.º 3
0
        public static void runThisBetaBarrel(string pdb, string method, ref Barrel ThisBarrel, ref Protein newProt)
        {
            string PDB         = pdb.Substring(0, 4).ToUpper();
            string pdbFileName = Global.DB_DIR + pdb + ".pdb";

            if (File.Exists(pdbFileName))
            {
                AtomParser.AtomCategory myAtomCat = new AtomParser.AtomCategory();
                //Console.WriteLine("opened {0}", pdbFileName);
                myAtomCat = Program.ReadPdbFile(pdbFileName, ref Global.partialChargesDict);
                Console.WriteLine("\nAttempting {0}", pdb);
                // use poly method
                if ("poly" == method)
                {
                    try
                    {
                        Console.WriteLine("Generating poly protein");
                        Poly.PolyProtein newPolyProt = new Poly.PolyProtein(ref myAtomCat, pdb);
                        Console.WriteLine("Generating poly barrel");
                        ThisBarrel = new Poly.PolyBarrel(ref newPolyProt);
                        newProt    = newPolyProt;
                    }
                    catch
                    {
                        Console.WriteLine("Failed to run {0} using the poly methods\n", pdb);
                    }
                }
                // use all method
                else if ("all" == method)
                {
                    try //if (File.Exists(pdbFileName))
                    {
                        Console.WriteLine("all method for protein...");
                        newProt = new AllProtein(ref myAtomCat, PDB);
                        Console.WriteLine("all method for barrel...");
                        ThisBarrel = new AllBarrel(ref newProt);
                    }
                    catch
                    {
                        Console.WriteLine("Failed to run {0} using the all methods\n", pdb);
                    }
                }
                // default to mono method
                else //if ("mono" == method)
                {
                    try
                    {
                        Console.WriteLine("Generating mono protein");
                        newProt = new MonoProtein(ref myAtomCat, 0, PDB);
                        Console.WriteLine("Generating mono barrel");
                        ThisBarrel = new MonoBarrel(newProt.Chains[0], newProt);
                    }
                    catch
                    {
                        Console.WriteLine("Failed to run {0} using the mono methods\n", pdb);
                    }
                }
            }
            else
            {
                Console.WriteLine("could not find {0}", pdbFileName);
            }
        }