Пример #1
0
        /*
        ** Will run a user defined PDB through barrelEllipse, createing
        ** PDBs and CGOs helpful for determining if a successful betaBarrel
        ** was created by the program
        */
        static public void testEllipseSinglePDB()
        {
            Stopwatch stopWatch = new Stopwatch();
            string    elapsedTime;
            TimeSpan  ts;


            Console.WriteLine("Enter pdb:");
            string pdb = Console.ReadLine();

            string IN_FILE = Global.DB_DIR + pdb + ".pdb";

            OUTPUT_PATH = Global.OUTPUT_DIR + "ellipse/";
            SharedFunctions.create_dir(Global.OUTPUT_DIR + "ellipse");

            stopWatch.Start();

            if (File.Exists(IN_FILE))
            {
                ts          = stopWatch.Elapsed;
                elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
                Console.WriteLine("RunTime " + elapsedTime);
                BarrelEllipse newBarrel = new BarrelEllipse(pdb);
            }
            else
            {
                Console.WriteLine("I am in {0}", System.IO.Directory.GetCurrentDirectory());
                Console.WriteLine("could not open {0}", IN_FILE);
                Console.ReadLine();
            }

            ts          = stopWatch.Elapsed;
            elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
            Console.WriteLine("RunTime " + elapsedTime);
        }
Пример #2
0
        static void Main(string[] args)
        {
            DateTime startTime = DateTime.Now;
            string   choice    = "";

            while (choice != "10")
            {
                menu();
                choice = Console.ReadLine();
                switch (choice)
                {
                case "1":
                    BarrelEllipse.testEllipseSinglePDB();
                    break;

                case "2":
                    BarrelEllipse.runEllipseData();
                    break;

                case "3":
                    Data.getData();
                    break;

                case "4":
                    AlignPDB testAlign = new AlignPDB();
                    break;

                case "5":
                    run();
                    break;

                case "6":

                    break;

                case "7":

                    break;

                case "8":

                    break;

                case "9":
                    PDBInfo testInfo = new PDBInfo();
                    break;

                default:
                    //10. Quit
                    choice = "10";
                    break;
                }
            }


            Console.WriteLine("Program took from: \n start: {0} \n   end: {1}", startTime, DateTime.Now);

            return;
        }
Пример #3
0
        /*
        **
        */
        static public void runEllipseData()
        {
            Stopwatch stopWatch = new Stopwatch();
            string    elapsedTime;
            TimeSpan  ts;
            string    file;

            Console.WriteLine("Mono or Poly?(m/p)");
            string input = Console.ReadLine();

            if (input == "m")
            {
                DB_FILE     = Global.MACMONODBDIR;
                OUTPUT_PATH = Global.MONO_OUTPUT_DIR + "ellipse\\";
            }
            else
            {
                DB_FILE     = Global.MACPOLYDBDIR;
                OUTPUT_PATH = Global.POLY_OUTPUT_DIR + "ellipse\\";
            }

            stopWatch.Start();
            file = OUTPUT_PATH + "ELLIPSE_RESULTS.txt";
            using (System.IO.StreamWriter output = new System.IO.StreamWriter(file))
            {
                output.Write("\tProtein:\tAngle Between Ellipsis\tTop Eccentricity:\tBottom Eccentricity:\tTop Deviation:\tBottom Deviation:");
            }


            if (File.Exists(DB_FILE))
            {
                using (StreamReader sr = new StreamReader(DB_FILE))
                {
                    String line;

                    while ((line = sr.ReadLine()) != null)
                    {
                        string[] splitLine = line.Split(new char[] { ' ', '\t', ',' });
                        string   pdb       = splitLine[0];
                        ts          = stopWatch.Elapsed;
                        elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
                        Console.WriteLine("RunTime " + elapsedTime);
                        BarrelEllipse newBarrel = new BarrelEllipse(pdb);
                        newBarrel.EllipseResults(pdb);
                    }
                }
            }
            else
            {
                Console.WriteLine("I am in {0}", System.IO.Directory.GetCurrentDirectory());
                Console.WriteLine("could not open {0}", DB_FILE);
                Console.ReadLine();
            }

            ts          = stopWatch.Elapsed;
            elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
            Console.WriteLine("RunTime " + elapsedTime);
        }
Пример #4
0
        static void Main(string[] args)
        {
            DateTime startTime = DateTime.Now;
            string   choice    = "";

            while (choice != "7")
            {
                menu();
                choice = Console.ReadLine();
                switch (choice)
                {
                case "1":
                    RunPolarBearal();
                    break;

                case "2":
                    CreateBetaBarrelProtein();
                    break;

                case "3":
                    startSolubleBarrel();
                    break;

                case "4":
                    startPolyBarrel();
                    break;

                case "5":
                    BarrelEllipse.testEllipseSinglePDB();
                    break;
                }
            }


            Console.WriteLine("Program took from: \n start: {0} \n   end: {1}", startTime, DateTime.Now);

            return;
        }
