public static void Run()
        {
            Console.WriteLine("Parsing PBD File");

            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();
            PrimaryStructure model = PDBStructureParser.GetPrimaryStructure(inputFilePath + inputFileName);

            stopWatch.Stop();

            Console.WriteLine("Structure Parsing Complete [" + stopWatch.ElapsedMilliseconds + " ms]");
            Console.WriteLine("Atom Count: " + model.Atoms().Count);

            Console.WriteLine("Running Stride Analysis");

            stopWatch = new Stopwatch();
            stopWatch.Start();

            StrideAnalysis     stride    = new StrideAnalysis(exePath);
            SecondaryStructure structure = stride.GetSecondaryStructure(inputFilePath + inputFileName);

            // Console.WriteLine("Secondary structure:\n\n" + structure);

            stopWatch.Stop();
            Console.WriteLine("Processing complete [" + stopWatch.ElapsedMilliseconds + " ms]");

            Console.WriteLine("End Testing Stride");

            foreach (Chain chain in model.Chains())
            {
                Console.WriteLine("Chain ID: " + chain.ID);

                if (chain.ResidueType != StandardResidue.AminoAcid)
                {
                    Console.WriteLine("Not a protein chain");
                    continue;
                }

                foreach (Residue residue in chain.MainChainResidues)
                {
                    if (residue.CarbonylOxygen == null)
                    {
                        Console.WriteLine("Residue ID: " + residue.ID + " has no oxygen");
                    }

                    SecondaryStructureInfomation structureInfo = structure.GetStructureInformation(residue.Index);

                    if (structureInfo == null)
                    {
                        Console.WriteLine("Couldn't find structure info for residue index: " + residue.Index);
                    }
                    else
                    {
                        Console.WriteLine("Residue [" + residue.ID + "][" + residue.Name + "] has structure [" + structureInfo.ToString() + "] and Alpha Carbon: " + residue.AlphaCarbon);
                    }
                }
            }
        }
Example #2
0
        public static void Run()
        {
            Console.WriteLine("Parsing PDB File");
            PrimaryStructure primaryStructure = PDBStructureParser.GetPrimaryStructure(inputFilePath + inputFileName);

            // dump structure to PDB file. Can check this file against the original input file for equivalence
            string tmpFileName             = tmpFilePath + @"tempStructure.pdb";
            PDBStructureCreator pdbCreator = new PDBStructureCreator(primaryStructure, null);

            pdbCreator.CreatePDBFile(tmpFileName, true, true);
            // FileUtil.DeleteFile(tmpFileName);
        }
        public static void Run()
        {
            Console.WriteLine("Parsing PDB File");

            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();
            PrimaryStructure primaryStructure = PDBStructureParser.GetPrimaryStructure(filepath + structureFile);

            stopWatch.Stop();

            Console.WriteLine("Structure Parsing Complete [" + stopWatch.ElapsedMilliseconds + " ms]");

            stopWatch.Reset();
            stopWatch.Start();
            SecondaryStructure.CreateFromPrimaryStructure(primaryStructure, strideExePath, tmpFilePath);
            Console.WriteLine("Main Secondary Structure Parsing Complete [" + stopWatch.ElapsedMilliseconds + " ms]");


            foreach (Chain chain in primaryStructure.Chains())
            {
                foreach (Atom atom in chain.MainChainAtoms)
                {
                    // if no frame number use the base structure coordinates.
                    if (atom == null)
                    {
                        Console.WriteLine("Main chain atom is null");
                    }
                    else
                    {
                        Console.WriteLine("Atom found: " + atom.ToString());
                    }
                }


                //Console.WriteLine("\n---------------------\n");
                //Console.WriteLine("Chain ID: " + chain.ID);
                //Console.WriteLine("Chain Residue Count: " + chain.Residues.Count);
                //if (chain.ResidueType == MolecularDynamics.Definitions.StandardResidue.AminoAcid) {
                //    foreach (Residue residue in chain.Residues) {
                //        Console.WriteLine("Residue index: " + residue.Index + ", ResidueID: " + residue.ID + ", Residue Name: " + residue.Name);
                //        SecondaryStructureInfomation information = secondaryStructure.GetStructureInformation(residue.Index);
                //        if (information == null) {
                //            Console.WriteLine("information null: " + residue.Index);
                //        }
                //    }
                //}
                //else {
                //    Console.WriteLine("Not an amino acid residue");
                //}
            }
        }