Example #1
0
        private void graphChromatogram_ClickedChromatogram(object sender, ClickedChromatogramEventArgs e)
        {
            if (e.ScanProvider != null)
            {
                var dataFile = e.ScanProvider.DataFilePath;
                if (e.ScanIndex == -1)
                {
                    MessageDlg.Show(this,
                        string.Format(Resources.SkylineWindow_graphChromatogram_ClickedChromatogram_The_raw_file_must_be_re_imported_in_order_to_show_full_scans___0_, dataFile));
                    return;
                }
            }

            ShowGraphFullScan(e.ScanProvider, e.TransitionIndex, e.ScanIndex);
        }
Example #2
0
        /// <summary>
        /// User clicked on a chromatogram.
        /// </summary>
        public void FireClickedChromatogram(GraphPane graphPane)
        {
            if (ClickedChromatogram == null)
                return;

            var clickedItem = (ChromGraphItem) _closestCurve.Tag;
            if (clickedItem.TransitionNode == null)
                return;
            var chromatogramGroupInfo = clickedItem.Chromatogram;

            double displayTime = graphPane.CurveList[FULLSCAN_TRACKING_INDEX][0].X;
            var retentionTime = clickedItem.GetNearestDisplayTime(displayTime);
            if (retentionTime.IsZero)
                return;
            int scanIndex = MsDataFileScanHelper.FindScanIndex(chromatogramGroupInfo, retentionTime.MeasuredTime);
            var transitions = new List<TransitionFullScanInfo>(graphPane.CurveList.Count);
            int transitionIndex = 0;
            foreach (var curve in GetCurveList(graphPane))
            {
                var graphItem = (ChromGraphItem) curve.Tag;
                if (ReferenceEquals(curve, _closestCurve))
                    transitionIndex = transitions.Count;
                var fullScanInfo = graphItem.FullScanInfo;
                transitions.Add(new TransitionFullScanInfo
                {
                    Name = fullScanInfo.ScanName,
                    Source = fullScanInfo.ChromInfo.Source,
                    ScanIndexes = fullScanInfo.ChromInfo.ScanIndexes,
                    Color = curve.Color,
                    PrecursorMz = fullScanInfo.ChromInfo.PrecursorMz,
                    ProductMz = fullScanInfo.ChromInfo.ProductMz,
                    ExtractionWidth = fullScanInfo.ChromInfo.ExtractionWidth,
                    IonMobilityValue = fullScanInfo.ChromInfo.IonMobilityValue,
                    IonMobilityExtractionWidth = fullScanInfo.ChromInfo.IonMobilityExtractionWidth,
                    Id = graphItem.TransitionNode.Id
                });
            }
            IScanProvider scanProvider;
            var chorusUrl = FilePath as ChorusUrl;
            if (null == chorusUrl)
            {
                var measuredResults = DocumentUI.Settings.MeasuredResults;
                scanProvider = new ScanProvider(_documentContainer.DocumentFilePath, FilePath,
                    chromatogramGroupInfo.Source, chromatogramGroupInfo.Times, transitions.ToArray(),
                    () => measuredResults.LoadMSDataFileScanIds(FilePath));
            }
            else
            {
                scanProvider = new ChorusScanProvider(_documentContainer.DocumentFilePath, chorusUrl,
                    chromatogramGroupInfo.Source, chromatogramGroupInfo.Times, transitions.ToArray());
            }
            var e = new ClickedChromatogramEventArgs(
                scanProvider,
                transitionIndex,
                scanIndex);
            ClickedChromatogram(this, e);
        }