/// <summary> /// Read a MSPF parameter file and populate raw file and feature file. /// </summary> /// <param name="filePath">The path to the parameter file.</param> private void ReadParamFile(string filePath) { if (!string.IsNullOrWhiteSpace(filePath)) { var mspfParams = MsPfParameters.ReadFromFile(filePath); var dirPath = Path.GetDirectoryName(filePath); var raw = string.Format("{0}\\{1}", dirPath, mspfParams.PuSpecFile); if (!string.IsNullOrWhiteSpace(mspfParams.PuSpecFile) && File.Exists(raw)) { this.RawFilePath = raw; } var feature = string.Format("{0}\\{1}", dirPath, mspfParams.FeatureFile); if (!string.IsNullOrWhiteSpace(mspfParams.FeatureFile) && File.Exists(feature)) { this.FeatureFilePath = feature; } var fasta = string.Format("{0}\\{1}", dirPath, mspfParams.DatabaseFile); if (!string.IsNullOrWhiteSpace(mspfParams.DatabaseFile) && File.Exists(fasta)) { this.FastaFilePath = fasta; } } }
/// <summary> /// Set the MSPathFinder parameters given a path to a ID file. /// </summary> /// <param name="idFilePath">The id file path.</param> public void SetMsPfParameters(string idFilePath) { try { this.MsPfParameters = MsPfParameters.ReadFromFile(idFilePath); } catch (FormatException) { this.dialogService.MessageBox("MsPathFinder Parameters are not properly formatted."); } }