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); } } } }
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); }
public static SecondaryStructure GetSecondaryStructure(string inputFilePath, string strideExePath) { StrideAnalysis stride = new StrideAnalysis(strideExePath); return(stride.GetSecondaryStructure(inputFilePath)); }