Beispiel #1
0
        static public void startPolyBarrel()
        {
            //for making barrel
            Dictionary <string, int> pdbBeta = new Dictionary <string, int>();

            //PDBIDs that will be run
            string fileOfPDBs = Global.POLY_DB_DIR + "PolyDBList.txt"; //input file with list of polymeric xml files

            if (File.Exists(fileOfPDBs))
            {
                using (StreamReader sr = new StreamReader(fileOfPDBs))
                {
                    String line;
                    string fileLocation2 = Global.POLY_OUTPUT_DIR + "AllBarrelChar.txt";
                    using (System.IO.StreamWriter file = new System.IO.StreamWriter(fileLocation2))
                    {
                        string newLine = "PDB" + "\t\t" + "Length" + "\t" + "AvgLength" + "\t" + "MinLength" + "\t" + "MaxLength" + "\t" + "Radius" + "\t\t" + "Total Chains" + "\t" + "Total Strands" + "\t" + "Barrel Tilt";
                        file.WriteLine(newLine);
                        // Read and display lines from the file until the end of the file is reached.
                        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")
                            {
                                PolyBarrel myBarrel = runPBetaBarrel(pdb, ref Global.AADict);
                                string     char1    = myBarrel.PdbName;
                                string     char2    = myBarrel.Axis.Length.ToString();
                                string     char7    = myBarrel.StrandLength.Average().ToString();
                                string     char8    = myBarrel.StrandLength.Min().ToString();
                                string     char9    = myBarrel.StrandLength.Max().ToString();
                                string     char3    = myBarrel.AvgRadius.ToString();
                                string     char4    = myBarrel.protoBarrel.Count().ToString();
                                string     char5    = myBarrel.Strands.Count().ToString();
                                string     char6    = myBarrel.AvgTilt.ToString();
                                newLine = char1 + "\t" + char2 + "\t" + char7 + "\t" + char8 + "\t" + char9 + "\t" + char3 + "\t" + char4 + "\t" + char5 + "\t" + char6;
                                file.WriteLine(newLine);
                            }
                        }
                    }
                }
            }
            else
            {
                Console.WriteLine("could not open {0}", fileOfPDBs);
                Console.ReadLine();
            }
        }
Beispiel #2
0
        public static PolyBarrel runPBetaBarrel(string pdb, ref Dictionary <string, AminoAcid> _aaDict)
        {
            Directory.SetCurrentDirectory(Global.POLY_DB_DIR);

            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);
            }

            PolyProtein newProt = new PolyProtein(ref myAtomCat, pdb); //For considering all chains

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

            PolyBarrel myBarrel = new PolyBarrel(newProt, Global.POLY_OUTPUT_DIR, Global.POLY_DB_DIR);

            return(myBarrel);
        }