Esempio n. 1
0
        public static SBarrel runSolBarrel(string pdb, ref Dictionary <string, AminoAcid> _aaDict, ref Dictionary <Tuple <string, string>, double> partialChargesDict)
        {
            Directory.SetCurrentDirectory(Global.SOL_DB_DIR);

            string fileName2 = pdb + ".pdb";

            Console.WriteLine("opened {0}", fileName2);
            AtomParser.AtomCategory myAtomCat = new AtomParser.AtomCategory();
            myAtomCat = readPdbFile(fileName2, ref partialChargesDict);

            string pdbName = pdb.Substring(0, 4).ToUpper();

            int chainNum = 0;
            //if (pdbName == "3RFZ" || pdbName == "3KVN") chainNum = 1;

            int stop = myAtomCat.ChainAtomList.Count();

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

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

            //Console.WriteLine("ChainNum {0}", chainNum);

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

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

            return(myBarrel);
        }
Esempio n. 2
0
        static public void startSolubleBarrel()
        {
            //for making barrel
            Dictionary <string, int> pdbBeta = new Dictionary <string, int>();

            //PDBIDs that will be run
            string fileOfPDBs = Global.SOL_DB_DIR + "Thornton1989.txt"; //input file with list of pdb files

            if (File.Exists(fileOfPDBs))
            {
                using (StreamReader sr = new StreamReader(fileOfPDBs))
                {
                    String line;
                    string fileLocation2 = Global.SOL_OUTPUT_DIR + "AllSolubleChar.txt";
                    using (System.IO.StreamWriter file = new System.IO.StreamWriter(fileLocation2))
                    {
                        string newLine = "PDB" + "\t\t" + "Total Chains" + "\t" + "Total Strands" + "\t" + "Length" + "\t" + "AvgLength" + "\t" + "MinLength" + "\t" + "MaxLength";
                        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")
                            {
                                SBarrel myBarrel = runSolBarrel(pdb, ref Global.AADict, ref Global.partialChargesDict);

                                /*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 char4 = myBarrel.protoBarrel.Count().ToString();
                                 * string char5 = myBarrel.Strands.Count().ToString();
                                 * newLine = char1 + "\t" + char4 + "\t" + char5 + "\t" + char2 + "\t" + char7 + "\t" + char8 + "\t" + char9 + "\t" + char3 + "\t" + char6;
                                 * file.WriteLine(newLine);*/
                            }
                        }
                    }
                }
            }
            else
            {
                Console.WriteLine("could not open {0}", fileOfPDBs);
                Console.ReadLine();
            }
        }