Example #1
0
        public static void Run()
        {
            // get the primary structure
            Console.WriteLine("Parsing GRO File");

            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();
            PrimaryStructure primaryStructure = GROStructureParser.GetStructure(inputFilePath + inputFileName);

            stopWatch.Stop();

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

            // get the structure trajectory
            int atomCount = XTCTrajectoryParser.GetAtomCount(inputFilePath + trajectoryFileName);

            if (atomCount == primaryStructure.AtomCount())
            {
                Console.WriteLine("Atom Count matches.");
            }
            else
            {
                Console.WriteLine("Atom count doesnt match between primary structure and trajectory");
            }

            Stopwatch stopWatch2 = new Stopwatch();

            stopWatch2.Start();
            PrimaryStructureTrajectory trajectory = XTCTrajectoryParser.GetTrajectory(inputFilePath + trajectoryFileName, 0, 100, 1);

            stopWatch2.Stop();

            Console.WriteLine("Trajectory Parsing Complete [" + stopWatch2.ElapsedMilliseconds + " ms]");

            // get the secondary structure for the base primary structure

            Stopwatch stopWatch3 = new Stopwatch();

            stopWatch3.Start();
            SecondaryStructure secondaryStructure = SecondaryStructure.CreateFromPrimaryStructure(primaryStructure, strideExePath, tmpFilePath);

            Console.WriteLine("Main Secondary Structure Parsing Complete [" + stopWatch3.ElapsedMilliseconds + " ms]");

            Console.WriteLine(secondaryStructure);

            // get the secondary structure for a frame of the trajectory
            Stopwatch stopWatch4 = new Stopwatch();

            stopWatch4.Start();

            SecondaryStructureTrajectory secondaryStructureTrajectory = new SecondaryStructureTrajectory(primaryStructure, trajectory, strideExePath, tmpFilePath);
            SecondaryStructure           secondaryStructure2          = secondaryStructureTrajectory.GetStructure(50);

            Console.WriteLine("Secondary Structure Parsing for frame 50 Complete [" + stopWatch3.ElapsedMilliseconds + " ms]");

            Console.WriteLine(secondaryStructure2);
        }
        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");
                //}
            }
        }
Example #3
0
        public static void Run()
        {
            Console.WriteLine("Parsing GRO File");

            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();
            PrimaryStructure primaryStructure = GROStructureParser.GetStructure(filepath + structureFile);

            stopWatch.Stop();

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

            stopWatch.Reset();
            stopWatch.Start();
            SecondaryStructure secondaryStructure = SecondaryStructure.CreateFromPrimaryStructure(primaryStructure, strideExePath, tmpFilePath);

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


            foreach (Chain chain in primaryStructure.Chains())
            {
                Console.WriteLine("\n---------------------\n");
                Console.WriteLine("Chain ID: " + chain.ID);
                Console.WriteLine("Chain Residue Count: " + chain.Residues.Count);
                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);
                    }
                }
            }
        }