public GraphFullScan(IDocumentUIContainer documentUIContainer) { InitializeComponent(); graphControl.GraphPane = new HeatMapGraphPane { MinDotRadius = MIN_DOT_RADIUS, MaxDotRadius = MAX_DOT_RADIUS }; Icon = Resources.SkylineData; _graphHelper = GraphHelper.Attach(graphControl); _documentContainer = documentUIContainer; _documentContainer.ListenUI(OnDocumentUIChanged); _msDataFileScanHelper = new MsDataFileScanHelper(SetSpectra, HandleLoadScanException); GraphPane.Title.IsVisible = true; GraphPane.Legend.IsVisible = false; // Make sure to use italics for "m/z" AbstractMSGraphItem.SetAxisText(GraphPane.XAxis, Resources.AbstractMSGraphItem_CustomizeXAxis_MZ); magnifyBtn.Checked = Settings.Default.AutoZoomFullScanGraph; spectrumBtn.Checked = Settings.Default.SumScansFullScan; filterBtn.Checked = Settings.Default.FilterDriftTimesFullScan; spectrumBtn.Visible = false; filterBtn.Visible = false; lblScanId.Visible = false; // you might want to show the scan index for debugging }
public GraphFullScan(IDocumentUIContainer documentUIContainer) { InitializeComponent(); graphControl.GraphPane = new HeatMapGraphPane { MinDotRadius = MIN_DOT_RADIUS, MaxDotRadius = MAX_DOT_RADIUS }; Icon = Resources.SkylineData; _graphHelper = GraphHelper.Attach(graphControl); _documentContainer = documentUIContainer; _documentContainer.ListenUI(OnDocumentUIChanged); _msDataFileScanHelper = new MsDataFileScanHelper(SetSpectra, HandleLoadScanException); GraphPane.Title.IsVisible = true; GraphPane.Legend.IsVisible = false; // Make sure to use italics for "m/z" AbstractMSGraphItem.SetAxisText(GraphPane.XAxis, Resources.AbstractMSGraphItem_CustomizeXAxis_MZ); magnifyBtn.Checked = Settings.Default.AutoZoomFullScanGraph; spectrumBtn.Checked = Settings.Default.SumScansFullScan; filterBtn.Checked = Settings.Default.FilterIonMobilityFullScan; spectrumBtn.Visible = false; filterBtn.Visible = false; lblScanId.Visible = false; // you might want to show the scan index for debugging }
public Dictionary<LibKey, DriftTimeInfo> FindDriftTimePeaks() { // Overwrite any existing measurements with newly derived ones var measured = new Dictionary<LibKey, DriftTimeInfo>(); if (_existing != null && _existing.MeasuredDriftTimePeptides != null) { foreach (var existingPair in _existing.MeasuredDriftTimePeptides) measured.Add(existingPair.Key, existingPair.Value); } var filepaths = _document.Settings.MeasuredResults.MSDataFilePaths.ToArray(); _totalSteps = filepaths.Length * _document.MoleculeTransitionGroupCount; if (_totalSteps == 0) return measured; using (_msDataFileScanHelper = new MsDataFileScanHelper(SetScans, HandleLoadScanException)) { // // Avoid opening and re-opening raw files - make these the outer loop // _ms1DriftTimes = new Dictionary<LibKey, List<DriftTimeIntensityPair>>(); _ms2DriftTimes = new Dictionary<LibKey, List<DriftTimeIntensityPair>>(); var twopercent = (int) Math.Ceiling(_totalSteps*0.02); _totalSteps += twopercent; _currentStep = twopercent; if (_progressMonitor != null) { _progressStatus = new ProgressStatus(filepaths.First().GetFileName()); _progressStatus = _progressStatus.UpdatePercentCompleteProgress(_progressMonitor, _currentStep, _totalSteps); // Make that inital lag seem less dismal to the user } foreach (var fp in filepaths) { if (!ProcessFile(fp)) return null; // User cancelled } // Find drift times based on MS1 data foreach (var dt in _ms1DriftTimes) { // Choose the drift time which gave the largest signal var ms1DriftTime = dt.Value.OrderByDescending(p => p.Intensity).First().DriftTime; // Check for MS2 data to use for high energy offset List<DriftTimeIntensityPair> listDt; var ms2DriftTime = _ms2DriftTimes.TryGetValue(dt.Key, out listDt) ? listDt.OrderByDescending(p => p.Intensity).First().DriftTime : (ms1DriftTime ?? 0); var value = new DriftTimeInfo(ms1DriftTime, ms2DriftTime - ms1DriftTime ?? 0); if (!measured.ContainsKey(dt.Key)) measured.Add(dt.Key, value); else measured[dt.Key] = value; } // Check for data for which we have only MS2 to go on foreach (var dt in _ms2DriftTimes) { if (!_ms1DriftTimes.ContainsKey(dt.Key)) { // Only MS2 drift times found, use that var value = new DriftTimeInfo(dt.Value.OrderByDescending(p => p.Intensity).First().DriftTime, 0); if (!measured.ContainsKey(dt.Key)) measured.Add(dt.Key, value); else measured[dt.Key] = value; } } } return measured; }
public void Dispose() { if (_msDataFileScanHelper != null) { _msDataFileScanHelper.Dispose(); _msDataFileScanHelper = null; } }