int UpdateSearchConditionFile(string TaskID, float newPossibility) { string scLocation = WebConfigurationManager.ConnectionStrings["UploadPath"].ConnectionString + TaskID + "\\searchcondition.xml"; FileInfo fi = new FileInfo(scLocation); if (fi.Exists) { SearchingParameters mySP = new SearchingParameters(scLocation); mySP.ConfidenceLevel = newPossibility / 100; mySP.SaveSettings(scLocation); return(mySP.DistinctPeptide); } return(1); }
void UpdateSearchingCondition(string TaskID, float confidence, int distinctPeptides, int UniquePeptides) { string scLocation = WebConfigurationManager.ConnectionStrings["UploadPath"].ConnectionString + TaskID + "\\searchcondition.xml"; FileInfo fi = new FileInfo(scLocation); if (fi.Exists) { SearchingParameters mySP = new SearchingParameters(scLocation); mySP.ConfidenceLevel = confidence; mySP.DistinctPeptide = distinctPeptides; mySP.UniquePeptide = UniquePeptides; mySP.SaveSettings(); } COPaWS.COPaWS copaws = new COPaWS.COPaWS(); if (copaws.ChangeCreteria(TaskID, this.lbmzML.Text.Replace("<br/>", "\r\n"))) { Response.Redirect(string.Format("Report.aspx?TaskID={0}", TaskID)); } }
protected void btUpload_Click(object sender, EventArgs e) { //if (this.tbUserID.Text == "") //{ // this.lbEmailMessage1.Text = "Required field."; // return; //} //else // this.lbEmailMessage1.Text = "*"; if (!this.RegularExpressionValidator2.IsValid || !this.RegularExpressionValidator1.IsValid) { return; //validation group for mzMl or raw file } if (!cbUseURL.Checked && !this.InputFile1.HasFile) { return; } if (cbUseURL.Checked && this.tbURL.Text == "") { this.lbMessage.Text = "You need to upload a local file or provide the URL of a file in the web."; return; } string FileName = ""; string SingleFileName = ""; if (cbUseURL.Checked) { FileName = this.tbURL.Text; SingleFileName = FileName.Substring(FileName.LastIndexOf("/") + 1); } else { FileName = this.InputFile1.FileName; SingleFileName = FileName; } string strSQL = "insert into search_task (task_user,upload_filename,search_model,report_filename) values ('{0}','{1}','{2}','{3}')"; string strReportName = SingleFileName.Substring(0, SingleFileName.LastIndexOf(".")) + ".txt"; strSQL = string.Format(strSQL, DBInterface.SQLValidString(this.tbUserID.Text), DBInterface.SQLValidString(FileName), this.ddlModels.Text, DBInterface.SQLValidString(strReportName)); //DBInterface.ConnectDB(); string taskID = ""; if (DBInterface.UpdateSQL(strSQL) > 0) { strSQL = "select task_seq from search_task where task_user='******' and upload_filename = '{1}' order by task_seq desc"; strSQL = string.Format(strSQL, DBInterface.SQLValidString(this.tbUserID.Text), DBInterface.SQLValidString(FileName)); IDataReader result = DBInterface.QuerySQL(strSQL); if (result != null) { result.Read(); taskID = result.GetValue(0).ToString(); } DBInterface.CloseDB(); string UploadPath = WebConfigurationManager.ConnectionStrings["UploadPath"].ConnectionString + taskID + "\\"; DirectoryInfo newpath = new DirectoryInfo(UploadPath); if (!newpath.Exists) { newpath.Create(); } if (!cbUseURL.Checked) { string TargeFile = UploadPath + FileName; this.InputFile1.MoveTo(TargeFile, Brettle.Web.NeatUpload.MoveToOptions.Overwrite); } //***save the searching conditions in files*** SearchingParameters mySP = new SearchingParameters(); if (cbUseDefault.Checked) { mySP.ConfidenceLevel = 0.95F; mySP.DistinctPeptide = 1; mySP.LibraryModule = this.ddlModels.Text; mySP.OnlyTop1 = true; mySP.Peptidetolerance = 2; mySP.PTMShift = 0; mySP.SlideSize = 1; mySP.ScoreCriteria = "|0;-1"; mySP.UseNoiseLibrary = true; mySP.UseStatisticalMode = true; mySP.HighResolution = false; mySP.PeptideToleranceHR = 20; mySP.IsotopePeaks = 2; mySP.BonusDetaMz = false; mySP.CustomizedLibraryFDR = false; mySP.UniquePeptide = 0; mySP.UsePTMModule = false; } else { try { mySP.ConfidenceLevel = float.Parse(this.ddl_Threshold.Text.Substring(0, this.ddl_Threshold.Text.Length - 1)) / 100; if (mySP.ConfidenceLevel >= 1 || mySP.ConfidenceLevel <= 0) { lbMessage.Text = "The peptide confidence should be set in the range 0%-100%."; return; } } catch { lbMessage.Text = "The peptide confidence setting is out of range."; return; } mySP.DistinctPeptide = int.Parse(this.ddl_DistinctPepties.Text); // sc.DistinctPeptide; mySP.UniquePeptide = int.Parse(this.ddl_UniquePeptides.Text); mySP.LibraryModule = this.ddlModels.Text; // GetModuleName(sc.searchModule); mySP.OnlyTop1 = true; // sc.bOnlyTop1; mySP.Peptidetolerance = float.Parse(this.ddl_PrecursorTolerance.Text); //sc.fPrecursorWindow; mySP.PTMShift = float.Parse(this.ddl_PTMshift.Text); // sc.fPTMShift; string Criterias = "|0;-1"; //foreach (SearchingThreadPair stp in sc.NormalSearchCondition) //{ // Criterias += string.Format("|{0};{1}", stp.MatchScore, stp.DetaDecoyScore); //} mySP.ScoreCriteria = Criterias; mySP.SlideSize = int.Parse(this.ddl_SlideSize.Text); // sc.iSlideSize; mySP.UseNoiseLibrary = this.cbUseNDP.Checked; // sc.bUseNoiseLibrary; mySP.UseStatisticalMode = true; // sc.bStatisticSearching; mySP.HighResolution = this.cbHighResolution.Checked; mySP.PeptideToleranceHR = float.Parse(this.ddlHRPrecursorTolerance.Text); mySP.IsotopePeaks = int.Parse(this.ddlIsotopePeaks.Text); mySP.BonusDetaMz = this.cbBonusMS.Checked; mySP.CustomizedLibraryFDR = false; mySP.UsePTMModule = false; } string sclocation = UploadPath + "searchcondition.xml"; mySP.SaveSettings(sclocation); //***************************************** strSQL = "update search_task set task_status=1 where task_seq=" + taskID; if (DBInterface.UpdateSQL(strSQL) > 0) { if (cbUseURL.Checked) { informationShow.Text = @"<div id='helpNote' class='collapse'>"; informationBtn.Text = @"<button type='button' class='close button collapsed' data-toggle='collapse' data-target='#helpNote'>×</button>"; lbMessage.Text = "You URL resource has been submitted. The task ID is <a href=\"SearchReport.aspx?QType=" + this.tbUserID.Text + "&QValue=" + taskID + "\" style=\"font-size: large; color: #FF0000\" >" + taskID + "</a>."; //this.cbUseURL.Checked = false; } else { lbMessage.Text = "You mzML file has been successfully uploaded. The task ID is <a href=\"SearchReport.aspx?QType=" + this.tbUserID.Text + "&QValue=" + taskID + "\" style=\"font-size: large; color: #FF0000\" >" + taskID + "</a>."; } } } }