Ejemplo n.º 1
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 SecondaryStructure CreateFromPrimaryStructure(PrimaryStructure primaryStructure, string strideExePath, string tmpFilePath)
        {
            string tmpFileName             = tmpFilePath + @"tempStructure.pdb";
            PDBStructureCreator pdbCreator = new PDBStructureCreator(primaryStructure, null);

            //pdbCreator.CreatePDBFile(tmpFileName, true, true, true);
            pdbCreator.CreatePDBFile(tmpFileName);

            SecondaryStructure secondaryStructure = null;

            try {
                StrideAnalysis stride = new StrideAnalysis(strideExePath);
                secondaryStructure = stride.GetSecondaryStructure(tmpFileName);
            }
            finally {
                FileUtil.DeleteFile(tmpFileName);
            }

            return(secondaryStructure);
        }
        private SecondaryStructure CalculateSecondaryStructure(int frameNumber)
        {
            string tmpFileName             = tmpFilePath + @"tempStructure_" + frameNumber + ".pdb";
            PDBStructureCreator pdbCreator = new PDBStructureCreator(primaryStructure, primaryTrajectory.GetFrame(frameNumber));

            pdbCreator.CreatePDBFile(tmpFileName, true, true, true);

            SecondaryStructure frame = null;

            try {
                StrideAnalysis stride = new StrideAnalysis(strideExePath);
                frame = stride.GetSecondaryStructure(tmpFileName);
            }
            catch (StrideException ex) {
                throw new StrideException(ex.Message);
            }
            finally {
                FileUtil.DeleteFile(tmpFileName);
            }

            return(frame);
        }