Пример #5
0
        static public void run_HighLowData()
        {
            Console.WriteLine("Starting highLowRes");
            string file = @"highLowRes.txt";

            using (System.IO.StreamWriter output = new System.IO.StreamWriter(Global.OUTPUT_DIR + file))
            {
                output.Write("\n{0}\t{1}\t{2}\t{3}\t{4}\t{5}", "pdb", "StrandNum", "ThreeLetCode", "ResNum", "Z", "high/low");
            }

            string fileOfPDBs = Global.DB_file; //input file with list of monomeric xml files

            if (File.Exists(fileOfPDBs))
            {
                using (StreamReader sr = new StreamReader(fileOfPDBs))
                {
                    String line;
                    while ((line = sr.ReadLine()) != null)
                    {
                        string[] splitLine = Array.FindAll <string>(((string)line).Split(
                                                                        new char[] { ' ', '\t', ',' }), delegate(string s) { return(!String.IsNullOrEmpty(s)); });
                        string pdb = splitLine[0];
                        if (pdb != "IDs")
                        {
                            Console.WriteLine("running {0}", pdb);
                            //string fileName = pdb.Substring(0, 4).ToUpper();
                            BarrelEllipse newBarrel = new BarrelEllipse(pdb);
                        }
                    }
                }
            }
            else
            {
                Console.WriteLine("could not open {0}", fileOfPDBs);
                Console.ReadLine();
            }
        }
Пример #6
0
        static void Main(string[] args)
        {
            DateTime startTime = DateTime.Now;
            //using (StreamWriter log = File.AppendText(Global.OUTPUT_DIR + "log.txt"))
            //{
            //    log.WriteLine("working with db ({0})", DateTime.Now);
            //    //log.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}", "PdbName", "Success", "barrelType", "chainID", "numberOfStrands");
            //}

            string choice = "";

            string method_input = "3";
            string use_method   = "all";

            while (choice != "10")
            {
                Display_menu();
                choice = Console.ReadLine();
                switch (choice)
                {
                case "1":
                    // Test B-Barrel: check if a specific PDB can have its barrel read in and works
                    BarrelStructures.Protein _protein = null;
                    BarrelStructures.Barrel  _barrel  = null;
                    Console.WriteLine("Enter pdb:");
                    string PDBid = Console.ReadLine();

                    Console.WriteLine("Enter method (1=mono, 2=poly, default=all):");
                    method_input = Console.ReadLine();
                    use_method   = "all";
                    if (method_input == "1")
                    {
                        use_method = "mono";
                    }
                    if (method_input == "2")
                    {
                        use_method = "poly";
                    }
                    Console.WriteLine("Attempting to run {0} with {1} code.  Output will be in \n{2}", PDBid, use_method, Global.OUTPUT_DIR);

                    // change method from mono depending on wht method you want to use
                    runThisBetaBarrel(PDBid, use_method, ref _barrel, ref _protein);
                    break;

                case "2":
                    BarrelEllipse.testEllipseSinglePDB();
                    //BarrelEllipse.runEllipseData();
                    break;

                case "3":
                    Global.change_dataset();
                    Console.WriteLine("Using dataset in the file: {0}", Global.DB_file);
                    Console.WriteLine("Reading input files from: {0}", Global.DB_DIR);
                    Console.WriteLine("Writing output files to: {0}", Global.OUTPUT_DIR);
                    using (StreamWriter log = File.AppendText(Global.OUTPUT_DIR + "log.txt")) log.WriteLine("working with db ({0})", DateTime.Now);
                    break;

                case "4":
                    //AlignPDB testAlign = new AlignPDB();
                    break;

                case "5":
                    PolarBearal.RunPolarBearal();
                    break;

                case "6":
                    Console.WriteLine("This has not been checked in a bit.  Proceed with caution");

                    Console.WriteLine("Enter method (1=mono, 2=poly, default=all):");
                    method_input = Console.ReadLine();
                    use_method   = "all";
                    if (method_input == "1")
                    {
                        use_method = "mono";
                    }
                    if (method_input == "2")
                    {
                        use_method = "poly";
                    }
                    Console.WriteLine("Using {1} code.  Output will be in \n{2}", use_method, Global.OUTPUT_DIR);
                    SharedFunctions.RunCbeta2Axis(use_method);
                    break;

                case "7":
                    Console.WriteLine("This has not been checked in a bit.  Proceed with caution");

                    Console.WriteLine("Enter method (1=mono, 2=poly, default=all):");
                    method_input = Console.ReadLine();
                    use_method   = "all";
                    if (method_input == "1")
                    {
                        use_method = "mono";
                    }
                    if (method_input == "2")
                    {
                        use_method = "poly";
                    }
                    Console.WriteLine("Using {1} code.  Output will be in \n{2}", use_method, Global.OUTPUT_DIR);
                    SharedFunctions.run_Centroids(use_method);
                    break;

                case "8":
                    Console.WriteLine("This has not been checked in a bit.  Proceed with caution");
                    BarrelEllipse.run_HighLowData();
                    break;

                case "9":
                    PDBInfo testInfo = new PDBInfo();
                    break;

                default:
                    using (StreamWriter log = File.AppendText(Global.OUTPUT_DIR + "log.txt"))
                    {
                        log.WriteLine("ended program at {0} \n\n", DateTime.Now);
                    }
                    //10. Quit
                    choice = "10";
                    break;
                }
            }


            Console.WriteLine("Program took from: \n start: {0} \n   end: {1}", startTime, DateTime.Now);

            return;
        }