private static void MainAnalysisThreadedTask(RawFileName rawfile, SettingsForAnalysis fixedSettingsForAnalysis, UIsettings fixedSettings, ResultItems results) { //ResultItems results = new ResultItems(); //this can now be done threaded List <Task <ResultItems> > taskList = new List <Task <ResultItems> >(); taskList.Add(Task.Run(() => { ResultItems results1 = new ResultItems(); using (AnalysisTemplate curMethod = new AnalysisMorpheus()) { results1 = curMethod.Analyze(rawfile, fixedSettingsForAnalysis, fixedSettings); } GC.Collect();//ugly but this solves problem with memory not released return(results1); })); taskList.Add(Task.Run(() => { ResultItems results2 = new ResultItems(); using (AnalysisTemplate curMethod = new AnalysisBase()) { results2 = curMethod.Analyze(rawfile, fixedSettingsForAnalysis, fixedSettings); } return(results2); })); taskList.Add(Task.Run(() => { ResultItems results3 = new ResultItems(); using (AnalysisTemplate curMethod = new AnalysisExternal1()) { results3 = curMethod.Analyze(rawfile, fixedSettingsForAnalysis, fixedSettings); } return(results3); })); Task.WaitAll(taskList.ToArray()); foreach (Task <ResultItems> resultTask in taskList) { results.Add(resultTask.Result); } //return results; }
protected override ResultItems GetResultItems(UIsettings settingName) { ResultItems results = new ResultItems(); foreach (ExternalResultParseSetting item in settingName.ExternalResults) { results.Add(item.Resultname, typeof(double)); } /* * results.Add("MedianMS1IsolationInterference", typeof(double)); * results.Add("MedianPeakWidthAt10Percent(s)", typeof(double)); * results.Add("MedianPeakWidthAtHalfMax(s)", typeof(double)); * results.Add("MedianAsymmetryFactor", typeof(double)); * results.Add("ColumnCapacity", typeof(double)); */ return(results); }
protected override ResultItems GetResultItems(UIsettings settingName) { ResultItems results = new ResultItems(); results.Add("RawFile", typeof(string)); results.Add("User", typeof(string)); results.Add("MS instrument", typeof(string)); results.Add("MS instrument number", typeof(string)); results.Add("LC instrument", typeof(string)); results.Add("LC instrument number", typeof(string)); results.Add("Sample type", typeof(string)); results.Add("Sample type details", typeof(string)); results.Add("File name convention followed", typeof(string)); results.Add("LCMS start", typeof(DateTime)); results.Add("MS start", typeof(DateTime)); results.Add("LCMS end", typeof(DateTime)); results.Add("MS time in minutes", typeof(double)); results.Add("LC time in minutes", typeof(double)); results.Add("File size (MiB)", typeof(double)); results.Add("Storage space left (GiB)", typeof(double)); results.Add("MS count", typeof(int)); results.Add("MS2 count", typeof(int)); results.Add("MS TIC", typeof(double)); results.Add("MS TIC (high percentile)", typeof(double)); results.Add("MS2 TIC", typeof(double)); results.Add("MS signal to noise", typeof(double)); results.Add("MS2 signal to noise", typeof(double)); results.Add("MS ion count", typeof(double)); results.Add("MS2 ion count", typeof(double)); results.Add("MS2 topN", typeof(double)); results.Add("Large injection time fluctuations", typeof(double)); results.Add("CTCD or PrOSA minimum", typeof(double)); results.Add("CTCD or PrOSA maximum", typeof(double)); results.Add("Lock mass correction maximum absolute (ppm)", typeof(double)); results.Add("MS2 count above ion threshold", typeof(int)); results.Add("MS2 count above ion threshold percentage", typeof(double)); results.Add("MS2 precursor isolation width TIC", typeof(double)); results.Add("MS2TIC / MS2 precursor isolation width TIC", typeof(double)); results.Add("MS2 scans with precursor as BP percentage", typeof(double)); results.Add("MS2 scans XIC above precursor percentage", typeof(double)); results.Add("MS2 with charge 2 in percent", typeof(double)); results.Add("MS2 with charge 3 in percent", typeof(double)); results.Add("MS2 with charge 4 or higher in percent", typeof(double)); foreach (int day in new int[] { 1, 7, 30, 90 }) { results.Add("Last " + day.ToString() + " day(s) LCMS usage percent", typeof(double)); results.Add("Last " + day.ToString() + " day(s) MS usage percent", typeof(double)); results.Add("Last " + day.ToString() + " day(s) MS excl QC usage percent", typeof(double)); } results.Add("Polymer01", typeof(double)); results.Add("Polymer02", typeof(double)); results.Add("Polymer03", typeof(double)); results.Add("Polymer04", typeof(double)); results.Add("Polymer05", typeof(double)); results.Add("AdductNa", typeof(double)); results.Add("AdductCa", typeof(double)); results.Add("AdductFe", typeof(double)); results.Add("AdductK", typeof(double)); results.Add("AdductFA", typeof(double)); results.Add("AdductNH3", typeof(double)); results.Add("AdductACN", typeof(double)); results.Add("Precursor 5 percent mass quantile", typeof(double)); results.Add("Precursor 95 percent mass quantile", typeof(double)); results.Add("Warning log", typeof(string)); results.Add("Analysis tool version", typeof(string)); foreach (StatusLogItem item in settingName.statusLogItems) { if (item.CalculateMedian) { results.Add(item.Name, typeof(double)); } if (item.CalculateMin) { results.Add(item.Name + " min", typeof(double)); } if (item.CalculateMax) { results.Add(item.Name + " max", typeof(double)); } if (item.CalculateIQR) { results.Add(item.Name + " IQR", typeof(double)); } } return(results); }