protected override void DoTest() { // Skyline Targeted Method Refinement var folderMethodRefine = UseRawFiles ? "MethodRefine" : "MethodRefineMzml"; // Not L10N // Results Data, p. 2 var doc = SkylineWindow.Document; RunUI(() => SkylineWindow.OpenFile(TestFilesDirs[1].GetTestPath(folderMethodRefine + @"\WormUnrefined.sky"))); // Not L10N WaitForDocumentChangeLoaded(doc); RunUI(() => { // Adjust font sizes for better screen shots Settings.Default.ChromatogramFontSize = 14; Settings.Default.SpectrumFontSize = 14; SkylineWindow.ChangeTextSize(TreeViewMS.LRG_TEXT_FACTOR); SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.Nodes[0].Nodes[0]; SkylineWindow.AutoZoomBestPeak(); // TODO: Mention this in the tutorial SkylineWindow.Size = new Size(1160, 660); Assert.AreEqual(SkylineWindow.SequenceTree.SelectedNode.Text, "YLGAYLLATLGGNASPSAQDVLK"); // Not L10N }); PauseForScreenShot("Main window", 2); // TODO: Update tutorial to view b-ions. RunUI(() => SkylineWindow.GraphSpectrumSettings.ShowBIons = true); // Unrefined Methods, p. 3 { var exportDlg = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.List)); RunUI(() => { exportDlg.ExportStrategy = ExportStrategy.Buckets; exportDlg.MethodType = ExportMethodType.Standard; exportDlg.OptimizeType = ExportOptimize.NONE; exportDlg.MaxTransitions = 59; }); PauseForScreenShot("Export Transition List form", 3); // Not L10N OkDialog(exportDlg, () => exportDlg.OkDialog(TestFilesDirs[1].GetTestPath(folderMethodRefine + @"\worm"))); // Not L10N } for (int i = 1; i < 10; i++) { Assert.IsTrue(File.Exists(TestFilesDirs[1].GetTestPath(folderMethodRefine + @"\worm_000" + i + TextUtil.EXT_CSV))); // Not L10N } for (int i = 10; i < 40; i++) { Assert.IsTrue(File.Exists(TestFilesDirs[1].GetTestPath(folderMethodRefine + @"\worm_00" + i + TextUtil.EXT_CSV))); // Not L10N } // Importing Multiple Injection Data, p. 4 Assert.IsTrue(SkylineWindow.Document.Settings.HasResults); RunDlg <ManageResultsDlg>(SkylineWindow.ManageResults, manageResultsDlg => { manageResultsDlg.RemoveReplicates(); Assert.AreEqual(manageResultsDlg.Chromatograms.ToArray().Length, 0); manageResultsDlg.OkDialog(); }); RunUI(() => SkylineWindow.SaveDocument()); Assert.IsFalse(SkylineWindow.Document.Settings.HasResults); const string replicateName = "Unrefined"; // Not L10N RunDlg <ImportResultsDlg>(SkylineWindow.ImportResults, importResultsDlg => { importResultsDlg.RadioAddNewChecked = true; var namedPathSets = DataSourceUtil.GetDataSourcesInSubdirs(TestFilesDirs[0].FullPath).ToArray(); importResultsDlg.NamedPathSets = new[] { new KeyValuePair <string, MsDataFileUri[]>(replicateName, namedPathSets[0].Value.Take(15).ToArray()) }; importResultsDlg.OkDialog(); }); WaitForOpenForm <AllChromatogramsGraph>(); // To make the AllChromatogramsGraph form accessible to the SkylineTester forms tab PauseForScreenShot <AllChromatogramsGraph>("Loading Chromatograms: Take screenshot at about 25% loaded...", 5); WaitForCondition(15 * 60 * 1000, () => SkylineWindow.Document.Settings.MeasuredResults.IsLoaded); // 15 minutes Assert.IsTrue(SkylineWindow.Document.Settings.HasResults); Assert.AreEqual(15, SkylineWindow.Document.Settings.MeasuredResults.CachedFilePaths.ToArray().Length); RunDlg <ImportResultsDlg>(SkylineWindow.ImportResults, importResultsDlg => { importResultsDlg.RadioAddExistingChecked = true; var namedPathSets = DataSourceUtil.GetDataSourcesInSubdirs(TestFilesDirs[0].FullPath).ToArray(); importResultsDlg.NamedPathSets = new[] { new KeyValuePair <string, MsDataFileUri[]>(replicateName, namedPathSets[0].Value.Skip(15).ToArray()) }; importResultsDlg.OkDialog(); }); WaitForCondition(20 * 60 * 1000, () => SkylineWindow.Document.Settings.MeasuredResults.IsLoaded); // 15 minutes Assert.AreEqual(39, SkylineWindow.Document.Settings.MeasuredResults.CachedFilePaths.ToArray().Length); RunUI(SkylineWindow.AutoZoomNone); RestoreViewOnScreen(7); PauseForScreenShot("Chromatogram graph metafile", 7); // Simple Manual Refinement, p. 6 int startingNodeCount = SkylineWindow.SequenceTree.Nodes[0].GetNodeCount(false); Assert.AreEqual("YLGAYLLATLGGNASPSAQDVLK", SkylineWindow.SequenceTree.Nodes[0].Nodes[0].Text); // Not L10N RunUI(() => { SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.Nodes[0].Nodes[0]; SkylineWindow.AutoZoomNone(); SkylineWindow.AutoZoomBestPeak(); SkylineWindow.EditDelete(); SkylineWindow.ShowRTLinearRegressionGraph(); }); Assert.AreEqual(SkylineWindow.SequenceTree.Nodes[0].GetNodeCount(false), startingNodeCount - 1); Assert.AreEqual("VLEAGGLDCDMENANSVVDALK", SkylineWindow.SequenceTree.Nodes[0].Nodes[0].Text); // Not L10N PauseForScreenShot("Retention Times Regression plot metafile", 8); RunDlg <RegressionRTThresholdDlg>(SkylineWindow.ShowRegressionRTThresholdDlg, rtThresholdDlg => { rtThresholdDlg.Threshold = 0.95; rtThresholdDlg.OkDialog(); }); WaitForConditionUI(() => SkylineWindow.RTGraphController.RegressionRefined != null); WaitForGraphs(); PauseForScreenShot("Retention Times Regression plot metafile with 0.95 threshold", 9); // Not L10N TestRTResidualsSwitch(); RunDlg <EditRTDlg>(SkylineWindow.CreateRegression, editRTDlg => editRTDlg.OkDialog()); RunUI(() => SkylineWindow.ShowGraphRetentionTime(false)); RunUI(SkylineWindow.AutoZoomNone); PauseForScreenShot("Chromatogram graph metafile zoomed out", 10); // Not L10N // Missing Data, p. 10 RunUI(() => { SkylineWindow.RTGraphController.SelectPeptide(SkylineWindow.Document.GetPathTo(1, 163)); Assert.AreEqual("YLAEVASEDR", SkylineWindow.SequenceTree.SelectedNode.Text); // Not L10N }); RestoreViewOnScreen(11); // Restoring the view changes the selection RunUI(SkylineWindow.CollapsePeptides); FindNode("YLAEVASEDR"); RunUI(() => SkylineWindow.SequenceTree.TopNode = SkylineWindow.SequenceTree.Nodes[0].Nodes[153]); PauseForScreenShot("Targets view clipped from the main window", 11); RunUI(() => { var nodePep = (PeptideDocNode)((SrmTreeNode)SkylineWindow.SequenceTree.SelectedNode).Model; Assert.AreEqual(null, nodePep.GetPeakCountRatio( SkylineWindow.SequenceTree.GetDisplayResultsIndex(nodePep))); SkylineWindow.SequenceTree.SelectedPath = SkylineWindow.Document.GetPathTo(1, 157); Assert.AreEqual("VTVVDDQSVILK", SkylineWindow.SequenceTree.SelectedNode.Text); }); WaitForGraphs(); RunUI(() => { SkylineWindow.ActivateReplicate("Unrefined"); SkylineWindow.AutoZoomNone(); }); PauseForScreenShot("Unrefined chromatogram graph page clipped from main window", 12); // Not L10N // foreach (var peptideDocNode in SkylineWindow.Document.Peptides) // { // var nodeGroup = ((TransitionGroupDocNode)peptideDocNode.Children[0]); // Console.WriteLine("{0} - {1}", peptideDocNode.Peptide.Sequence, // nodeGroup.GetDisplayText(SkylineWindow.SequenceTree.GetDisplaySettings(peptideDocNode))); // } // Console.WriteLine("---------------------------------"); RunUI(() => { var graphChrom = SkylineWindow.GetGraphChrom("Unrefined"); // Not L10N Assert.AreEqual(2, graphChrom.Files.Count); SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.Nodes[0]; // Picking Measurable Peptides and Transitions, p. 12 SkylineWindow.ExpandPeptides(); SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.Nodes[0].Nodes[0]; }); RunUI(SkylineWindow.AutoZoomBestPeak); RestoreViewOnScreen(13); RunUI(() => SkylineWindow.ShowGraphSpectrum(false)); PauseForScreenShot("Targets view clipped from the main window and chromatogram graph metafile", 13); RunUI(() => SkylineWindow.ShowGraphSpectrum(true)); PauseForScreenShot("Library Match plot metafile", 14); RunUI(() => { SkylineWindow.ShowGraphSpectrum(false); SkylineWindow.SelectedPath = SkylineWindow.Document.GetPathTo((int)SrmDocument.Level.Transitions, 0); SkylineWindow.SelectedNode.Expand(); SkylineWindow.SelectedPath = SkylineWindow.Document.GetPathTo((int)SrmDocument.Level.Molecules, 0); }); PauseForScreenShot("Targetes view clipped from the main window", 14); // Not L10N RunUI(() => { double dotpExpect = Math.Round(Statistics.AngleToNormalizedContrastAngle(0.78), 2); // 0.57 AssertEx.Contains(SkylineWindow.SequenceTree.SelectedNode.Nodes[0].Text, dotpExpect.ToString(LocalizationHelper.CurrentCulture)); SkylineWindow.EditDelete(); dotpExpect = 0.34; // Math.Round(Statistics.AngleToNormalizedContrastAngle(0.633), 2); // 0.44 SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.Nodes[0].Nodes[0]; AssertEx.Contains(SkylineWindow.SequenceTree.SelectedNode.Nodes[0].Text, dotpExpect.ToString(LocalizationHelper.CurrentCulture)); SkylineWindow.EditDelete(); PeptideTreeNode nodePep; for (int i = 0; i < 2; i++) { nodePep = (PeptideTreeNode)SkylineWindow.SequenceTree.Nodes[0].Nodes[i]; nodePep.ExpandAll(); foreach (TransitionTreeNode nodeTran in nodePep.Nodes[0].Nodes) { TransitionDocNode nodeTranDoc = (TransitionDocNode)nodeTran.Model; Assert.AreEqual((int)SequenceTree.StateImageId.peak, TransitionTreeNode.GetPeakImageIndex(nodeTranDoc, (PeptideDocNode)nodePep.Model, SkylineWindow.SequenceTree)); var resultsIndex = SkylineWindow.SequenceTree.GetDisplayResultsIndex(nodePep); var rank = nodeTranDoc.GetPeakRank(resultsIndex); if (rank == null || rank > 3) { SkylineWindow.SequenceTree.SelectedNode = nodeTran; } SkylineWindow.SequenceTree.KeysOverride = Keys.Control; } } nodePep = (PeptideTreeNode)SkylineWindow.SequenceTree.Nodes[0].Nodes[2]; nodePep.ExpandAll(); foreach (TransitionTreeNode nodeTran in nodePep.Nodes[0].Nodes) { TransitionDocNode nodeTranDoc = (TransitionDocNode)nodeTran.Model; Assert.AreEqual((int)SequenceTree.StateImageId.peak, TransitionTreeNode.GetPeakImageIndex(nodeTranDoc, (PeptideDocNode)nodePep.Model, SkylineWindow.SequenceTree)); var name = ((TransitionDocNode)nodeTran.Model).FragmentIonName; if (!(name == "y11" || name == "y13" || name == "y14")) // Not L10N { SkylineWindow.SequenceTree.SelectedNode = nodeTran; } SkylineWindow.SequenceTree.KeysOverride = Keys.Control; } SkylineWindow.SequenceTree.KeysOverride = Keys.None; SkylineWindow.EditDelete(); for (int i = 0; i < 3; i++) { Assert.IsTrue(SkylineWindow.SequenceTree.Nodes[0].Nodes[i].Nodes[0].Nodes.Count == 3); } SkylineWindow.AutoZoomNone(); SkylineWindow.SelectedPath = SkylineWindow.Document.GetPathTo((int)SrmDocument.Level.Transitions, 5); SkylineWindow.Size = new Size(722, 449); }); RunUI(SkylineWindow.AutoZoomBestPeak); RestoreViewOnScreen(15); PauseForScreenShot("Targetes view clipped from main window and chromatogram graph metafile", 15); // Automated Refinement, p. 16 RunDlg <RefineDlg>(SkylineWindow.ShowRefineDlg, refineDlg => { refineDlg.MaxTransitionPeakRank = 3; refineDlg.PreferLargerIons = true; refineDlg.RemoveMissingResults = true; refineDlg.RTRegressionThreshold = 0.95; refineDlg.DotProductThreshold = Statistics.AngleToNormalizedContrastAngle(0.95); // Convert from original cos(angle) dot-product refineDlg.OkDialog(); }); WaitForCondition(() => SkylineWindow.Document.PeptideCount < 73); // foreach (var peptideDocNode in SkylineWindow.Document.Peptides) // { // var nodeGroup = ((TransitionGroupDocNode) peptideDocNode.Children[0]); // Console.WriteLine("{0} - {1}", peptideDocNode.Peptide.Sequence, // nodeGroup.GetDisplayText(SkylineWindow.SequenceTree.GetDisplaySettings(peptideDocNode))); // } RunUI(() => { Assert.AreEqual(72, SkylineWindow.Document.PeptideCount); Assert.AreEqual(216, SkylineWindow.Document.PeptideTransitionCount); SkylineWindow.CollapsePeptides(); SkylineWindow.Undo(); }); RunDlg <RefineDlg>(SkylineWindow.ShowRefineDlg, refineDlg => { refineDlg.MaxTransitionPeakRank = 6; refineDlg.RemoveMissingResults = true; refineDlg.RTRegressionThreshold = 0.90; refineDlg.DotProductThreshold = Statistics.AngleToNormalizedContrastAngle(0.90); // Convert from original cos(angle) dot-product refineDlg.OkDialog(); }); WaitForCondition(() => SkylineWindow.Document.PeptideCount < 120); RunUI(() => { Assert.AreEqual(113, SkylineWindow.Document.PeptideCount); // Scheduling for Efficient Acquisition, p. 17 SkylineWindow.Undo(); }); RunDlg <ManageResultsDlg>(SkylineWindow.ManageResults, mResults => { Assert.AreEqual(1, mResults.Chromatograms.Count()); mResults.SelectedChromatograms = SkylineWindow.Document.Settings.MeasuredResults.Chromatograms.Where( set => Equals("Unrefined", set.Name)); // Not L10N mResults.RemoveReplicates(); Assert.AreEqual(0, mResults.Chromatograms.Count()); mResults.OkDialog(); }); var importResultsDlg0 = ShowDialog <ImportResultsDlg>(SkylineWindow.ImportResults); RunUI(() => { SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.Nodes[0]; importResultsDlg0.RadioCreateMultipleMultiChecked = true; importResultsDlg0.NamedPathSets = DataSourceUtil.GetDataSourcesInSubdirs(Path.Combine(TestFilesDirs[1].FullPath, Path.GetFileName(TestFilesDirs[1].FullPath) ?? string.Empty)).ToArray(); }); var importResultsNameDlg = ShowDialog <ImportResultsNameDlg>(importResultsDlg0.OkDialog); RunUI(importResultsNameDlg.NoDialog); WaitForCondition(15 * 60 * 1000, () => SkylineWindow.Document.Settings.HasResults && SkylineWindow.Document.Settings.MeasuredResults.IsLoaded); // 15 minutes var docCurrent = SkylineWindow.Document; RunUI(SkylineWindow.RemoveMissingResults); WaitForDocumentChange(docCurrent); Assert.AreEqual(86, SkylineWindow.Document.PeptideCount); Assert.AreEqual(255, SkylineWindow.Document.PeptideTransitionCount); TestRTResidualsSwitch(); // Measuring Retention Times, p. 17 { var exportDlg = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.List)); RunUI(() => exportDlg.MaxTransitions = 130); PauseForScreenShot <ExportMethodDlg.TransitionListView>("Export Transition List form", 18); OkDialog(exportDlg, () => exportDlg.OkDialog(TestFilesDirs[1].FullPath + "\\unscheduled")); // Not L10N } /////////////////////// // Reviewing Retention Time Runs, p. 18 RunUI(() => { SkylineWindow.ShowGraphSpectrum(false); SkylineWindow.ArrangeGraphsTiled(); SkylineWindow.AutoZoomNone(); SkylineWindow.AutoZoomBestPeak(); }); FindNode("FWEVISDEHGIQPDGTFK"); RunUI(() => SkylineWindow.Size = new Size(1060, 550)); RestoreViewOnScreen(19); PauseForScreenShot("Main window", 19); // Not L10N RunUI(() => SkylineWindow.ShowRTSchedulingGraph()); WaitForCondition(() => SkylineWindow.GraphRetentionTime != null); PauseForScreenShot("Retention Times - Scheduling graph metafile", 19); RestoreViewOnScreen(20); // Creating a Scheduled Transition List, p. 20 { var peptideSettingsUI = ShowDialog <PeptideSettingsUI>(SkylineWindow.ShowPeptideSettingsUI); RunUI(() => { peptideSettingsUI.SelectedTab = PeptideSettingsUI.TABS.Prediction; peptideSettingsUI.TimeWindow = 4; }); PauseForScreenShot <PeptideSettingsUI.PredictionTab>("Peptide Settings - Prediction tab", 21); OkDialog(peptideSettingsUI, peptideSettingsUI.OkDialog); // Not L10N } var exportMethodDlg1 = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.List)); RunUI(() => { exportMethodDlg1.ExportStrategy = ExportStrategy.Single; exportMethodDlg1.MethodType = ExportMethodType.Scheduled; }); // TODO: Update tutorial to mention the scheduling options dialog. PauseForScreenShot("Export Transition List form", 22); // Not L10N RunDlg <SchedulingOptionsDlg>(() => exportMethodDlg1.OkDialog(TestFilesDirs[1].FullPath + "\\scheduled"), // Not L10N schedulingOptionsDlg => schedulingOptionsDlg.OkDialog()); WaitForClosedForm(exportMethodDlg1); // Reviewing Multi-Replicate Data, p. 22 RunDlg <ManageResultsDlg>(SkylineWindow.ManageResults, manageResultsDlg => { manageResultsDlg.RemoveAllReplicates(); manageResultsDlg.OkDialog(); }); var importResultsDlg1 = ShowDialog <ImportResultsDlg>(SkylineWindow.ImportResults); RunDlg <OpenDataSourceDialog>(() => importResultsDlg1.NamedPathSets = importResultsDlg1.GetDataSourcePathsFile(null), openDataSourceDialog => { openDataSourceDialog.SelectAllFileType(ExtThermoRaw); openDataSourceDialog.Open(); }); RunDlg <ImportResultsNameDlg>(importResultsDlg1.OkDialog, importResultsNameDlg0 => { importResultsNameDlg0.Prefix = "Scheduled_"; // Not L10N importResultsNameDlg0.YesDialog(); }); WaitForCondition(15 * 60 * 1000, () => SkylineWindow.Document.Settings.HasResults && SkylineWindow.Document.Settings.MeasuredResults.IsLoaded); // 15 minutes Assert.AreEqual(5, SkylineWindow.GraphChromatograms.Count(graphChrom => !graphChrom.IsHidden)); RunUI(() => { SkylineWindow.RemoveMissingResults(); SkylineWindow.ArrangeGraphsTiled(); SkylineWindow.ShowGraphRetentionTime(false); }); WaitForCondition(() => SkylineWindow.GraphRetentionTime.IsHidden); RunUI(() => { SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.Nodes[0].Nodes[0]; SkylineWindow.ShowRTReplicateGraph(); SkylineWindow.ShowPeakAreaReplicateComparison(); SkylineWindow.CollapsePeptides(); SkylineWindow.ShowChromatogramLegends(false); SkylineWindow.Size = new Size(1024, 768); }); RestoreViewOnScreen(24); WaitForGraphs(); PauseForScreenShot("Main window", 24); // Not L10N RunUI(() => SkylineWindow.SaveDocument()); RunUI(SkylineWindow.NewDocument); }
protected override void DoTest() { var folderAbsoluteQuant = UseRawFiles ? "AbsoluteQuant" : "AbsoluteQuantMzml"; // Generating a Transition List, p. 4 { var doc = SkylineWindow.Document; var transitionSettingsUI = ShowDialog <TransitionSettingsUI>(SkylineWindow.ShowTransitionSettingsUI); RunUI(() => { // Predicition Settings transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.Prediction; transitionSettingsUI.PrecursorMassType = MassType.Monoisotopic; transitionSettingsUI.FragmentMassType = MassType.Monoisotopic; transitionSettingsUI.RegressionCEName = "Thermo TSQ Vantage"; transitionSettingsUI.RegressionDPName = Resources.SettingsList_ELEMENT_NONE_None; }); PauseForScreenShot <TransitionSettingsUI.PredictionTab>("Transition Settings - Prediction tab", 4); RunUI(() => { // Filter Settings transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.Filter; transitionSettingsUI.PrecursorCharges = "2"; transitionSettingsUI.ProductCharges = "1"; transitionSettingsUI.FragmentTypes = "y"; transitionSettingsUI.RangeFrom = Resources.TransitionFilter_FragmentStartFinders_ion_3; transitionSettingsUI.RangeTo = Resources.TransitionFilter_FragmentEndFinders_last_ion_minus_1; transitionSettingsUI.SpecialIons = new string[0]; }); PauseForScreenShot <TransitionSettingsUI.FilterTab>("Transition Settings - Filter tab", 4); OkDialog(transitionSettingsUI, transitionSettingsUI.OkDialog); WaitForDocumentChange(doc); } // Configuring Peptide settings p. 4 PeptideSettingsUI peptideSettingsUI = ShowDialog <PeptideSettingsUI>(SkylineWindow.ShowPeptideSettingsUI); RunUI(() => peptideSettingsUI.SelectedTab = PeptideSettingsUI.TABS.Modifications); PauseForScreenShot <PeptideSettingsUI.ModificationsTab>("Peptide Settings - Modification tab", 5); var modHeavyK = new StaticMod("Label:13C(6)15N(2) (C-term K)", "K", ModTerminus.C, false, null, LabelAtoms.C13 | LabelAtoms.N15, RelativeRT.Matching, null, null, null); AddHeavyMod(modHeavyK, peptideSettingsUI, "Edit Isotope Modification over Transition Settings", 5); RunUI(() => peptideSettingsUI.PickedHeavyMods = new[] { modHeavyK.Name }); PauseForScreenShot <PeptideSettingsUI.ModificationsTab>("Peptide Settings - Modification tab with mod added", 5); OkDialog(peptideSettingsUI, peptideSettingsUI.OkDialog); // Inserting a peptide sequence p. 5 using (new CheckDocumentState(1, 1, 2, 10)) { RunUI(() => SetClipboardText("IEAIPQIDK\tGST-tag")); var pasteDlg = ShowDialog <PasteDlg>(SkylineWindow.ShowPastePeptidesDlg); RunUI(pasteDlg.PastePeptides); WaitForProteinMetadataBackgroundLoaderCompletedUI(); PauseForScreenShot <PasteDlg.PeptideListTab>("Insert Peptide List", 6); OkDialog(pasteDlg, pasteDlg.OkDialog); } RunUI(SkylineWindow.ExpandPrecursors); RunUI(() => SkylineWindow.SaveDocument(TestFilesDir.GetTestPath(folderAbsoluteQuant + @"test_file.sky"))); WaitForCondition(() => File.Exists(TestFilesDir.GetTestPath(folderAbsoluteQuant + @"test_file.sky"))); PauseForScreenShot("Main window with Targets view", 6); // Exporting a transition list p. 6 { var exportMethodDlg = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.List)); RunUI(() => { exportMethodDlg.InstrumentType = ExportInstrumentType.THERMO; exportMethodDlg.ExportStrategy = ExportStrategy.Single; exportMethodDlg.OptimizeType = ExportOptimize.NONE; exportMethodDlg.MethodType = ExportMethodType.Standard; }); PauseForScreenShot <ExportMethodDlg.TransitionListView>("Export Transition List", 7); OkDialog(exportMethodDlg, () => exportMethodDlg.OkDialog(TestFilesDir.GetTestPath("Quant_Abs_Thermo_TSQ_Vantage.csv"))); } // Importing RAW files into Skyline p. 7 var importResultsDlg = ShowDialog <ImportResultsDlg>(SkylineWindow.ImportResults); PauseForScreenShot <ImportResultsDlg>("Import Results - click OK to get shot of Import Results Files and then cancel", 8); RunUI(() => { var rawFiles = DataSourceUtil.GetDataSources(TestFilesDirs[0].FullPath).First().Value.Skip(1); var namedPathSets = from rawFile in rawFiles select new KeyValuePair <string, MsDataFileUri[]>( rawFile.GetFileNameWithoutExtension(), new[] { rawFile }); importResultsDlg.NamedPathSets = namedPathSets.ToArray(); }); RunDlg <ImportResultsNameDlg>(importResultsDlg.OkDialog, importResultsNameDlg => importResultsNameDlg.NoDialog()); WaitForGraphs(); RunUI(() => { SkylineWindow.SelectedPath = SkylineWindow.Document.GetPathTo((int)SrmDocument.Level.Molecules, 0); Settings.Default.ArrangeGraphsOrder = GroupGraphsOrder.Document.ToString(); Settings.Default.ArrangeGraphsReversed = false; SkylineWindow.ArrangeGraphsTiled(); SkylineWindow.AutoZoomBestPeak(); }); WaitForCondition(() => Equals(8, SkylineWindow.GraphChromatograms.Count(graphChrom => !graphChrom.IsHidden)), "unexpected visible graphChromatogram count"); WaitForCondition(10 * 60 * 1000, // ten minutes () => SkylineWindow.Document.Settings.HasResults && SkylineWindow.Document.Settings.MeasuredResults.IsLoaded); PauseForScreenShot("Main window with imported data", 9); // Analyzing SRM Data from FOXN1-GST Sample p. 9 RunDlg <ImportResultsDlg>(SkylineWindow.ImportResults, importResultsDlg1 => { var rawFiles = DataSourceUtil.GetDataSources(TestFilesDirs[0].FullPath).First().Value.Take(1); var namedPathSets = from rawFile in rawFiles select new KeyValuePair <string, MsDataFileUri[]>( rawFile.GetFileNameWithoutExtension(), new[] { rawFile }); importResultsDlg1.NamedPathSets = namedPathSets.ToArray(); importResultsDlg1.OkDialog(); }); WaitForGraphs(); CheckReportCompatibility.CheckAll(SkylineWindow.Document); WaitForCondition(5 * 60 * 1000, // five minutes () => SkylineWindow.Document.Settings.HasResults && SkylineWindow.Document.Settings.MeasuredResults.IsLoaded); RunUI(() => { SkylineWindow.ToggleIntegrateAll(); SkylineWindow.ArrangeGraphsTabbed(); SkylineWindow.ShowRTReplicateGraph(); SkylineWindow.ShowPeakAreaReplicateComparison(); // Total normalization SkylineWindow.NormalizeAreaGraphTo(AreaNormalizeToView.area_percent_view); }); RunUI(() => SkylineWindow.ActivateReplicate("FOXN1-GST")); WaitForGraphs(); RunUI(() => SkylineWindow.SelectedPath = SkylineWindow.DocumentUI.GetPathTo((int)SrmDocument.Level.TransitionGroups, 0)); WaitForGraphs(); RunUI(() => { Assert.AreEqual(SkylineWindow.SelectedResultsIndex, SkylineWindow.GraphPeakArea.ResultsIndex); Assert.AreEqual(SkylineWindow.SelectedResultsIndex, SkylineWindow.GraphRetentionTime.ResultsIndex); }); RunUI(() => { int transitionCount = SkylineWindow.DocumentUI.PeptideTransitionGroups.First().TransitionCount; CheckGstGraphs(transitionCount, transitionCount); }); PauseForScreenShot("Main window with Peak Areas, Retention Times and FOXN1-GST for light", 10); RunUI(() => SkylineWindow.SelectedPath = SkylineWindow.DocumentUI.GetPathTo((int)SrmDocument.Level.TransitionGroups, 1)); WaitForGraphs(); RunUI(() => { int transitionCount = SkylineWindow.DocumentUI.PeptideTransitionGroups.ToArray()[1].TransitionCount; CheckGstGraphs(transitionCount, transitionCount); }); PauseForScreenShot("Main window with Peak Areas, Retention Times and FOXN1-GST for heavy", 10); RunUI(() => SkylineWindow.SelectedPath = SkylineWindow.DocumentUI.GetPathTo((int)SrmDocument.Level.Molecules, 0)); WaitForGraphs(); // Heavy normalization RunUI(() => SkylineWindow.NormalizeAreaGraphTo(AreaNormalizeToView.area_ratio_view)); WaitForGraphs(); RunUI(() => { int transitionGroupCount = SkylineWindow.DocumentUI.Peptides.First().TransitionGroupCount; CheckGstGraphs(transitionGroupCount, transitionGroupCount - 1); }); PauseForScreenShot("Main window with totals graphs for light and heavy and FOXN1-GST", 11); // Peptide Quantitification Settings p. 11 var peptideSettingsUi = ShowDialog <PeptideSettingsUI>(SkylineWindow.ShowPeptideSettingsUI); const string quantUnits = "fmol/ul"; RunUI(() => { peptideSettingsUi.SelectedTab = PeptideSettingsUI.TABS.Quantification; peptideSettingsUi.QuantRegressionFit = RegressionFit.LINEAR; peptideSettingsUi.QuantNormalizationMethod = new NormalizationMethod.RatioToLabel(IsotopeLabelType.heavy); peptideSettingsUi.QuantUnits = quantUnits; }); PauseForScreenShot("Peptide Settings Quantification Tab", 12); OkDialog(peptideSettingsUi, peptideSettingsUi.OkDialog); // Specify analyte concentrations of external standards RunUI(() => SkylineWindow.ShowDocumentGrid(true)); var documentGridForm = FindOpenForm <DocumentGridForm>(); RunUI(() => { documentGridForm.ChooseView(Resources.SkylineViewContext_GetDocumentGridRowSources_Replicates); }); WaitForConditionUI(() => documentGridForm.IsComplete); var concentrations = new[] { 40, 12.5, 5, 2.5, 1, .5, .25, .1 }; for (int iRow = 0; iRow < concentrations.Length; iRow++) { // ReSharper disable AccessToModifiedClosure RunUI(() => { var colSampleType = documentGridForm.FindColumn(PropertyPath.Root.Property("SampleType")); documentGridForm.DataGridView.Rows[iRow].Cells[colSampleType.Index].Value = SampleType.STANDARD; }); WaitForConditionUI(() => documentGridForm.IsComplete); RunUI(() => { var colAnalyteConcentration = documentGridForm.FindColumn(PropertyPath.Root.Property("AnalyteConcentration")); var cell = documentGridForm.DataGridView.Rows[iRow].Cells[colAnalyteConcentration.Index]; documentGridForm.DataGridView.CurrentCell = cell; cell.Value = concentrations[iRow]; }); // ReSharper restore AccessToModifiedClosure WaitForConditionUI(() => documentGridForm.IsComplete); } PauseForScreenShot("Document grid with concentrations filled in", 13); // View the calibration curve p. 13 RunUI(() => SkylineWindow.ShowCalibrationForm()); var calibrationForm = FindOpenForm <CalibrationForm>(); PauseForScreenShot("View calibration curve", 14); Assert.AreEqual(CalibrationCurveFitter.AppendUnits(QuantificationStrings.Analyte_Concentration, quantUnits), calibrationForm.ZedGraphControl.GraphPane.XAxis.Title.Text); Assert.AreEqual(string.Format(QuantificationStrings.CalibrationCurveFitter_PeakAreaRatioText__0___1__Peak_Area_Ratio, IsotopeLabelType.light.Title, IsotopeLabelType.heavy.Title), calibrationForm.ZedGraphControl.GraphPane.YAxis.Title.Text); }
protected override void DoTest() { string skyFile = TestFilesDirs[0].GetTestPath(@"DriftTimePrediction\BSA-Training.sky"); RunUI(() => SkylineWindow.OpenFile(skyFile)); var document = WaitForDocumentLoaded(240 * 1000); // 4 minutes RunUI(() => SkylineWindow.Size = new Size(880, 560)); RestoreViewOnScreen(2); PauseForScreenShot("Document open - full window", 2); AssertEx.IsDocumentState(document, null, 1, 34, 38, 404); { var transitionSettingsUI = ShowDialog <TransitionSettingsUI>(() => SkylineWindow.ShowTransitionSettingsUI(TransitionSettingsUI.TABS.FullScan)); PauseForScreenShot <TransitionSettingsUI.FullScanTab>("Full-scan settings", 3); RunUI(() => { Assert.AreEqual(FullScanPrecursorIsotopes.Count, transitionSettingsUI.PrecursorIsotopesCurrent); Assert.AreEqual(20 * 1000, transitionSettingsUI.PrecursorRes); Assert.AreEqual(FullScanMassAnalyzerType.tof, transitionSettingsUI.PrecursorMassAnalyzer); Assert.AreEqual(IsolationScheme.SpecialHandlingType.ALL_IONS, transitionSettingsUI.IsolationSchemeName); Assert.AreEqual(20 * 1000, transitionSettingsUI.ProductRes); Assert.AreEqual(FullScanMassAnalyzerType.tof, transitionSettingsUI.ProductMassAnalyzer); }); OkDialog(transitionSettingsUI, transitionSettingsUI.CancelDialog); } { var importResults = ShowDialog <ImportResultsDlg>(SkylineWindow.ImportResults); RunUI(() => importResults.ImportSimultaneousIndex = 2); PauseForScreenShot <ImportResultsDlg>("Import results form", 4); // Importing raw data from a sample which is a mixture of yeast and BSA var openDataSourceDialog = ShowDialog <OpenDataSourceDialog>(importResults.OkDialog); RunUI(() => { openDataSourceDialog.CurrentDirectory = new MsDataFilePath(DataPath); openDataSourceDialog.SelectAllFileType(".d"); }); PauseForScreenShot <OpenDataSourceDialog>("Import results files", 5); OkDialog(openDataSourceDialog, openDataSourceDialog.Open); } string yeastReplicateName = Path.GetFileNameWithoutExtension(Yeast_BSA); PauseForScreenShot <AllChromatogramsGraph>("Importing results form", 6); WaitForDocumentChangeLoaded(document, 1000 * 60 * 60 * 10); // 10 minutes // Arrange graphs tiled RunUI(() => { SkylineWindow.ArrangeGraphsTiled(); SkylineWindow.AutoZoomBestPeak(); SkylineWindow.ShowSplitChromatogramGraph(true); }); FindNode("R.FKDLGEEHFK.G"); RunUI(() => SkylineWindow.Size = new Size(1075, 799)); RestoreViewOnScreen(7); PauseForScreenShot("Zoomed split graph panes onely", 7); RunUI(() => SkylineWindow.AutoZoomNone()); PauseForScreenShot("Unzoomed split graph panes onely", 8); RunUI(() => { SkylineWindow.AutoZoomBestPeak(); SkylineWindow.ShowRTReplicateGraph(); SkylineWindow.ShowGraphPeakArea(true); SkylineWindow.ShowChromatogramLegends(false); SkylineWindow.ShowPeakAreaLegend(false); SkylineWindow.NormalizeAreaGraphTo(AreaNormalizeToView.area_percent_view); SkylineWindow.SynchronizeZooming(true); SkylineWindow.Size = new Size(1547, 855); }); RestoreViewOnScreen(9); PauseForScreenShot("Full window", 9); FindNode("TCVADESHAGCEK"); var noteDlg = ShowDialog <EditNoteDlg>(SkylineWindow.EditNote); RunUI(() => noteDlg.NoteText = "Lost in yeast samples"); PauseForScreenShot("Peptide note", 10); OkDialog(noteDlg, noteDlg.OkDialog); FindNode("NECFLSHKDDSPDLPK"); PauseForScreenShot("Yeast chromatograms and RT only - prtsc-paste-edit", 11); PauseForScreenShot("Hover over BSA in water chromatogram - prtsc-paste-edit", 12); RestoreViewOnScreen(13); PauseForScreenShot("Full scan 2D MS1 graph", 13); { const double clickTime1 = 41.06; ClickChromatogram(clickTime1, 1.62E+6, PaneKey.PRECURSORS); var fullScanGraph = FindOpenForm <GraphFullScan>(); RunUI(() => fullScanGraph.SetSpectrum(false)); PauseForScreenShot("Full scan 3D MS1 graph", 13); ValidateClickTime(fullScanGraph, clickTime1); RunUI(() => fullScanGraph.SetZoom(false)); PauseForScreenShot("Full scan unzoomed 3D MS1 graph", 14); const double clickTime2 = 41.02; RunUI(() => fullScanGraph.SetZoom(true)); ClickChromatogram(clickTime2, 5.8E+4, PaneKey.PRODUCTS); PauseForScreenShot("Full scan 3D MS/MS graph", 15); ValidateClickTime(fullScanGraph, clickTime2); RunUI(() => fullScanGraph.SetZoom(false)); PauseForScreenShot("Full scan unzoomed 3D MS/MS graph", 14); const double clickTime3 = 41.48; ClickChromatogram(yeastReplicateName, clickTime3, 3.14E+4, PaneKey.PRODUCTS); PauseForScreenShot("Interference full scan unzoomed 3D MS/MS graph", 15); ValidateClickTime(fullScanGraph, clickTime3); RunUI(SkylineWindow.HideFullScanGraph); } RunDlg <ManageResultsDlg>(SkylineWindow.ManageResults, dlg => { dlg.SelectedChromatograms = SkylineWindow.Document.Settings.MeasuredResults.Chromatograms.Skip(1); dlg.RemoveReplicates(); dlg.OkDialog(); }); RunUI(() => SkylineWindow.SaveDocument()); { var peptideSettingsUI = ShowDialog <PeptideSettingsUI>(SkylineWindow.ShowPeptideSettingsUI); RunUI(() => peptideSettingsUI.SelectedTab = PeptideSettingsUI.TABS.Prediction); var driftPredictor = ShowDialog <EditDriftTimePredictorDlg>(peptideSettingsUI.AddDriftTimePredictor); const string predictorName = "BSA"; RunUI(() => { driftPredictor.SetPredictorName(predictorName); driftPredictor.SetResolvingPower(50); driftPredictor.GetDriftTimesFromResults(); }); PauseForScreenShot("Edit predictor form", 18); OkDialog(driftPredictor, () => driftPredictor.OkDialog()); PauseForScreenShot("Peptide Settings - Prediction", 19); RunUI(() => { Assert.IsTrue(peptideSettingsUI.IsUseMeasuredRT); Assert.AreEqual(6, peptideSettingsUI.TimeWindow); Assert.AreEqual(predictorName, peptideSettingsUI.SelectedDriftTimePredictor); }); OkDialog(peptideSettingsUI, peptideSettingsUI.OkDialog); } { var transitionSettingsUI = ShowDialog <TransitionSettingsUI>(SkylineWindow.ShowTransitionSettingsUI); RunUI(() => { transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.FullScan; transitionSettingsUI.SetRetentionTimeFilter(RetentionTimeFilterType.scheduling_windows, 3); }); PauseForScreenShot("Transition Settings - Full-Scan", 20); OkDialog(transitionSettingsUI, transitionSettingsUI.OkDialog); } using (new WaitDocumentChange(1, true, 1000 * 60 * 60 * 5)) { var choosePredictionReplicates = ShowDialog <ChooseSchedulingReplicatesDlg>(SkylineWindow.ImportResults); PauseForScreenShot("Choose Replicates form", 21); RunUI(() => choosePredictionReplicates.SelectOrDeselectAll(true)); var importResults = ShowDialog <ImportResultsDlg>(choosePredictionReplicates.OkDialog); RunDlg <OpenDataSourceDialog>(importResults.OkDialog, openDataSourceDialog => { openDataSourceDialog.CurrentDirectory = new MsDataFilePath(DataPath); openDataSourceDialog.SelectAllFileType(Yeast_BSA); openDataSourceDialog.Open(); }); } WaitForGraphs(); // CONSIDER: Test the peak annotations to ensure the filtering happened PauseForScreenShot("Yeast chromatogram and RTs - prtsc-paste-edit", 22); { const double clickTime = 42.20; ClickChromatogram(yeastReplicateName, clickTime, 2.904E+4, PaneKey.PRODUCTS); var fullScanGraph = FindOpenForm <GraphFullScan>(); RunUI(() => fullScanGraph.SetZoom(true)); PauseForScreenShot("Full-scan graph zoomed", 23); RunUI(() => Assert.IsTrue(fullScanGraph.TitleText.Contains(clickTime.ToString(CultureInfo.CurrentCulture)))); RunUI(SkylineWindow.HideFullScanGraph); } FindNode("FKDLGEEHFK"); PauseForScreenShot("Chromatograms (copy metafile) and legend - prtsc-paste-edit", 23); PauseForScreenShot("Peak area percentages (copy metafile)", 24); var docFiltered = SkylineWindow.Document; RunDlg <ManageResultsDlg>(SkylineWindow.ManageResults, manageDlg => { manageDlg.SelectedChromatograms = SkylineWindow.Document.Settings.MeasuredResults.Chromatograms.Take(1); manageDlg.ReimportResults(); manageDlg.OkDialog(); }); WaitForDocumentChangeLoaded(docFiltered, 1000 * 60 * 60 * 5); // 5 minutes // TODO: Check peak ranks before and after }
protected override void DoTest() { // Check backward compatibility with 19.1.9.338 and 350 when combined IMS got written to MsDataFilePath string legacyFile_19_1_9 = TestFilesDirs[1].GetTestPath(@"BSA-Training.sky"); RunUI(() => SkylineWindow.OpenFile(legacyFile_19_1_9)); VerifyCombinedIonMobility(WaitForDocumentLoaded()); RunUI(() => { SkylineWindow.SaveDocument(); SkylineWindow.NewDocument(); SkylineWindow.OpenFile(legacyFile_19_1_9); }); VerifyCombinedIonMobility(WaitForDocumentLoaded()); var oldDoc = SkylineWindow.Document; string skyFile = TestFilesDirs[0].GetTestPath(@"IMSFiltering\BSA-Training.sky"); RunUI(() => SkylineWindow.OpenFile(skyFile)); var document = WaitForDocumentChangeLoaded(oldDoc, 240 * 1000); // 4 minutes RunUI(() => SkylineWindow.Size = new Size(880, 560)); RestoreViewOnScreen(2); PauseForScreenShot("Document open - full window", 2); AssertEx.IsDocumentState(document, null, 1, 34, 38, 404); { var transitionSettingsUI = ShowDialog <TransitionSettingsUI>(() => SkylineWindow.ShowTransitionSettingsUI(TransitionSettingsUI.TABS.FullScan)); PauseForScreenShot <TransitionSettingsUI.FullScanTab>("Full-scan settings", 3); RunUI(() => { Assert.AreEqual(FullScanPrecursorIsotopes.Count, transitionSettingsUI.PrecursorIsotopesCurrent); Assert.AreEqual(20 * 1000, transitionSettingsUI.PrecursorRes); Assert.AreEqual(FullScanMassAnalyzerType.tof, transitionSettingsUI.PrecursorMassAnalyzer); Assert.AreEqual(IsolationScheme.SpecialHandlingType.ALL_IONS, transitionSettingsUI.IsolationSchemeName); Assert.AreEqual(20 * 1000, transitionSettingsUI.ProductRes); Assert.AreEqual(FullScanMassAnalyzerType.tof, transitionSettingsUI.ProductMassAnalyzer); }); OkDialog(transitionSettingsUI, transitionSettingsUI.CancelDialog); } { var importResults = ShowDialog <ImportResultsDlg>(SkylineWindow.ImportResults); RunUI(() => importResults.ImportSimultaneousIndex = 2); PauseForScreenShot <ImportResultsDlg>("Import results form", 4); // Importing raw data from a sample which is a mixture of yeast and BSA var openDataSourceDialog = ShowDialog <OpenDataSourceDialog>(importResults.OkDialog); RunUI(() => { openDataSourceDialog.CurrentDirectory = new MsDataFilePath(DataPath); openDataSourceDialog.SelectAllFileType(".d"); }); PauseForScreenShot <OpenDataSourceDialog>("Import results files", 5); OkDialog(openDataSourceDialog, openDataSourceDialog.Open); } string yeastReplicateName = Path.GetFileNameWithoutExtension(Yeast_BSA); PauseForScreenShot <AllChromatogramsGraph>("Importing results form", 6); WaitForDocumentChangeLoaded(document, 1000 * 60 * 60 * 10); // 10 minutes // Arrange graphs tiled RunUI(() => { SkylineWindow.ArrangeGraphsTiled(); SkylineWindow.AutoZoomBestPeak(); SkylineWindow.ShowSplitChromatogramGraph(true); }); FindNode("R.FKDLGEEHFK.G"); RunUI(() => SkylineWindow.Size = new Size(1075, 799)); RestoreViewOnScreen(7); PauseForScreenShot("Zoomed split graph panes only", 7); RunUI(() => SkylineWindow.AutoZoomNone()); PauseForScreenShot("Unzoomed split graph panes only", 8); const int wideWidth = 1547; RunUI(() => { SkylineWindow.AutoZoomBestPeak(); SkylineWindow.ShowRTReplicateGraph(); SkylineWindow.ShowGraphPeakArea(true); SkylineWindow.ShowChromatogramLegends(false); SkylineWindow.ShowPeakAreaLegend(false); SkylineWindow.NormalizeAreaGraphTo(NormalizeOption.TOTAL); SkylineWindow.SynchronizeZooming(true); SkylineWindow.Size = new Size(wideWidth, 855); }); RestoreViewOnScreen(9); PauseForScreenShot("Full window", 9); FindNode("TCVADESHAGCEK"); var noteDlg = ShowDialog <EditNoteDlg>(SkylineWindow.EditNote); RunUI(() => noteDlg.NoteText = "Lost in yeast samples"); PauseForScreenShot("Peptide note", 10); OkDialog(noteDlg, noteDlg.OkDialog); FindNode("NECFLSHKDDSPDLPK"); RestoreViewOnScreen(11); const int narrowWidth = 1350; RunUI(() => SkylineWindow.Width = narrowWidth); PauseForScreenShot("Yeast chromatograms and RT only - prtsc-paste-edit", 11); PauseForScreenShot("Hover over BSA in water chromatogram - prtsc-paste-edit", 12); RunUI(() => SkylineWindow.Width = wideWidth); RestoreViewOnScreen(13); { const double clickTime1 = 41.06; ClickChromatogram(clickTime1, 1.62E+6, PaneKey.PRECURSORS); PauseForScreenShot("Full scan 2D MS1 graph", 13); var fullScanGraph = FindOpenForm <GraphFullScan>(); RunUI(() => fullScanGraph.SetSpectrum(false)); PauseForScreenShot("Full scan 3D MS1 graph", 13); ValidateClickTime(fullScanGraph, clickTime1); RunUI(() => fullScanGraph.SetZoom(false)); PauseForScreenShot("Full scan unzoomed 3D MS1 graph", 14); const double clickTime2 = 41.02; RunUI(() => fullScanGraph.SetZoom(true)); ClickChromatogram(clickTime2, 5.8E+4, PaneKey.PRODUCTS); PauseForScreenShot("Full scan 3D MS/MS graph", 15); ValidateClickTime(fullScanGraph, clickTime2); RunUI(() => fullScanGraph.SetZoom(false)); PauseForScreenShot("Full scan unzoomed 3D MS/MS graph", 15); if (IsCoverShotMode) { RunUI(() => { Settings.Default.ChromatogramFontSize = 14; Settings.Default.AreaFontSize = 14; SkylineWindow.ChangeTextSize(TreeViewMS.LRG_TEXT_FACTOR); }); RestoreCoverViewOnScreen(); ClickChromatogram(clickTime2, 5.8E+4, PaneKey.PRODUCTS); var manageResultsDlg = ShowDialog <ManageResultsDlg>(SkylineWindow.ManageResults); RenameReplicate(manageResultsDlg, 0, "BSA"); RenameReplicate(manageResultsDlg, 1, "Yeast_BSA"); OkDialog(manageResultsDlg, manageResultsDlg.OkDialog); RunUI(SkylineWindow.FocusDocument); TakeCoverShot(); return; } const double clickTime3 = 41.48; ClickChromatogram(yeastReplicateName, clickTime3, 3.14E+4, PaneKey.PRODUCTS); PauseForScreenShot("Interference full scan unzoomed 3D MS/MS graph", 16); ValidateClickTime(fullScanGraph, clickTime3); RunUI(SkylineWindow.HideFullScanGraph); } RunDlg <ManageResultsDlg>(SkylineWindow.ManageResults, dlg => { dlg.SelectedChromatograms = SkylineWindow.Document.Settings.MeasuredResults.Chromatograms.Skip(1); dlg.RemoveReplicates(); dlg.OkDialog(); }); RunUI(() => SkylineWindow.SaveDocument()); { var transitionSettingsUI = ShowDialog <TransitionSettingsUI>(SkylineWindow.ShowTransitionSettingsUI); RunUI(() => { transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.IonMobility; transitionSettingsUI.IonMobilityControl.WindowWidthType = IonMobilityWindowWidthCalculator .IonMobilityWindowWidthType.resolving_power; transitionSettingsUI.IonMobilityControl.IonMobilityFilterResolvingPower = 50; }); PauseForScreenShot("Setting ion mobility filter width calculation values", 17); var editIonMobilityLibraryDlg = ShowDialog <EditIonMobilityLibraryDlg>(transitionSettingsUI.IonMobilityControl.AddIonMobilityLibrary); const string libraryName = "BSA"; var databasePath = TestFilesDirs[1].GetTestPath(libraryName + IonMobilityDb.EXT); RunUI(() => { editIonMobilityLibraryDlg.LibraryName = libraryName; editIonMobilityLibraryDlg.CreateDatabaseFile(databasePath); // Simulate user click on Create button editIonMobilityLibraryDlg.SetOffsetHighEnergySpectraCheckbox(true); editIonMobilityLibraryDlg.GetIonMobilitiesFromResults(); }); PauseForScreenShot("Edit ion mobility library form", 18); // Check that a new value was calculated for all precursors RunUI(() => Assert.AreEqual(SkylineWindow.Document.MoleculeTransitionGroupCount, editIonMobilityLibraryDlg.LibraryMobilitiesFlatCount)); OkDialog(editIonMobilityLibraryDlg, () => editIonMobilityLibraryDlg.OkDialog()); PauseForScreenShot <TransitionSettingsUI.IonMobilityTab>("Transition Settings - Ion Mobility", 19); RunUI(() => { transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.FullScan; transitionSettingsUI.SetRetentionTimeFilter(RetentionTimeFilterType.scheduling_windows, 3); }); PauseForScreenShot("Transition Settings - Full-Scan", 20); OkDialog(transitionSettingsUI, transitionSettingsUI.OkDialog); var peptideSettingsUI = ShowDialog <PeptideSettingsUI>(SkylineWindow.ShowPeptideSettingsUI); RunUI(() => peptideSettingsUI.SelectedTab = PeptideSettingsUI.TABS.Prediction); PauseForScreenShot("Peptide Settings - Prediction", 21); RunUI(() => { Assert.IsTrue(peptideSettingsUI.IsUseMeasuredRT); Assert.AreEqual(6, peptideSettingsUI.TimeWindow); }); OkDialog(peptideSettingsUI, peptideSettingsUI.OkDialog); } using (new WaitDocumentChange(1, true, 1000 * 60 * 60 * 5)) { var choosePredictionReplicates = ShowDialog <ChooseSchedulingReplicatesDlg>(SkylineWindow.ImportResults); PauseForScreenShot("Choose Replicates form", 22); RunUI(() => choosePredictionReplicates.SelectOrDeselectAll(true)); var importResults = ShowDialog <ImportResultsDlg>(choosePredictionReplicates.OkDialog); RunDlg <OpenDataSourceDialog>(importResults.OkDialog, openDataSourceDialog => { openDataSourceDialog.CurrentDirectory = new MsDataFilePath(DataPath); openDataSourceDialog.SelectAllFileType(Yeast_BSA); openDataSourceDialog.Open(); }); } WaitForGraphs(); // Test to ensure the filtering happened if (!IsPauseForScreenShots) // Don't bring up unexpected UI in a screenshot run { TestReports(); } RestoreViewOnScreen(11); RunUI(() => SkylineWindow.Width = narrowWidth); PauseForScreenShot("Yeast chromatogram and RTs - prtsc-paste-edit", 23); RunUI(() => SkylineWindow.Width = wideWidth); RestoreViewOnScreen(13); { const double clickTime = 42.20; ClickChromatogram(yeastReplicateName, clickTime, 2.904E+4, PaneKey.PRODUCTS); var fullScanGraph = FindOpenForm <GraphFullScan>(); RunUI(() => fullScanGraph.SetZoom(true)); RunUI(() => fullScanGraph.Parent.Parent.Size = new Size(671, 332)); PauseForScreenShot("Full-scan graph zoomed", 24); RunUI(() => Assert.IsTrue(fullScanGraph.TitleText.Contains(clickTime.ToString(CultureInfo.CurrentCulture)))); RunUI(SkylineWindow.HideFullScanGraph); } FindNode("FKDLGEEHFK"); RunUI(() => { SkylineWindow.Size = new Size(1547, 689); SkylineWindow.ShowProductTransitions(); SkylineWindow.ShowPeakAreaLegend(true); }); RestoreViewOnScreen(25); PauseForScreenShot("Chromatograms and Peak Areas - prtsc-paste-edit", 25); var docFiltered = SkylineWindow.Document; RunDlg <ManageResultsDlg>(SkylineWindow.ManageResults, manageDlg => { manageDlg.SelectedChromatograms = SkylineWindow.Document.Settings.MeasuredResults.Chromatograms.Take(1); manageDlg.ReimportResults(); manageDlg.OkDialog(); }); WaitForDocumentChangeLoaded(docFiltered, 1000 * 60 * 60 * 5); // 5 minutes // TODO: Check peak ranks before and after AssertEx.IsFalse(IsRecordMode); // Make sure we turn this off before commit! }
protected override void DoTest() { // iRT Retention Time Prediction string standardDocumentFile = GetTestPath("iRT-C18 Standard.sky"); // Not L10N RunUI(() => SkylineWindow.OpenFile(standardDocumentFile)); WaitForDocumentLoaded(); // might have some updating to do for protein metadata RunUI(() => SkylineWindow.SaveDocument(GetTestPath("iRT-C18 Calibrate.sky"))); // Not L10N // Load raw files for iRT calculator calibration p. 2 const string unschedHuman1Fileroot = "A_D110907_SiRT_HELA_11_nsMRM_150selected_1_30min-5-35"; // Not L10N string unschedHuman1Name = unschedHuman1Fileroot.Substring(41); const string unschedHuman2Fileroot = "A_D110907_SiRT_HELA_11_nsMRM_150selected_2_30min-5-35"; // Not L10N string unschedHuman2Name = unschedHuman2Fileroot.Substring(41); ImportNewResults(new[] { unschedHuman1Fileroot, unschedHuman2Fileroot }, 41, false, false); var docCalibrate = WaitForProteinMetadataBackgroundLoaderCompletedUI(); const int pepCount = 11, tranCount = 33; AssertEx.IsDocumentState(docCalibrate, null, 1, pepCount, pepCount, tranCount); AssertResult.IsDocumentResultsState(docCalibrate, unschedHuman1Name, pepCount, pepCount, 0, tranCount, 0); AssertResult.IsDocumentResultsState(docCalibrate, unschedHuman2Name, pepCount, pepCount, 0, tranCount, 0); RunUI(() => { SkylineWindow.ArrangeGraphsTiled(); SkylineWindow.ShowRTPeptideGraph(); using (var enumLabels = SkylineWindow.RTGraphController.GraphSummary.Categories.GetEnumerator()) { foreach (var nodePep in docCalibrate.Peptides) { Assert.IsTrue(enumLabels.MoveNext() && enumLabels.Current != null); Assert.IsTrue(nodePep.Peptide.Sequence.StartsWith(enumLabels.Current.Substring(0, 3))); } } }); // Page 3. PauseForScreenShot <GraphSummary.RTGraphView>("RT graph metafile", 3); // Peptide RT graph RunUI(() => { SkylineWindow.ShowRTReplicateGraph(); SkylineWindow.AutoZoomBestPeak(); SkylineWindow.SelectedPath = docCalibrate.GetPathTo((int)SrmDocument.Level.Molecules, 0); }); // Ensure graphs look like p. 3 and 4 WaitForGraphs(); RestoreViewOnScreen(04); PauseForScreenShot("Main window showing chromatograms and RT graph", 4); // Skyline window with docked RT replicate comparison graph RunUI(() => { Assert.AreEqual(3, SkylineWindow.RTGraphController.GraphSummary.CurveCount); Assert.AreEqual(2, SkylineWindow.RTGraphController.GraphSummary.Categories.Count()); var chromGraphs = SkylineWindow.GraphChromatograms.ToArray(); Assert.AreEqual(2, chromGraphs.Length); Assert.AreEqual(11.3, chromGraphs[0].GraphItems.First().BestPeakTime, 0.05); Assert.AreEqual(11.2, chromGraphs[1].GraphItems.First().BestPeakTime, 0.05); }); var listTimes = new List <double>(); for (int i = 0; i < docCalibrate.PeptideCount; i++) { int iPeptide = i; RunUI(() => { SkylineWindow.SelectedPath = docCalibrate.GetPathTo((int)SrmDocument.Level.Molecules, iPeptide); }); WaitForGraphs(); RunUI(() => { var chromGraphs = SkylineWindow.GraphChromatograms.ToArray(); double time1 = chromGraphs[0].GraphItems.First(g => g.BestPeakTime > 0).BestPeakTime; double time2 = chromGraphs[1].GraphItems.First(g => g.BestPeakTime > 0).BestPeakTime; listTimes.Add((time1 + time2) / 2); Assert.AreEqual(time1, time2, 0.2); }); } // Calibrate a calculator p. 4-5 const string irtCalcName = "iRT-C18"; var peptideSettingsUI1 = ShowDialog <PeptideSettingsUI>(SkylineWindow.ShowPeptideSettingsUI); var editIrtCalc1 = ShowDialog <EditIrtCalcDlg>(peptideSettingsUI1.AddCalculator); RunUI(() => { editIrtCalc1.CalcName = irtCalcName; editIrtCalc1.CreateDatabase(GetTestPath("iRT-C18.irtdb")); // Not L10N }); { var calibrateDlg = ShowDialog <CalibrateIrtDlg>(editIrtCalc1.Calibrate); RunUI(() => { calibrateDlg.UseResults(); Assert.AreEqual(11, calibrateDlg.StandardPeptideCount); calibrateDlg.SetFixedPoints(1, 10); for (int i = 0; i < calibrateDlg.StandardPeptideCount; i++) { Assert.AreEqual(listTimes[i], calibrateDlg.StandardPeptideList[i].RetentionTime, 0.2); } }); PauseForScreenShot <CalibrateIrtDlg>("Calibrate iRT Calculator form", 5); // Calibrate iRT Calculator form RunUI(calibrateDlg.OkDialog); } Assert.IsTrue(WaitForConditionUI(() => editIrtCalc1.StandardPeptideCount == 11)); PauseForScreenShot <EditIrtCalcDlg>("Edit iRT Calculater form", 6); // Edit iRT Caclulator form // Check iRT values and update to defined values p. 6-7 var irtDefinitionPath = GetTestPath("iRT definition.xlsx"); // Not L10N string irtDefText = GetExcelFileText(irtDefinitionPath, "iRT-C18", 2, true); // Not L10N RunUI(() => { var standardPeptidesArray = editIrtCalc1.StandardPeptides.ToArray(); Assert.AreEqual(11, standardPeptidesArray.Length); Assert.AreEqual(0, standardPeptidesArray[1].Irt, 0.00001); Assert.AreEqual(100, standardPeptidesArray[10].Irt, 0.00001); CheckIrtStandardPeptides(standardPeptidesArray, irtDefText, 6); SetClipboardText(irtDefText); editIrtCalc1.DoPasteStandard(); standardPeptidesArray = editIrtCalc1.StandardPeptides.ToArray(); Assert.AreEqual(11, standardPeptidesArray.Length); Assert.AreEqual(0, standardPeptidesArray[1].Irt, 0.001); Assert.AreEqual(100, standardPeptidesArray[10].Irt, 0.005); CheckIrtStandardPeptides(standardPeptidesArray, irtDefText, 0.00001); }); OkDialog(editIrtCalc1, editIrtCalc1.OkDialog); OkDialog(peptideSettingsUI1, peptideSettingsUI1.OkDialog); // Inspect RT regression graph p. 8 RunUI(SkylineWindow.ShowRTRegressionGraphScoreToRun); WaitForRegression(); RestoreViewOnScreen(08); PauseForScreenShot <GraphSummary.RTGraphView>("Retention Times Regression graph metafile", 8); // RT Regression graph RunUI(() => { VerifyRTRegression(0.15, 15.09, 0.9991); SkylineWindow.ShowSingleReplicate(); SkylineWindow.SequenceTree.Focus(); // If the focus is left on the results tab, then the next line does nothing SkylineWindow.SelectedResultsIndex = 0; }); WaitForRegression(); RunUI(() => { VerifyRTRegression(0.15, 15.15, 0.9991); SkylineWindow.SelectedResultsIndex = 1; }); WaitForRegression(); RunUI(() => VerifyRTRegression(0.15, 15.04, 0.9991)); RunUI(() => SkylineWindow.ShowAverageReplicates()); RunUI(() => SkylineWindow.SaveDocument()); // Create a document containing human and standard peptides, p. 9 RunUI(() => SkylineWindow.OpenFile(GetTestPath("iRT Human.sky"))); WaitForProteinMetadataBackgroundLoaderCompletedUI(); // let peptide metadata background loader do its work RunUI(() => { SkylineWindow.SelectedPath = new IdentityPath(SequenceTree.NODE_INSERT_ID); SkylineWindow.ImportFiles(standardDocumentFile); }); WaitForProteinMetadataBackgroundLoaderCompletedUI(); // let peptide metadata background loader do its work RestoreViewOnScreen(09); PauseForScreenShot("Targets tree clipped out of main winodw", 9); // Target tree RunUI(() => { Assert.AreEqual("iRT-C18 Standard Peptides", SkylineWindow.SelectedNode.Text); // Not L10N Assert.AreEqual(1231, SkylineWindow.DocumentUI.PeptideTransitionCount); SkylineWindow.SaveDocument(GetTestPath("iRT Human+Standard.sky")); // Not L10N SkylineWindow.SaveDocument(GetTestPath("iRT Human+Standard Calibrate.sky")); // Not L10N }); // Remove heavy precursors, p. 10 var docHumanAndStandard = SkylineWindow.Document; RunDlg <RefineDlg>(SkylineWindow.ShowRefineDlg, refineDlg => { refineDlg.RefineLabelType = IsotopeLabelType.heavy; refineDlg.OkDialog(); }); var docLightOnly = WaitForDocumentChange(docHumanAndStandard); Assert.AreEqual(632, docLightOnly.PeptideTransitionCount); // Create auto-calculate regression RT predictor, p. 10 const string irtPredictorName = "iRT-C18"; // Not L10N { var docPre = SkylineWindow.Document; var peptideSettingsUI2 = ShowDialog <PeptideSettingsUI>(SkylineWindow.ShowPeptideSettingsUI); RunUI(() => peptideSettingsUI2.ChooseRegression(irtPredictorName)); var regressionDlg = ShowDialog <EditRTDlg>(peptideSettingsUI2.EditRegression); RunUI(() => { Assert.AreEqual(irtPredictorName, regressionDlg.Regression.Name); Assert.AreEqual(irtCalcName, regressionDlg.Regression.Calculator.Name); regressionDlg.SetAutoCalcRegression(true); regressionDlg.SetTimeWindow(5); }); PauseForScreenShot("Edit Retention Time Predictor form", 10); // Edit retention time predictor form OkDialog(regressionDlg, regressionDlg.OkDialog); OkDialog(peptideSettingsUI1, peptideSettingsUI2.OkDialog); // Make sure iRT calculator is loaded WaitForDocumentChangeLoaded(docPre); } // Export unscheduled transition list, p. 11 { const string calibrateBasename = "iRT Human+Standard Calibrate"; // Not L10N var exportMethodDlg = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.List)); RunUI(() => { exportMethodDlg.ExportStrategy = ExportStrategy.Buckets; exportMethodDlg.IgnoreProteins = true; exportMethodDlg.MaxTransitions = 335; }); PauseForScreenShot <ExportMethodDlg.TransitionListView>("Export Transition List form", 11); RunUI(() => exportMethodDlg.OkDialog(GetTestPath(calibrateBasename + TextUtil.EXT_CSV))); WaitForClosedForm(exportMethodDlg); Assert.AreEqual(332, File.ReadAllLines(GetTestPath(calibrateBasename + "_0001.csv")).Length); // Not L10N Assert.AreEqual(333 + (TestSmallMolecules ? 2 : 0), File.ReadAllLines(GetTestPath(calibrateBasename + "_0002.csv")).Length); // Not L10N } // Import human peptide calibration results p. 12 ImportNewResults(new[] { unschedHuman1Fileroot, unschedHuman2Fileroot }, -1, true); // Review iRT-C18 graph p. 12-13 RunUI(() => SkylineWindow.ChooseCalculator(irtCalcName)); RunUI(SkylineWindow.ShowRTRegressionGraphScoreToRun); WaitForRegression(); PauseForScreenShot <GraphSummary.RTGraphView>("RT Regression graph metafile", 13); RunUI(() => { VerifyRTRegression(0.15, 15.09, 0.9991); Assert.AreEqual(11, SkylineWindow.DocumentUI.PeptideCount - SkylineWindow.RTGraphController.Outliers.Length); }); // Find all unintegrated transitions, p. 13-14 { var findDlg = ShowDialog <FindNodeDlg>(SkylineWindow.ShowFindNodeDlg); RunUI(() => { findDlg.FindOptions = new FindOptions().ChangeText(string.Empty) .ChangeCustomFinders(Finders.ListAllFinders().Where(f => f is UnintegratedTransitionFinder)); }); PauseForScreenShot <FindNodeDlg>("Find form", 14); RestoreViewOnScreen(15); RunUI(() => { findDlg.FindAll(); findDlg.Close(); }); WaitForClosedForm(findDlg); } PauseForScreenShot <FindResultsForm>("Find Results pane", 14); var findAllForm = WaitForOpenForm <FindResultsForm>(); Assert.IsNotNull(findAllForm); const int expectedItems = 6; RunUI(() => { Assert.AreEqual(expectedItems, findAllForm.ItemCount); SkylineWindow.ShowAllTransitions(); SkylineWindow.AutoZoomBestPeak(); }); // Review peaks with missing transitions, p. 15 for (int i = 0; i < expectedItems; i++) { int iItem = i; RunUI(() => findAllForm.ActivateItem(iItem)); WaitForGraphs(); RunUI(() => Assert.AreEqual((int)SequenceTree.StateImageId.no_peak, SkylineWindow.SelectedNode.StateImageIndex)); if (i == 2) { PauseForScreenShot <GraphChromatogram>("Chromatogram graph metafile (1 of 2)", 15); } if (i == 3) { RunUI(() => { var document = SkylineWindow.DocumentUI; var nodeGroup = document.FindNode(SkylineWindow.SelectedPath.Parent) as TransitionGroupDocNode; Assert.IsNotNull(nodeGroup); var nodeTran = document.FindNode(SkylineWindow.SelectedPath) as TransitionDocNode; Assert.IsNotNull(nodeTran); var graph = SkylineWindow.GetGraphChrom(Resources.ImportResultsDlg_DefaultNewName_Default_Name); // New peak picking picks correct peak Assert.AreEqual(19.8, graph.BestPeakTime.Value, 0.05); // TransitionGroupDocNode nodeGroupGraph; // TransitionDocNode nodeTranGraph; // var scaledRT = graph.FindAnnotatedPeakRetentionTime(19.8, out nodeGroupGraph, out nodeTranGraph); // Assert.AreSame(nodeGroup, nodeGroupGraph); // Assert.AreNotSame(nodeTran, nodeTranGraph); // Assert.AreEqual(7, nodeTranGraph.Transition.Ordinal); // y7 // graph.FirePickedPeak(nodeGroupGraph, nodeTranGraph, scaledRT); }); } if (i == 4) { PauseForScreenShot <GraphChromatogram>("Chromatogram graph metafile (2 of 2)", 15); // Chromatogram graph } } // New peak picking picks correct peak // RunUI(() => findAllForm.ActivateItem(3)); // PauseForScreenShot<GraphChromatogram>("Chromatogram graph metafile (3 of 3)", 15); RunUI(SkylineWindow.ToggleIntegrateAll); RunUI(findAllForm.Close); WaitForClosedForm(findAllForm); RestoreViewOnScreen(17); // Calculate new iRT values for human peptides, p. 16 { var editIrtCalc2 = ShowDialog <EditIrtCalcDlg>(SkylineWindow.ShowEditCalculatorDlg); RunUI(() => Assert.AreEqual(0, editIrtCalc2.LibraryPeptideCount)); var addPeptidesDlg = ShowDialog <AddIrtPeptidesDlg>(editIrtCalc2.AddResults); PauseForScreenShot <AddIrtPeptidesDlg>("Add Peptides form", 15); RunUI(() => { Assert.AreEqual(148, addPeptidesDlg.PeptidesCount); Assert.AreEqual(2, addPeptidesDlg.RunsConvertedCount); Assert.AreEqual(0, addPeptidesDlg.RunsFailedCount); }); var recalibrateDlg = ShowDialog <MultiButtonMsgDlg>(addPeptidesDlg.OkDialog); OkDialog(recalibrateDlg, recalibrateDlg.Btn1Click); PauseForScreenShot <EditIrtCalcDlg>("Edit iRT Calculator form", 16); RunUI(() => Assert.AreEqual(148, editIrtCalc2.LibraryPeptideCount)); RunUI(editIrtCalc2.OkDialog); WaitForClosedForm(editIrtCalc2); } // Check the RT regression, p. 17 WaitForRegression(); PauseForScreenShot <GraphSummary.RTGraphView>("RT Regression graph metafile", 17); RunUI(() => { VerifyRTRegression(0.15, 15.09, 0.99985); Assert.AreEqual(0, SkylineWindow.RTGraphController.Outliers.Length); SkylineWindow.SaveDocument(); SkylineWindow.HideFindResults(); }); // Recalibrate method to 90-minute gradient, p. 18 RunUI(() => SkylineWindow.OpenFile(GetTestPath("iRT Human+Standard.sky"))); // Not L10N RunDlg <FindNodeDlg>(SkylineWindow.ShowFindNodeDlg, findDlg => { findDlg.FindOptions = new FindOptions().ChangeText("NSAQ"); // Not L10N findDlg.FindNext(); findDlg.Close(); }); RunUI(SkylineWindow.EditDelete); { var peptideSettingsUI = ShowDialog <PeptideSettingsUI>(SkylineWindow.ShowPeptideSettingsUI); RunUI(() => { peptideSettingsUI.SelectedTab = PeptideSettingsUI.TABS.Prediction; peptideSettingsUI.ChooseRegression(irtPredictorName); peptideSettingsUI.IsUseMeasuredRT = true; peptideSettingsUI.TimeWindow = 5; }); PauseForScreenShot <PeptideSettingsUI.PredictionTab>("Peptide Settings - Prediction tab", 18); RunUI(peptideSettingsUI.OkDialog); WaitForClosedForm(peptideSettingsUI); } // Import 90-minute standard mix run, p. 19 const string unsched90MinFileroot = "A_D110913_SiRT_HELA_11_nsMRM_150selected_90min-5-40_TRID2215_01"; // Not L10N ImportNewResults(new[] { unsched90MinFileroot }, -1, false); WaitForGraphs(); // Verify regression graph, p. 19 RunUI(SkylineWindow.ShowRTRegressionGraphScoreToRun); WaitForRegression(); PauseForScreenShot <GraphSummary.RTGraphView>("RT Regression graph metafile", 19); RunUI(() => { VerifyRTRegression(0.40, 24.77, 0.9998); Assert.AreEqual(147, SkylineWindow.RTGraphController.Outliers.Length); }); // Check scheduling graph, p. 20 RunUI(SkylineWindow.ShowRTSchedulingGraph); RunDlg <SchedulingGraphPropertyDlg>(() => SkylineWindow.ShowRTPropertyDlg(SkylineWindow.GraphRetentionTime), propertyDlg => { propertyDlg.TimeWindows = new[] { 2.0, 5.0, 10.0 }; propertyDlg.OkDialog(); }); WaitForGraphs(); PauseForScreenShot <GraphSummary.RTGraphView>("RT Scheduling graph metafile", 20); // Export new 90-minute scheduled transition list, p. 22 const string scheduledBasename = "iRT Human+Standard"; // Not L10N { var exportMethodDlg = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.List)); RunUI(() => { exportMethodDlg.ExportStrategy = ExportStrategy.Buckets; exportMethodDlg.MaxTransitions = 265; exportMethodDlg.MethodType = ExportMethodType.Scheduled; }); PauseForScreenShot <ExportMethodDlg.TransitionListView>("Export Transition List form", 21); RunUI(() => exportMethodDlg.OkDialog(GetTestPath(scheduledBasename + TextUtil.EXT_CSV))); WaitForClosedForm(exportMethodDlg); } Assert.AreEqual(1223 + (TestSmallMolecules ? 4 : 0), File.ReadAllLines(GetTestPath(scheduledBasename + "_0001.csv")).Length); // Not L10N Assert.IsFalse(File.Exists(GetTestPath("iRT Human+Standard_0002.csv"))); // Not L10N // Import scheduled data, p. 23 RunDlg <ManageResultsDlg>(SkylineWindow.ManageResults, manageResultsDlg => { manageResultsDlg.RemoveAllReplicates(); manageResultsDlg.OkDialog(); }); RunUI(() => SkylineWindow.SaveDocument()); const string sched90MinFileroot = "A_D110913_SiRT_HELA_11_sMRM_150selected_90min-5-40_SIMPLE"; // Not L10N ImportNewResults(new[] { sched90MinFileroot }, -1, false); RunUI(SkylineWindow.ShowRTRegressionGraphScoreToRun); WaitForRegression(); PauseForScreenShot <GraphSummary.RTGraphView>("RT Regression graph metafile", 23); // Review regression and outliers, p. 24 RunUI(() => { VerifyRTRegression(0.358, 25.920, 0.91606); Assert.AreEqual(0, SkylineWindow.RTGraphController.Outliers.Length); }); RunDlg <RegressionRTThresholdDlg>(SkylineWindow.ShowRegressionRTThresholdDlg, thresholdDlg => { thresholdDlg.Threshold = 0.998; thresholdDlg.OkDialog(); }); PauseForScreenShot <GraphSummary.RTGraphView>("RT Regression graph metafile", 24); // Verify 2 outliers highlighed and removed, p. 25 WaitForConditionUI(() => SkylineWindow.RTGraphController.Outliers.Length == 2); RunUI(() => { VerifyRTRegression(0.393, 24.85, 0.9989); SkylineWindow.RemoveRTOutliers(); }); WaitForRegression(); PauseForScreenShot <GraphSummary.RTGraphView>("RT Regression graph metafile", 25); // Check outlier removal, p. 25 RunUI(() => { VerifyRTRegression(0.393, 24.85, 0.9989); Assert.AreEqual(0, SkylineWindow.RTGraphController.Outliers.Length); }); // Review a peak and its predicted retention time, p. 26 RunDlg <FindNodeDlg>(SkylineWindow.ShowFindNodeDlg, findDlg => { findDlg.FindOptions = new FindOptions().ChangeText("DATNVG"); // Not L10N findDlg.FindNext(); findDlg.Close(); }); WaitForGraphs(); RestoreViewOnScreen(27); PauseForScreenShot <GraphChromatogram>("Chromatogram graph metafile", 26); // Chromatogram graph RunUI(() => { var graphChrom = SkylineWindow.GetGraphChrom(sched90MinFileroot); Assert.IsTrue(graphChrom.BestPeakTime.HasValue); Assert.AreEqual(47.3, graphChrom.BestPeakTime.Value, 0.05); Assert.IsTrue(graphChrom.PredictedRT.HasValue); Assert.AreEqual(47.6, graphChrom.PredictedRT.Value, 0.05); }); // Import retention times from a spectral library, p. 27 RestoreViewOnScreen(17); // get regression graph back { var editIrtCalc = ShowDialog <EditIrtCalcDlg>(SkylineWindow.ShowEditCalculatorDlg); var addLibrayDlg = ShowDialog <AddIrtSpectralLibrary>(editIrtCalc.AddLibrary); RunUI(() => { addLibrayDlg.Source = SpectralLibrarySource.file; addLibrayDlg.FilePath = GetTestPath(Path.Combine("Yeast+Standard", // Not L10N "Yeast_iRT_C18_0_00001.blib")); // Not L10N }); PauseForScreenShot <AddIrtSpectralLibrary>("Add Spectral Library form", 27); // Verify converted peptide iRT values and OK dialogs, p. 28 var addPeptidesDlg = ShowDialog <AddIrtPeptidesDlg>(addLibrayDlg.OkDialog); RunUI(() => { Assert.AreEqual(558, addPeptidesDlg.PeptidesCount); Assert.AreEqual(1, addPeptidesDlg.RunsConvertedCount); // Libraries now convert through internal alignment to single RT scale Assert.AreEqual(3, addPeptidesDlg.KeepPeptidesCount); }); PauseForScreenShot <AddIrtPeptidesDlg>("Add Peptides form", 28); var recalibrateDlg = ShowDialog <MultiButtonMsgDlg>(addPeptidesDlg.OkDialog); OkDialog(recalibrateDlg, recalibrateDlg.Btn1Click); Assert.IsTrue(WaitForConditionUI(() => editIrtCalc.LibraryPeptideCount == 706)); RunUI(editIrtCalc.OkDialog); WaitForClosedForm(editIrtCalc); } // Inspect MS1 filtered Skyline file created from library DDA data, p. 29 RunUI(() => SkylineWindow.OpenFile(GetTestPath(Path.Combine("Yeast+Standard", // Not L10N "Yeast+Standard (refined) - 2min.sky")))); WaitForDocumentLoaded(); RunUI(() => SkylineWindow.SelectedPath = SkylineWindow.DocumentUI.GetPathTo((int)SrmDocument.Level.Molecules, 0)); WaitForRegression(); // Verify numbers that show up in the screenshot RunUI(() => { // If the cache gets rebuilt, then because the chromatograms // were minimized, the peak picking is not exactly the same // using the minimized chromatograms. VerifyRTRegression(0.3, 19.37, 0.9998); var graphChrom = SkylineWindow.GetGraphChrom("Velos_2011_1110_RJ_16"); // Not L10N Assert.AreEqual(37.6, graphChrom.RetentionMsMs[0], 0.05); Assert.IsTrue(graphChrom.BestPeakTime.HasValue); Assert.AreEqual(37.6, graphChrom.BestPeakTime.Value, 0.05); graphChrom = SkylineWindow.GetGraphChrom("Velos_2011_1110_RJ_14"); // Not L10N Assert.AreEqual(37.3, graphChrom.RetentionMsMs[0], 0.05); Assert.AreEqual(37.6, graphChrom.RetentionMsMs[1], 0.05); Assert.IsTrue(graphChrom.BestPeakTime.HasValue); Assert.AreEqual(37.4, graphChrom.BestPeakTime.Value, 0.05); }); PauseForScreenShot("Main window", 29); // Add results and verify add dialog counts, p. 29-30 { var editIrtCalc = ShowDialog <EditIrtCalcDlg>(SkylineWindow.ShowEditCalculatorDlg); var addPeptidesDlg = ShowDialog <AddIrtPeptidesDlg>(editIrtCalc.AddResults); RunUI(() => { Assert.AreEqual(0, addPeptidesDlg.PeptidesCount); Assert.AreEqual(2, addPeptidesDlg.RunsConvertedCount); Assert.AreEqual(558, addPeptidesDlg.OverwritePeptidesCount); Assert.AreEqual(3, addPeptidesDlg.ExistingPeptidesCount); }); PauseForScreenShot <AddIrtPeptidesDlg>("Add Peptides form", 30); var recalibrateDlg = ShowDialog <MultiButtonMsgDlg>(addPeptidesDlg.OkDialog); OkDialog(recalibrateDlg, recalibrateDlg.Btn1Click); RunUI(editIrtCalc.OkDialog); WaitForClosedForm(editIrtCalc); } RunUI(() => SkylineWindow.SaveDocument()); RunUI(SkylineWindow.NewDocument); }
protected override void DoTest() { TestSmallMolecules = false; // The presence of the extra test node without any results is incompatible with what's being tested here. // Clean-up before running the test RunUI(() => SkylineWindow.ModifyDocument("Set default settings", d => d.ChangeSettings(SrmSettingsList.GetDefault()))); SrmDocument doc = SkylineWindow.Document; const string documentBaseName = "Ms1FilterTutorial"; string documentFile = GetTestPath(documentBaseName + SrmDocument.EXT); RunUI(() => SkylineWindow.SaveDocument(documentFile)); // show the empty Transition Setting dialog var transitionSettingsDlg = ShowDialog <TransitionSettingsUI>(SkylineWindow.ShowTransitionSettingsUI); RunUI(() => transitionSettingsDlg.SelectedTab = TransitionSettingsUI.TABS.FullScan); PauseForScreenShot <TransitionSettingsUI.FullScanTab>("Transition Settings - Full-Scan tab nothing set", 2); OkDialog(transitionSettingsDlg, transitionSettingsDlg.OkDialog); // Launch the wizard var importPeptideSearchDlg = ShowDialog <ImportPeptideSearchDlg>(SkylineWindow.ShowImportPeptideSearchDlg); // We're on the "Build Spectral Library" page of the wizard. // Add the test xml file to the search files list and try to // build the document library. string[] searchFiles = { GetTestPath("100803_0001_MCF7_TiB_L.group.xml"), // Not L10N GetTestPath("100803_0005b_MCF7_TiTip3.group.xml") // Not L10N }; PauseForScreenShot <ImportPeptideSearchDlg.SpectraPage>("Import Peptide Search - Build Spectral Library empty page", 3); RunUI(() => { Assert.IsTrue(importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.spectra_page); importPeptideSearchDlg.BuildPepSearchLibControl.AddSearchFiles(searchFiles); }); PauseForScreenShot <ImportPeptideSearchDlg.SpectraPage>("Import Peptide Search - Build Spectral Library populated page", 4); var ambiguousDlg = ShowDialog <MessageDlg>(importPeptideSearchDlg.ClickNextButtonNoCheck); OkDialog(ambiguousDlg, ambiguousDlg.OkDialog); // Verify document library was built string docLibPath = BiblioSpecLiteSpec.GetLibraryFileName(documentFile); string redundantDocLibPath = BiblioSpecLiteSpec.GetRedundantName(docLibPath); Assert.IsTrue(File.Exists(docLibPath) && File.Exists(redundantDocLibPath)); var librarySettings = SkylineWindow.Document.Settings.PeptideSettings.Libraries; Assert.IsTrue(librarySettings.HasDocumentLibrary); // We're on the "Extract Chromatograms" page of the wizard. // All the test results files are in the same directory as the // document file, so all the files should be found, and we should // just be able to move to the next page. WaitForConditionUI(() => importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.chromatograms_page); PauseForScreenShot <ImportPeptideSearchDlg.ChromatogramsPage>("Import Peptide Search - Extract Chromatograms page", 5); var importResultsNameDlg = ShowDialog <ImportResultsNameDlg>(() => importPeptideSearchDlg.ClickNextButton()); PauseForScreenShot <ImportResultsNameDlg>("Import Results - Common prefix form", 6); OkDialog(importResultsNameDlg, importResultsNameDlg.YesDialog); // Wait for the "Add Modifications" page of the wizard. WaitForConditionUI(() => importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.match_modifications_page); List <string> modsToCheck = new List <string> { "Phospho (ST)", "Phospho (Y)", "Oxidation (M)" }; // Not L10N RunUI(() => { importPeptideSearchDlg.MatchModificationsControl.CheckedModifications = modsToCheck; }); PauseForScreenShot <ImportPeptideSearchDlg.MatchModsPage>("Import Peptide Search - Add Modifications page", 7); RunUI(() => Assert.IsTrue(importPeptideSearchDlg.ClickNextButton())); // We're on the "Configure MS1 Full-Scan Settings" page of the wizard. RunUI(() => { Assert.IsTrue(importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.full_scan_settings_page); importPeptideSearchDlg.FullScanSettingsControl.PrecursorCharges = new[] { 2, 3, 4 }; importPeptideSearchDlg.FullScanSettingsControl.PrecursorMassAnalyzer = FullScanMassAnalyzerType.tof; importPeptideSearchDlg.FullScanSettingsControl.PrecursorRes = 10 * 1000; Assert.AreEqual(importPeptideSearchDlg.FullScanSettingsControl.PrecursorIsotopesCurrent, FullScanPrecursorIsotopes.Count); Assert.AreEqual(FullScanMassAnalyzerType.tof, importPeptideSearchDlg.FullScanSettingsControl.PrecursorMassAnalyzer); Assert.AreEqual(10 * 1000, importPeptideSearchDlg.FullScanSettingsControl.PrecursorRes); Assert.AreEqual(3, importPeptideSearchDlg.FullScanSettingsControl.Peaks); Assert.AreEqual(RetentionTimeFilterType.ms2_ids, importPeptideSearchDlg.FullScanSettingsControl.RetentionTimeFilterType); Assert.AreEqual(5, importPeptideSearchDlg.FullScanSettingsControl.TimeAroundMs2Ids); }); PauseForScreenShot <ImportPeptideSearchDlg.Ms1FullScanPage>("Import Peptide Search - Configure MS1 Full-Scan Settings page", 8); RunUI(() => Assert.IsTrue(importPeptideSearchDlg.ClickNextButton())); // Last page of wizard - Import Fasta. string fastaPath = GetTestPath("12_proteins.062011.fasta"); RunUI(() => { Assert.IsTrue(importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.import_fasta_page); Assert.AreEqual("Trypsin [KR | P]", importPeptideSearchDlg.ImportFastaControl.Enzyme.GetKey()); importPeptideSearchDlg.ImportFastaControl.MaxMissedCleavages = 2; importPeptideSearchDlg.ImportFastaControl.SetFastaContent(fastaPath); Assert.IsFalse(importPeptideSearchDlg.ImportFastaControl.DecoyGenerationEnabled); }); PauseForScreenShot <ImportPeptideSearchDlg.FastaPage>("Import Peptide Search - Import FASTA page", 10); var peptidesPerProteinDlg = ShowDialog <PeptidesPerProteinDlg>(() => importPeptideSearchDlg.ClickNextButton()); WaitForCondition(() => peptidesPerProteinDlg.DocumentFinalCalculated); RunUI(() => { int proteinCount, peptideCount, precursorCount, transitionCount; peptidesPerProteinDlg.NewTargetsAll(out proteinCount, out peptideCount, out precursorCount, out transitionCount); Assert.AreEqual(11, proteinCount); Assert.AreEqual(51, peptideCount); Assert.AreEqual(52, precursorCount); Assert.AreEqual(156, transitionCount); peptidesPerProteinDlg.NewTargetsFinal(out proteinCount, out peptideCount, out precursorCount, out transitionCount); Assert.AreEqual(11, proteinCount); Assert.AreEqual(51, peptideCount); Assert.AreEqual(52, precursorCount); Assert.AreEqual(156, transitionCount); }); OkDialog(peptidesPerProteinDlg, peptidesPerProteinDlg.OkDialog); PauseForScreenShot <AllChromatogramsGraph>("Loading chromatograms window", 11); WaitForDocumentChangeLoaded(doc, 8 * 60 * 1000); // 10 minutes var libraryExplorer = ShowDialog <ViewLibraryDlg>(() => SkylineWindow.OpenLibraryExplorer(documentBaseName)); var matchedPepModsDlg = WaitForOpenForm <AddModificationsDlg>(); PauseForScreenShot <MultiButtonMsgDlg>("Add mods alert", 12); RunUI(() => { Assert.AreEqual(13, matchedPepModsDlg.NumMatched); Assert.AreEqual(0, matchedPepModsDlg.NumUnmatched); matchedPepModsDlg.CancelDialog(); }); RunUI(() => { libraryExplorer.GraphSettings.ShowBIons = true; libraryExplorer.GraphSettings.ShowYIons = true; libraryExplorer.GraphSettings.ShowCharge1 = true; libraryExplorer.GraphSettings.ShowCharge2 = true; libraryExplorer.GraphSettings.ShowPrecursorIon = true; }); PauseForScreenShot <ViewLibraryDlg>("Spectral Library Explorer", 13); RunUI(() => { const string sourceFirst = "100803_0005b_MCF7_TiTip3.wiff"; const double timeFirst = 35.2128; Assert.AreEqual(sourceFirst, libraryExplorer.SourceFile); Assert.AreEqual(timeFirst, libraryExplorer.RetentionTime, 0.0001); libraryExplorer.SelectedIndex++; Assert.AreNotEqual(sourceFirst, libraryExplorer.SourceFile); Assert.AreNotEqual(timeFirst, libraryExplorer.RetentionTime, 0.0001); }); OkDialog(libraryExplorer, libraryExplorer.CancelDialog); const int TIB_L = 0; // index for Tib_L const int TIP3 = 1; // index for Tip3 AssertEx.IsDocumentState(SkylineWindow.Document, null, 11, 51, 52, 156); AssertResult.IsDocumentResultsState(SkylineWindow.Document, GetFileNameWithoutExtension(searchFiles[TIB_L]), 51, 52, 0, 156, 0); AssertResult.IsDocumentResultsState(SkylineWindow.Document, GetFileNameWithoutExtension(searchFiles[TIP3]), 51, 52, 0, 156, 0); string Tib_LFilename = searchFiles[TIB_L].Replace(".group.xml", PreferedExtAbWiff); string Tip3Filename = searchFiles[TIP3].Replace(".group.xml", PreferedExtAbWiff); // Select the first transition group. RunUI(() => { SkylineWindow.SequenceTree.SelectedPath = SkylineWindow.Document.GetPathTo((int)SrmDocument.Level.Molecules, 0); SkylineWindow.GraphSpectrumSettings.ShowAIons = true; SkylineWindow.GraphSpectrumSettings.ShowBIons = true; SkylineWindow.GraphSpectrumSettings.ShowYIons = true; SkylineWindow.GraphSpectrumSettings.ShowPrecursorIon = true; SkylineWindow.ExpandPrecursors(); SkylineWindow.ChangeTextSize(TreeViewMS.LRG_TEXT_FACTOR); }); RunDlg <SpectrumChartPropertyDlg>(SkylineWindow.ShowSpectrumProperties, dlg => { dlg.FontSize = GraphFontSize.NORMAL; dlg.OkDialog(); }); RunDlg <ChromChartPropertyDlg>(SkylineWindow.ShowChromatogramProperties, dlg => { dlg.FontSize = GraphFontSize.NORMAL; dlg.OkDialog(); }); RunUI(() => { // Make window screenshot size if (IsPauseForScreenShots && SkylineWindow.WindowState != FormWindowState.Maximized) { SkylineWindow.Width = 1160; SkylineWindow.Height = 792; } }); RestoreViewOnScreen(13); PauseForScreenShot("Main window with imported data", 14); // RunUIWithDocumentWait(() => // { // SkylineWindow.ToggleIntegrateAll(); // TODO: No longer necessary. Change in tutorial // }); RunUI(() => { SkylineWindow.ShowGraphPeakArea(true); SkylineWindow.ShowPeakAreaReplicateComparison(); SkylineWindow.NormalizeAreaGraphTo(AreaNormalizeToView.none); Settings.Default.ShowDotProductPeakArea = true; Settings.Default.ShowLibraryPeakArea = true; }); PauseForScreenShot <GraphSummary.AreaGraphView>("Peak Areas view (show context menu)", 16); RestoreViewOnScreen(15); RunUI(() => { SkylineWindow.AutoZoomBestPeak(); SkylineWindow.ArrangeGraphsTiled(); SkylineWindow.ShowChromatogramLegends(false); }); PauseForScreenShot("Main window layout", 17); int atest = 0; CheckAnnotations(TIB_L, 0, atest++); int pepIndex = 3; RunUI(() => SkylineWindow.CollapsePeptides()); RunUI(() => SkylineWindow.ShowAlignedPeptideIDTimes(true)); ChangePeakBounds(TIB_L, pepIndex, 38.79, 39.385); PauseForScreenShot("Chromatogram graphs clipped from main window", 19); CheckAnnotations(TIB_L, pepIndex, atest++); var alignmentForm = ShowDialog <AlignmentForm>(() => SkylineWindow.ShowRetentionTimeAlignmentForm()); RunUI(() => { alignmentForm.Width = 711; alignmentForm.Height = 561; alignmentForm.ComboAlignAgainst.SelectedIndex = 0; // to match what's in the tutorial doc }); PauseForScreenShot <AlignmentForm>("Retention time alignment form", 20); OkDialog(alignmentForm, alignmentForm.Close); PauseForScreenShot("Status bar clipped from main window - 4/51 pep 4/52 prec 10/156 tran", 21); pepIndex = JumpToPeptide("SSKASLGSLEGEAEAEASSPK"); RunUI(() => SkylineWindow.ShowChromatogramLegends(true)); Assert.IsTrue(8 == pepIndex); PauseForScreenShot("Chromatogram graph metafiles for 9th peptide", 21); CheckAnnotations(TIB_L, pepIndex, atest++); ZoomSingle(TIP3, 32.6, 41.4); // simulate the wheel scroll described in tutorial PauseForScreenShot("Chromatogram graph metafile showing all peaks for 1_MCF_TiB_L", 22); CheckAnnotations(TIB_L, pepIndex, atest++); // current TIB_L peak should have idotp .87 and ppm -6.9 Assert.AreEqual(0.87, GetTransitionGroupChromInfo(TIB_L, pepIndex).IsotopeDotProduct ?? -1, .005); Assert.AreEqual(-10.8, GetTransitionChromInfo(TIB_L, pepIndex, 0).MassError ?? -1, .05); ChangePeakBounds(TIB_L, pepIndex, 36.5, 38.0); // now current TIB_L peak should have idotp .9 and ppm -6.5 Assert.AreEqual(0.9, GetTransitionGroupChromInfo(TIB_L, pepIndex).IsotopeDotProduct ?? -1, .005); Assert.AreEqual(-9.4, GetTransitionChromInfo(TIB_L, pepIndex, 0).MassError ?? -1, .05); CheckAnnotations(TIB_L, pepIndex, atest++); var undoIndex = SkylineWindow.Document.RevisionIndex; // preserve for simulating ctrl-z PickPeakBoth(pepIndex, 40.471035, 40.8134); // select peak for both chromatograms at these respective retention times PauseForScreenShot <GraphSummary.AreaGraphView>("Peak Areas graph metafile", 23); int[] m1Thru4 = { 1, 2, 3, 4, 5 }; PickTransitions(pepIndex, m1Thru4, "Transition pick list filtered", 24, "Transition pick list unfiltered", 24); // turn on chromatograms PickPeakBoth(pepIndex, 36.992836, 37.3896027); // select peak for both chromatograms at these respective retention times ZoomSingle(TIP3, 32.4, 39.6); // set the view for screenshot PauseForScreenShot("Chromatogram graph metafile comparing 33 and 37 minute peaks", 25); CheckAnnotations(TIB_L, pepIndex, atest++); CheckAnnotations(TIP3, pepIndex, atest++); RevertDoc(undoIndex); // undo changes pepIndex = JumpToPeptide("ASLGSLEGEAEAEASSPKGK"); // Not L10N Assert.IsTrue(10 == pepIndex); PauseForScreenShot("Chhromatogram graph meta files for peptide ASLGSLEGEAEAEASSPKGK", 26); CheckAnnotations(TIB_L, pepIndex, atest++); CheckAnnotations(TIP3, pepIndex, atest++); PickTransitions(pepIndex, m1Thru4); // turn on M+3 and M+4 ChangePeakBounds(TIP3, pepIndex, 37.35, 38.08); ZoomSingle(TIP3, 36.65, 39.11); // simulate the wheel scroll described in tutorial PauseForScreenShot("upper - Chromatogram graph metafile for peptide ASLGSLEGEAEAEASSPKGK with adjusted integration", 27); CheckAnnotations(TIP3, pepIndex, atest++); RevertDoc(undoIndex); // undo changes pepIndex = JumpToPeptide("AEGEWEDQEALDYFSDKESGK"); // Not L10N PauseForScreenShot("lower - Chromatogram graph metafiles for peptide AEGEWEDQEALDYFSDKESGK", 27); CheckAnnotations(TIB_L, pepIndex, atest++); CheckAnnotations(TIP3, pepIndex, atest++); int[] m1Thru5 = { 1, 2, 3, 4, 5, 6 }; PickTransitions(pepIndex, m1Thru5); // turn on M+3 M+4 and M+5 PauseForScreenShot("Chromatogram graph metafiles with M+3, M+4 and M+5 added", 28); CheckAnnotations(TIB_L, pepIndex, atest++); CheckAnnotations(TIP3, pepIndex, atest++); JumpToPeptide("ALVEFESNPEETREPGSPPSVQR"); // Not L10N PauseForScreenShot("Chromatogram graph metafiles for peptide ALVEFESNPEETREPGSPPSVQR", 29); pepIndex = JumpToPeptide("YGPADVEDTTGSGATDSKDDDDIDLFGSDDEEESEEAKR"); // Not L10N PauseForScreenShot("upper - Peak Areas graph metafile for peptide YGPADVEDTTGSGATDSKDDDDIDLFGSDDEEESEEAKR", 30); int[] m1Thru7 = { 1, 2, 3, 4, 5, 6, 7, 8 }; PickTransitions(pepIndex, m1Thru7); // enable [M+3] [M+4] [M+5] [M+6] [M+7] PauseForScreenShot("lower - Peak Areas graph metafile with M+3 through M+7 added", 30); CheckAnnotations(TIB_L, pepIndex, atest++); CheckAnnotations(TIP3, pepIndex, atest++); // page 32 zooming setup RunUI(() => { SkylineWindow.SynchronizeZooming(true); SkylineWindow.LockYChrom(false); SkylineWindow.AlignToFile = SkylineWindow.GraphChromatograms.ToArray()[TIP3].GetChromFileInfoId(); // align to Tip3 }); ZoomBoth(36.5, 39.5, 1600); // simulate the wheel scroll described in tutorial RunUI(() => SkylineWindow.ShowChromatogramLegends(false)); PauseForScreenShot("Chromatogram graphs clipped from main window with synchronized zooming", 32); RestoreViewOnScreen(33); // float the Library Match window TODO this causes a crash at next call to ChangePeakBounds, in pwiz.Skyline.Controls.Graphs.GraphChromatogram.ChromGroupInfos.get() Line 492 , why? RunUI(() => SkylineWindow.GraphSpectrum.SelectSpectrum(new SpectrumIdentifier(MsDataFileUri.Parse(Tip3Filename), 37.6076f))); // set the Library Match view PauseForScreenShot <GraphSpectrum>("Library Match graph metafile - 5b_MCF7_TiTip3 (37.61 Min)", 33); RunUI(() => SkylineWindow.GraphSpectrum.SelectSpectrum(new SpectrumIdentifier(MsDataFileUri.Parse(Tib_LFilename), 37.0335f))); // set the Library Match view PauseForScreenShot <GraphSpectrum>("Library Match graph metafile - 1_MCF_TiB_L (37.03 min)", 33); RestoreViewOnScreen(34); // back to normal view pepIndex = JumpToPeptide("GVVDSEDLPLNISR"); // Not L10N RunUI(() => SkylineWindow.ShowChromatogramLegends(true)); PauseForScreenShot("upper - Chromatogram graph metafiles for peptide GVVDSEDLPLNISR", 34); ZoomBoth(35.05, 36.9, 480); PauseForScreenShot("lower - Chromatogram graph metafile - effect of zoom ", 34); ChangePeakBounds(TIP3, pepIndex, 35.7, 36.5); // adjust integration per tutorial CheckAnnotations(TIP3, pepIndex, atest++); // check the new idotp values /* pepIndex = */ JumpToPeptide("DQVANSAFVER"); // Not L10N PauseForScreenShot("Chromatogram graph metafiles for peptide DQVANSAFVER", 35); // int[] m1 = {2}; // PickTransitions(pepIndex, m1); // enable [M+1] only // // Measured times in TIB_L are different from displayed times, because of alignment // ChangePeakBounds(TIB_L, pepIndex, 23.99, 25.29); // ChangePeakBounds(TIP3, pepIndex, 23.81, 25.21); // // First transition selected for screenshot // RunUI(() => // { // var pathPep = SkylineWindow.SelectedPath; // var nodePep = ((PeptideTreeNode)SkylineWindow.SelectedNode).DocNode; // var nodeGroup = nodePep.TransitionGroups.First(); // var nodeTran = nodeGroup.Transitions.First(); // SkylineWindow.SelectedPath = new IdentityPath( // new IdentityPath(pathPep, nodeGroup.TransitionGroup), nodeTran.Transition); // }); // PauseForScreenShot("page 36 - M+1 only, with adjusted integration"); // CheckAnnotations(TIB_L, pepIndex, atest++); // CheckAnnotations(TIP3, pepIndex, EXPECTED_ANNOTATIONS[atest]); var docAfter = WaitForProteinMetadataBackgroundLoaderCompletedUI(); // Minimizing a chromatogram cache file. RunUI(SkylineWindow.CollapsePeptides); for (int i = 0; i < 5; i++) // just do the first 5 { int iPeptide = i; var path = docAfter.GetPathTo((int)SrmDocument.Level.Molecules, iPeptide); RunUI(() => { SkylineWindow.SelectedPath = path; }); WaitForGraphs(); } // Eliminate extraneous chromatogram data. doc = WaitForProteinMetadataBackgroundLoaderCompletedUI(); var minimizedFile = GetTestPath("Ms1FilteringTutorial-2min.sky"); // Not L10N var cacheFile = Path.ChangeExtension(minimizedFile, ChromatogramCache.EXT); { // TODO: Figure out why the minimize fails to unlock the .skyd file, if not minimized to current file RunUI(() => SkylineWindow.SaveDocument(minimizedFile)); var manageResultsDlg = ShowDialog <ManageResultsDlg>(SkylineWindow.ManageResults); var minimizeResultsDlg = ShowDialog <MinimizeResultsDlg>(manageResultsDlg.MinimizeResults); RunUI(() => { minimizeResultsDlg.LimitNoiseTime = true; minimizeResultsDlg.NoiseTimeRange = 2; // Not L10N }); PauseForScreenShot <MinimizeResultsDlg>("Minimize Results form (percentages vary slightly)", 36); // old p. 23 OkDialog(minimizeResultsDlg, () => minimizeResultsDlg.MinimizeToFile(minimizedFile)); WaitForCondition(() => File.Exists(cacheFile)); WaitForClosedForm(manageResultsDlg); } WaitForDocumentChange(doc); // Inclusion list method export for MS1 filtering doc = SkylineWindow.Document; RunDlg <PeptideSettingsUI>(() => SkylineWindow.ShowPeptideSettingsUI(PeptideSettingsUI.TABS.Prediction), dlg => { dlg.IsUseMeasuredRT = true; dlg.TimeWindow = 10; dlg.OkDialog(); }); WaitForDocumentChangeLoaded(doc); // Now deviating from the tutorial script for a moment to make sure we can choose a Scheduled export method. RunDlg <RefineDlg>(SkylineWindow.ShowRefineDlg, dlg => { dlg.MinPeptides = 1; // Not L10N const double minPeakFoundRatio = 0.1; dlg.MinPeakFoundRatio = minPeakFoundRatio; dlg.OkDialog(); }); // Ready to export, although we will just cancel out of the dialog. var exportMethodDlg = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.Method)); RunUI(() => { exportMethodDlg.InstrumentType = ExportInstrumentType.ABI_TOF; // Not L10N exportMethodDlg.MethodType = ExportMethodType.Scheduled; exportMethodDlg.CancelButton.PerformClick(); }); WaitForClosedForm(exportMethodDlg); RunUI(() => SkylineWindow.SaveDocument()); RunUI(SkylineWindow.NewDocument); }
protected override void DoTest() { RunUI(() => SkylineWindow.SetUIMode(SrmDocument.DOCUMENT_TYPE.small_molecules)); // Inserting a Transition List, p. 5 { var doc = SkylineWindow.Document; SetCsvFileClipboardText(GetTestPath("Energy_TransitionList.csv")); RunUI(() => { SkylineWindow.Paste(); AdjustSequenceTreePanelWidth(); }); PauseForScreenShot <SkylineWindow>("Main window after paste from csv", 5); var docTargets = WaitForDocumentChange(doc); AssertEx.IsDocumentState(docTargets, null, 3, 18, 36, 36); Assert.IsFalse(docTargets.MoleculeTransitions.Any(t => t.Transition.IsPrecursor())); { var transitionSettingsUI = ShowDialog <TransitionSettingsUI>(SkylineWindow.ShowTransitionSettingsUI); RunUI(() => { // Predicition Settings transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.Prediction; transitionSettingsUI.RegressionCEName = "Waters Xevo"; // Collision Energy }); PauseForScreenShot <TransitionSettingsUI.PredictionTab>("Transition Settings - Prediction tab", 6); RunUI(() => { // Filter Settings transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.Filter; transitionSettingsUI.SmallMoleculePrecursorAdducts = Adduct.M_MINUS.AdductFormula; transitionSettingsUI.SmallMoleculeFragmentAdducts = Adduct.M_MINUS.AdductFormula; transitionSettingsUI.SmallMoleculeFragmentTypes = TransitionFilter.SMALL_MOLECULE_FRAGMENT_CHAR; }); PauseForScreenShot <TransitionSettingsUI.PredictionTab>("Transition Settings -Filter tab", 7); OkDialog(transitionSettingsUI, transitionSettingsUI.OkDialog); WaitForDocumentChange(docTargets); } RunUI(() => SkylineWindow.SaveDocument(GetTestPath("EnergyMet.sky"))); // Export method - 2 minutes { var exportMethodDlg2 = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.Method)); RunUI(() => { exportMethodDlg2.InstrumentType = ExportInstrumentType.WATERS_XEVO_TQ; exportMethodDlg2.MethodType = ExportMethodType.Standard; exportMethodDlg2.RunLength = 2; exportMethodDlg2.SetTemplateFile("VerifyETemplate.exp"); }); PauseForScreenShot <ExportMethodDlg>("Exporting 2 minute method", 9); OkDialog(exportMethodDlg2, exportMethodDlg2.CancelDialog); } // Export transition list { var exportTransitionList = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.List)); RunUI(() => { exportTransitionList.InstrumentType = ExportInstrumentType.WATERS_XEVO_TQ; exportTransitionList.MethodType = ExportMethodType.Standard; exportTransitionList.RunLength = 2; }); PauseForScreenShot <ExportMethodDlg>("Exporting transition list", 10); OkDialog(exportTransitionList, exportTransitionList.CancelDialog); } using (new WaitDocumentChange(1, true)) { var importResultsDlg1 = ShowDialog <ImportResultsDlg>(SkylineWindow.ImportResults); var openDataSourceDialog1 = ShowDialog <OpenDataSourceDialog>(() => importResultsDlg1.NamedPathSets = importResultsDlg1.GetDataSourcePathsFile(null)); RunUI(() => { openDataSourceDialog1.CurrentDirectory = new MsDataFilePath(GetTestPath("Unscheduled")); openDataSourceDialog1.SelectAllFileType(ExtWatersRaw); }); PauseForScreenShot <OpenDataSourceDialog>("Import Results Files form", 11); OkDialog(openDataSourceDialog1, openDataSourceDialog1.Open); var importResultsNameDlg = ShowDialog <ImportResultsNameDlg>(importResultsDlg1.OkDialog); PauseForScreenShot <ImportResultsNameDlg>("Import Results common name form", 12); OkDialog(importResultsNameDlg, importResultsNameDlg.OkDialog); OkDialog(importResultsDlg1, importResultsDlg1.OkDialog); } SelectNode(SrmDocument.Level.Molecules, 0); SelectNode(SrmDocument.Level.MoleculeGroups, 0); PauseForScreenShot <SkylineWindow>("Skyline window multi-target graph", 13); // Renaming replicates { var manageResultsDlg = ShowDialog <ManageResultsDlg>(SkylineWindow.ManageResults); string[] repNames = new[] { "2 min", "5 min" }; RunUI(() => manageResultsDlg.Left = SkylineWindow.Right + 50); for (var i = 0; i < 2; i++) { doc = SkylineWindow.Document; var chromatograms = doc.Settings.MeasuredResults.Chromatograms; var chrom = chromatograms[i]; RunUI(() => { manageResultsDlg.SelectedChromatograms = new[] { chrom }; }); var renameDlg = ShowDialog <RenameResultDlg>(manageResultsDlg.RenameResult); RunUI(() => renameDlg.ReplicateName = repNames[i]); if (i == 0) { PauseForScreenShot <SkylineWindow>("Manage Results and Rename Replicate (PrtScn and select in Paint)", 14); } OkDialog(renameDlg, renameDlg.OkDialog); } OkDialog(manageResultsDlg, manageResultsDlg.OkDialog); } PauseForScreenShot <SkylineWindow>("Skyline window (renamed)", 15); var docResults = SkylineWindow.Document; var msg = ""; foreach (var chromatogramSet in docResults.Settings.MeasuredResults.Chromatograms) { try { AssertResult.IsDocumentResultsState(docResults, chromatogramSet.Name, 18, 18, 18, 18, 18); } catch (Exception x) { msg += TextUtil.LineSeparate(x.Message); } } if (!string.IsNullOrEmpty(msg)) { Assert.IsTrue(string.IsNullOrEmpty(msg), msg); } RunUI(() => { SkylineWindow.ShowPeakAreaReplicateComparison(); SkylineWindow.ShowRTReplicateGraph(); SkylineWindow.ArrangeGraphsTiled(); }); RestoreViewOnScreen(16); SelectNode(SrmDocument.Level.MoleculeGroups, 0); WaitForGraphs(); RunUI(() => { SkylineWindow.Size = new Size(1054, 587); AdjustSequenceTreePanelWidth(true); }); PauseForScreenShot <SkylineWindow>("Skyline window multi-replicate layout", 16); // Set zoom to show better peak separation in 5 minute run for (var i = 0; i < 2; i++) { WaitForGraphs(); RunUI(() => SkylineWindow.GraphChromatograms.ToArray()[i].ZoomTo(.8, 1.8, 1.39e+8)); WaitForGraphs(); } PauseForScreenShot <SkylineWindow>("Skyline window showing relative peak separation", 17); // Set time window { var peptideSettingsDlg = ShowDialog <PeptideSettingsUI>(SkylineWindow.ShowPeptideSettingsUI); RunUI(() => { // ReSharper disable once RedundantCast peptideSettingsDlg.SelectedTab = (PeptideSettingsUI.TABS) 0; //regular enum does not work because of the hidden tabs in the Small Molecule mode. peptideSettingsDlg.TimeWindow = 1; }); PauseForScreenShot <PeptideSettingsUI>("Setting scheduled transition list time window", 18); OkDialog(peptideSettingsDlg, peptideSettingsDlg.OkDialog); } // Export transition list { var exportTransitionList = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.List)); RunUI(() => { exportTransitionList.InstrumentType = ExportInstrumentType.WATERS_XEVO_TQ; exportTransitionList.MethodType = ExportMethodType.Scheduled; exportTransitionList.OptimizeType = ExportOptimize.NONE; }); PauseForScreenShot <ExportMethodDlg>("Exporting scheduled transition list", 19); var schedulingOptionsDlg = ShowDialog <SchedulingOptionsDlg>(() => exportTransitionList.OkDialog(GetTestPath("EnergyMet_5minutes_scheduled.csv"))); RunUI(() => { schedulingOptionsDlg.Algorithm = ExportSchedulingAlgorithm.Single; schedulingOptionsDlg.ReplicateNum = 1; // 5 min }); PauseForScreenShot <SchedulingOptionsDlg>("Exporting scheduled transition list - choose replicate", 19); OkDialog(schedulingOptionsDlg, schedulingOptionsDlg.OkDialog); WaitForClosedForm(exportTransitionList); } using (new WaitDocumentChange(1, true)) { var importResultsDlg1 = ShowDialog <ImportResultsDlg>(SkylineWindow.ImportResults); var openDataSourceDialog1 = ShowDialog <OpenDataSourceDialog>(() => importResultsDlg1.NamedPathSets = importResultsDlg1.GetDataSourcePathsFile(null)); RunUI(() => { openDataSourceDialog1.CurrentDirectory = new MsDataFilePath(GetTestPath("Scheduled")); openDataSourceDialog1.SelectAllFileType(ExtWatersRaw); }); OkDialog(openDataSourceDialog1, openDataSourceDialog1.Open); var importResultsNameDlg = ShowDialog <ImportResultsNameDlg>(importResultsDlg1.OkDialog); RunUI(() => importResultsNameDlg.IsRemove = false); PauseForScreenShot <ImportResultsNameDlg>("Import Results common name form, not changing names", 20); OkDialog(importResultsNameDlg, importResultsNameDlg.OkDialog); } // Remove 2 minute gradient // Renaming replicates string[] newNames = { "1:1_1", "1:1_2", "2:1_2", "1:2_2" }; { var manageResultsDlg = ShowDialog <ManageResultsDlg>(SkylineWindow.ManageResults); SelectReplicate(manageResultsDlg, 0); PauseForScreenShot <SkylineWindow>("Manage Results removing 2 min", 21); RunUI(manageResultsDlg.RemoveReplicates); for (var i = 0; i < newNames.Length; i++) { SelectReplicate(manageResultsDlg, i + 1); RunDlg <RenameResultDlg>(manageResultsDlg.RenameResult, renameDlg => { renameDlg.ReplicateName = newNames[i]; renameDlg.OkDialog(); }); } PauseForScreenShot <SkylineWindow>("Manage Results replicate renamed", 22); OkDialog(manageResultsDlg, manageResultsDlg.OkDialog); } SelectNode(SrmDocument.Level.Molecules, 0); RunUI(() => { var molNode = SkylineWindow.SelectedNode; molNode.Expand(); Assert.AreEqual(2, molNode.Nodes.Count); molNode.Nodes[0].Expand(); molNode.Nodes[1].Expand(); SkylineWindow.ArrangeGraphsTabbed(); }); PauseForScreenShot <SkylineWindow>("Skyline window with calibration data", 23); // Linearity var documentGrid = ShowDialog <DocumentGridForm>(() => SkylineWindow.ShowDocumentGrid(true)); RunUI(() => documentGrid.ChooseView(Resources.SkylineViewContext_GetDocumentGridRowSources_Replicates)); double[] concentrations = { 1, 1, 2, 0.5 }; var namedConcentrations = newNames.Select((n, i) => new Tuple <string, double?>(n, concentrations[i])); SetDocumentGridSampleTypesAndConcentrations(namedConcentrations.ToDictionary(t => t.Item1, t => new Tuple <SampleType, double?>(SampleType.STANDARD, t.Item2))); RunUI(() => { var gridFloatingWindow = documentGrid.Parent.Parent; gridFloatingWindow.Size = new Size(370, 230); gridFloatingWindow.Top = SkylineWindow.Top; gridFloatingWindow.Left = SkylineWindow.Right + 20; }); PauseForScreenShot <DocumentGridForm>("Document Grid - sample types and concentrations ", 23); RunUI(() => SkylineWindow.ShowDocumentGrid(false)); using (new WaitDocumentChange(1, true)) { // Quant settings var peptideSettingsUI = ShowDialog <PeptideSettingsUI>(SkylineWindow.ShowPeptideSettingsUI); RunUI(() => { // ReSharper disable once RedundantCast peptideSettingsUI.SelectedTab = (PeptideSettingsUI.TABS) 3; peptideSettingsUI.QuantRegressionFit = RegressionFit.LINEAR; peptideSettingsUI.QuantNormalizationMethod = new NormalizationMethod.RatioToLabel(IsotopeLabelType.heavy); peptideSettingsUI.QuantUnits = "ratio to heavy"; }); PauseForScreenShot <PeptideSettingsUI.QuantificationTab>("Peptide Settings - Quantitation", 24); OkDialog(peptideSettingsUI, peptideSettingsUI.OkDialog); } var calibrationForm = ShowDialog <CalibrationForm>(() => SkylineWindow.ShowCalibrationForm()); RunUI(() => { var calibrationFloatingWindow = calibrationForm.Parent.Parent; calibrationFloatingWindow.Width = 565; calibrationFloatingWindow.Top = SkylineWindow.Top; calibrationFloatingWindow.Left = SkylineWindow.Right + 20; }); PauseForScreenShot <CalibrationForm>("Calibration Curve ", 25); OkDialog(calibrationForm, calibrationForm.Close); // Hide the calibration window { var transitionSettingsUI = ShowDialog <TransitionSettingsUI>(SkylineWindow.ShowTransitionSettingsUI); RunUI(() => transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.Prediction); var editCurrentCE = ShowDialog <EditCEDlg>(transitionSettingsUI.EditCECurrent); RunUI(() => { editCurrentCE.StepSize = 2; editCurrentCE.StepCount = 5; }); PauseForScreenShot <EditCEDlg>("Edit Collision Energy Equation form", 26); RunUI(() => { editCurrentCE.OkDialog(); transitionSettingsUI.UseOptimized = true; transitionSettingsUI.OptimizeType = OptimizedMethodType.Transition.GetLocalizedString(); }); PauseForScreenShot <TransitionSettingsUI.PredictionTab>("Transition Settings - Prediction tab", 27); OkDialog(transitionSettingsUI, transitionSettingsUI.OkDialog); } // Export transition lists { var exportTransitionList = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.List)); RunUI(() => { exportTransitionList.ExportStrategy = ExportStrategy.Buckets; exportTransitionList.IgnoreProteins = true; exportTransitionList.MaxTransitions = 100; exportTransitionList.InstrumentType = ExportInstrumentType.WATERS_XEVO_TQ; exportTransitionList.MethodType = ExportMethodType.Scheduled; exportTransitionList.OptimizeType = ExportOptimize.CE; }); PauseForScreenShot <ExportMethodDlg>("Exporting scheduled transition list", 28); var scheduleDlg = ShowDialog <SchedulingOptionsDlg>(() => exportTransitionList.OkDialog(GetTestPath("EnergyMet_5minutes_ceopt.csv"))); PauseForScreenShot <SchedulingOptionsDlg>("Scheduling", 29); OkDialog(scheduleDlg, scheduleDlg.OkDialog); } // Import CE optimization runs using (new WaitDocumentChange(1, true)) { var importResultsDlg1 = ShowDialog <ImportResultsDlg>(SkylineWindow.ImportResults); RunUI(() => { importResultsDlg1.RadioCreateMultipleChecked = true; importResultsDlg1.OptimizationName = ExportOptimize.CE; importResultsDlg1.ReplicateName = "CE Optimization"; }); PauseForScreenShot <ImportResultsDlg>("Setting new replicate name to CE Optimization", 30); var openDataSourceDialog1 = ShowDialog <OpenDataSourceDialog>(() => importResultsDlg1.OkDialog()); RunUI(() => { openDataSourceDialog1.CurrentDirectory = new MsDataFilePath(GetTestPath("CE Optimization")); openDataSourceDialog1.SelectAllFileType(ExtWatersRaw); }); PauseForScreenShot <OpenDataSourceDialog>("Import Results Files form", 31); OkDialog(openDataSourceDialog1, openDataSourceDialog1.Open); } PauseForScreenShot <SkylineWindow>("Skyline shows new replicate \"CE Optimization\"", 32); RunUI(() => { SkylineWindow.Size = new Size(1600, 960); SkylineWindow.ShowGraphRetentionTime(false, GraphTypeSummary.replicate); SkylineWindow.AutoZoomBestPeak(); AdjustSequenceTreePanelWidth(); SkylineWindow.ShowSingleTransition(); SkylineWindow.ShowSplitChromatogramGraph(true); }); PauseForScreenShot <SkylineWindow>("Split graph", 33); RunUI(() => { SkylineWindow.ShowPeakAreaLegend(false); }); PauseForScreenShot <SkylineWindow>("No legend", 34); // Show Pentose-P SelectNode(SrmDocument.Level.Molecules, 6); PauseForScreenShot <SkylineWindow>("Pentose-P", 35); if (IsCoverShotMode) { RunUI(() => { Settings.Default.ChromatogramFontSize = 14; Settings.Default.AreaFontSize = 14; SkylineWindow.ChangeTextSize(TreeViewMS.LRG_TEXT_FACTOR); SkylineWindow.ShowChromatogramLegends(false); }); RestoreCoverViewOnScreen(); TakeCoverShot(); return; } // Export final transition list { var exportTransitionList = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.List)); RunUI(() => { exportTransitionList.ExportStrategy = ExportStrategy.Single; exportTransitionList.IgnoreProteins = true; exportTransitionList.MaxTransitions = 100; exportTransitionList.InstrumentType = ExportInstrumentType.WATERS_XEVO_TQ; exportTransitionList.MethodType = ExportMethodType.Scheduled; }); PauseForScreenShot <ExportMethodDlg>("Exporting final optimized transition list", 36); var scheduleDlg = ShowDialog <SchedulingOptionsDlg>(() => exportTransitionList.OkDialog(GetTestPath("EnergyMet_5minutes_optimal.csv"))); PauseForScreenShot <SchedulingOptionsDlg>("Final Scheduling", 37); OkDialog(scheduleDlg, scheduleDlg.OkDialog); } } }
private void arrangeTiledMenuItem_Click(object sender, EventArgs e) { SkylineWindow.ArrangeGraphsTiled(); }
protected override void DoTest() { // DDA with IDs and alignment string filePathDda = TestFilesDir.GetTestPath(@"DDA\Bereman_5proteins_spikein_decoys.sky.zip"); RunUI(() => SkylineWindow.OpenSharedFile(filePathDda)); var doc = WaitForDocumentLoaded(); int expectedDecoys = RefinementSettings.SuggestDecoyCount(doc); RunDlg <GenerateDecoysDlg>(() => SkylineWindow.ShowGenerateDecoysDlg(), decoysDlg => { decoysDlg.DecoysMethod = DecoyGeneration.SHUFFLE_SEQUENCE; decoysDlg.OkDialog(); }); doc = WaitForDocumentChange(doc); Assert.AreEqual(expectedDecoys, doc.Peptides.Count(p => p.IsDecoy)); ImportResultsFiles(DDA_FILES.Select(s => GetDataFile("DDA", s)).Select(MsDataFileUri.Parse)); RunUI(() => { SkylineWindow.SaveDocument(); SkylineWindow.ArrangeGraphsTiled(); SkylineWindow.ShowAlignedPeptideIDTimes(true); SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.SelectedNode.FirstNode; }); // Random nature of decoys makes it hard to make this very deterministic // But eventually we should see some peptides without IDs of their own // All peptides should have aligned IDs, if they don't have a single ID, // since it might be the only ID int countWithIds = 0, countTotal = 0; while (countWithIds < 20 || countTotal - 4 < countWithIds) { WaitForGraphs(); RunUI(() => { foreach (var graphChromatogram in SkylineWindow.GraphChromatograms) { countTotal++; int countIds = graphChromatogram.RetentionMsMs != null ? graphChromatogram.RetentionMsMs.Length : 0; if (countIds != 1) { Assert.IsNotNull(graphChromatogram.AlignedRetentionMsMs); Assert.AreNotEqual(0, graphChromatogram.AlignedRetentionMsMs.Length); } if (countIds > 0) { ValidateTimeRange(graphChromatogram, graphChromatogram.RetentionMsMs, 6, 90); countWithIds++; } else { ValidateTimeRange(graphChromatogram, graphChromatogram.AlignedRetentionMsMs, 6, 90); } } var nextNode = SkylineWindow.SequenceTree.SelectedNode.NextNode; if (nextNode != null) { SkylineWindow.SequenceTree.SelectedNode = nextNode; } }); } // DIA with DDA IDs string filePathDia = TestFilesDir.GetTestPath(@"DIA\Hoofnagle_QE_DIA_targeted_decoys.sky.zip"); RunUI(() => SkylineWindow.OpenSharedFile(filePathDia)); doc = WaitForDocumentLoaded(); expectedDecoys = RefinementSettings.SuggestDecoyCount(doc); RunDlg <GenerateDecoysDlg>(() => SkylineWindow.ShowGenerateDecoysDlg(), decoysDlg => { decoysDlg.DecoysMethod = DecoyGeneration.REVERSE_SEQUENCE; decoysDlg.OkDialog(); }); doc = WaitForDocumentChange(doc); Assert.AreEqual(expectedDecoys, doc.Peptides.Count(p => p.IsDecoy)); ImportResultsFiles(DIA_FILES.Select(s => GetDataFile("DIA", s)).Select(MsDataFileUri.Parse)); RunUI(() => { SkylineWindow.SaveDocument(); SkylineWindow.ArrangeGraphsTiled(); SkylineWindow.ShowOtherRunPeptideIDTimes(true); SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.SelectedNode.FirstNode; }); for (int i = 0; i < 6; i++) { WaitForGraphs(); RunUI(() => { foreach (var graphChromatogram in SkylineWindow.GraphChromatograms) { Assert.IsNull(graphChromatogram.RetentionMsMs); Assert.IsNull(graphChromatogram.AlignedRetentionMsMs); Assert.IsNotNull(graphChromatogram.UnalignedRetentionMsMs); Assert.AreNotEqual(0, graphChromatogram.UnalignedRetentionMsMs.Length); ValidateTimeRange(graphChromatogram, graphChromatogram.UnalignedRetentionMsMs, 8, 120); } SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.SelectedNode.NextNode; }); } // DIA with IRT values string filePathDiaIrt = TestFilesDir.GetTestPath(@"DIA-iRT\AQUA4_Human_picked_napedro2_full_rescore_iRT_decoys.sky.zip"); RunUI(() => SkylineWindow.OpenSharedFile(filePathDiaIrt)); doc = WaitForDocumentLoaded(); expectedDecoys = RefinementSettings.SuggestDecoyCount(doc); RunDlg <GenerateDecoysDlg>(() => SkylineWindow.ShowGenerateDecoysDlg(), decoysDlg => { decoysDlg.DecoysMethod = DecoyGeneration.SHUFFLE_SEQUENCE; decoysDlg.OkDialog(); }); doc = WaitForDocumentChange(doc); Assert.AreEqual(expectedDecoys, doc.Peptides.Count(p => p.IsDecoy)); ImportResultsFile(GetDataFile("DIA-iRT", IRT_FILES[0])); RunUI(() => { SkylineWindow.SaveDocument(); SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.SelectedNode.FirstNode; }); for (int i = 0; i < 6; i++) { WaitForGraphs(); RunUI(() => { foreach (var graphChromatogram in SkylineWindow.GraphChromatograms) { Assert.IsNull(graphChromatogram.RetentionMsMs); Assert.IsNull(graphChromatogram.AlignedRetentionMsMs); Assert.IsNull(graphChromatogram.UnalignedRetentionMsMs); Assert.IsTrue(graphChromatogram.PredictedRT.HasValue); ValidateTimeRange(graphChromatogram, new [] { graphChromatogram.PredictedRT.Value }, 8, 135); } SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.SelectedNode.NextNode; }); } }
protected override void DoTest() { // Clean-up before running the test RunUI(() => SkylineWindow.ModifyDocument("Set default settings", d => d.ChangeSettings(SrmSettingsList.GetDefault()))); SrmDocument doc = SkylineWindow.Document; const string documentBaseName = "Ms1FilterTutorial"; string documentFile = GetTestPath(documentBaseName + SrmDocument.EXT); RunUI(() => SkylineWindow.SaveDocument(documentFile)); // Launch the wizard var importPeptideSearchDlg = ShowDialog <ImportPeptideSearchDlg>(SkylineWindow.ShowImportPeptideSearchDlg); // We're on the "Build Spectral Library" page of the wizard. // Add the test xml file to the search files list and try to // build the document library. string[] searchFiles = { GetTestPath("100803_0001_MCF7_TiB_L.group.xml"), // Not L10N GetTestPath("100803_0005b_MCF7_TiTip3.group.xml") // Not L10N }; foreach (var searchFile in searchFiles) { Assert.IsTrue(File.Exists(searchFile), string.Format("File {0} does not exist.", searchFile)); } PauseForScreenShot <ImportPeptideSearchDlg.SpectraPage>("Import Peptide Search - Build Spectral Library empty page", 3); RunUI(() => { Assert.IsTrue(importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.spectra_page); importPeptideSearchDlg.BuildPepSearchLibControl.AddSearchFiles(searchFiles); // Sanity check here, because of failure getting both files for results import below var searchNames = importPeptideSearchDlg.BuildPepSearchLibControl.SearchFilenames; Assert.AreEqual(searchFiles.Length, searchNames.Length, PathsMessage("Unexpected search files found.", searchNames)); var builder = importPeptideSearchDlg.BuildPepSearchLibControl.ImportPeptideSearch.GetLibBuilder( SkylineWindow.DocumentUI, SkylineWindow.DocumentFilePath, false); Assert.IsTrue(ArrayUtil.EqualsDeep(searchFiles, builder.InputFiles), PathsMessage("Unexpected BlibBuild input files.", builder.InputFiles)); importPeptideSearchDlg.BuildPepSearchLibControl.DebugMode = true; }); PauseForScreenShot <ImportPeptideSearchDlg.SpectraPage>("Import Peptide Search - Build Spectral Library populated page", 4); WaitForConditionUI(() => importPeptideSearchDlg.IsNextButtonEnabled); var ambiguousDlg = ShowDialog <MessageDlg>(() => importPeptideSearchDlg.ClickNextButton()); RunUI(() => AssertEx.Contains(ambiguousDlg.Message, Resources.BiblioSpecLiteBuilder_AmbiguousMatches_The_library_built_successfully__Spectra_matching_the_following_peptides_had_multiple_ambiguous_peptide_matches_and_were_excluded_)); OkDialog(ambiguousDlg, ambiguousDlg.OkDialog); // Verify document library was built string docLibPath = BiblioSpecLiteSpec.GetLibraryFileName(documentFile); string redundantDocLibPath = BiblioSpecLiteSpec.GetRedundantName(docLibPath); Assert.IsTrue(File.Exists(docLibPath) && File.Exists(redundantDocLibPath)); var librarySettings = SkylineWindow.Document.Settings.PeptideSettings.Libraries; Assert.IsTrue(librarySettings.HasDocumentLibrary); // Verify input paths sent to BlibBuild string buildArgs = importPeptideSearchDlg.BuildPepSearchLibControl.LastBuildCommandArgs; string buildOutput = importPeptideSearchDlg.BuildPepSearchLibControl.LastBuildOutput; var argLines = buildArgs.Split(new[] { Environment.NewLine }, StringSplitOptions.None); var dirCommon = PathEx.GetCommonRoot(searchFiles); var searchLines = searchFiles.Select(f => PathEx.RemovePrefix(f, dirCommon)).ToArray(); Assert.IsTrue(ArrayUtil.EqualsDeep(searchLines, argLines.Skip(1).ToArray()), buildArgs); // Verify resulting .blib file contains the expected files var docLib = librarySettings.Libraries[0]; int expectedFileCount = searchFiles.Length; int expectedRedundantSpectra = 813; // 446 with TiTip only int expectedSpectra = 552; // 428 with TiTip3 only if (expectedFileCount != docLib.FileCount) { var searchFileNames = searchFiles.Select(Path.GetFileName).ToArray(); using (var blibDbRedundant = BlibDb.OpenBlibDb(redundantDocLibPath)) { VerifyLib(searchFileNames, expectedRedundantSpectra, blibDbRedundant.GetIdFilePaths(), blibDbRedundant.GetSpectraCount(), "redundant library", buildArgs, buildOutput); } using (var blibDb = BlibDb.OpenBlibDb(docLibPath)) { VerifyLib(searchFileNames, expectedSpectra, blibDb.GetIdFilePaths(), blibDb.GetSpectraCount(), "SQLite library", buildArgs, buildOutput); } VerifyLib(searchFileNames, expectedSpectra, docLib.LibraryDetails.DataFiles.Select(d => d.IdFilePath).ToArray(), docLib.SpectrumCount, "in memory", buildArgs, buildOutput); } // We're on the "Extract Chromatograms" page of the wizard. // All the test results files are in the same directory as the // document file, so all the files should be found, and we should // just be able to move to the next page. WaitForConditionUI(() => importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.chromatograms_page && importPeptideSearchDlg.ImportResultsControl.FoundResultsFiles.Count > 0 && importPeptideSearchDlg.IsNextButtonEnabled); // Wait for extra for both source files in the list TryWaitForConditionUI(10 * 1000, () => importPeptideSearchDlg.ImportResultsControl.FoundResultsFiles.Count == searchFiles.Length); RunUI(() => { // Check for missing files var missingFiles = importPeptideSearchDlg.ImportResultsControl.MissingResultsFiles.ToArray(); Assert.AreEqual(0, missingFiles.Length, PathsMessage("Unexpected missing file found.", missingFiles)); // Check for expected results files var resultsNames = importPeptideSearchDlg.ImportResultsControl.FoundResultsFiles.Select(f => f.Name).ToArray(); Assert.AreEqual(searchFiles.Length, importPeptideSearchDlg.ImportResultsControl.FoundResultsFiles.Count, PathsMessage("Unexpected results files found.", resultsNames)); // Check for expected common prefix var commonPrefix = ImportResultsDlg.GetCommonPrefix(resultsNames); Assert.IsFalse(string.IsNullOrEmpty(commonPrefix), PathsMessage("File names do not have a common prefix.", resultsNames)); Assert.AreEqual("100803_000", commonPrefix); }); PauseForScreenShot <ImportPeptideSearchDlg.ChromatogramsPage>("Import Peptide Search - Extract Chromatograms page", 6); var importResultsNameDlg = ShowDialog <ImportResultsNameDlg>(() => importPeptideSearchDlg.ClickNextButton()); PauseForScreenShot <ImportResultsNameDlg>("Import Results - Common prefix form", 7); OkDialog(importResultsNameDlg, importResultsNameDlg.YesDialog); // Wait for the "Add Modifications" page of the wizard. WaitForConditionUI(() => importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.match_modifications_page); List <string> modsToCheck = new List <string> { "Phospho (ST)", "Phospho (Y)", "Oxidation (M)" }; // Not L10N RunUI(() => { importPeptideSearchDlg.MatchModificationsControl.CheckedModifications = modsToCheck; }); PauseForScreenShot <ImportPeptideSearchDlg.MatchModsPage>("Import Peptide Search - Add Modifications page", 8); RunUI(() => Assert.IsTrue(importPeptideSearchDlg.ClickNextButton())); // We're on the "Configure MS1 Full-Scan Settings" page of the wizard. RunUI(() => { Assert.IsTrue(importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.full_scan_settings_page); importPeptideSearchDlg.FullScanSettingsControl.PrecursorCharges = new[] { 2, 3, 4 }; importPeptideSearchDlg.FullScanSettingsControl.PrecursorMassAnalyzer = FullScanMassAnalyzerType.tof; importPeptideSearchDlg.FullScanSettingsControl.PrecursorRes = 10 * 1000; Assert.AreEqual(importPeptideSearchDlg.FullScanSettingsControl.PrecursorIsotopesCurrent, FullScanPrecursorIsotopes.Count); Assert.AreEqual(FullScanMassAnalyzerType.tof, importPeptideSearchDlg.FullScanSettingsControl.PrecursorMassAnalyzer); Assert.AreEqual(10 * 1000, importPeptideSearchDlg.FullScanSettingsControl.PrecursorRes); Assert.AreEqual(3, importPeptideSearchDlg.FullScanSettingsControl.Peaks); Assert.AreEqual(RetentionTimeFilterType.ms2_ids, importPeptideSearchDlg.FullScanSettingsControl.RetentionTimeFilterType); Assert.AreEqual(5, importPeptideSearchDlg.FullScanSettingsControl.TimeAroundMs2Ids); }); PauseForScreenShot <ImportPeptideSearchDlg.Ms1FullScanPage>("Import Peptide Search - Configure MS1 Full-Scan Settings page", 9); RunUI(() => Assert.IsTrue(importPeptideSearchDlg.ClickNextButton())); // Last page of wizard - Import Fasta. string fastaPath = GetTestPath("12_proteins.062011.fasta"); RunUI(() => { Assert.IsTrue(importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.import_fasta_page); Assert.AreEqual("Trypsin [KR | P]", importPeptideSearchDlg.ImportFastaControl.Enzyme.GetKey()); importPeptideSearchDlg.ImportFastaControl.MaxMissedCleavages = 2; importPeptideSearchDlg.ImportFastaControl.SetFastaContent(fastaPath); Assert.IsFalse(importPeptideSearchDlg.ImportFastaControl.DecoyGenerationEnabled); }); PauseForScreenShot <ImportPeptideSearchDlg.FastaPage>("Import Peptide Search - Import FASTA page", 12); var peptidesPerProteinDlg = ShowDialog <PeptidesPerProteinDlg>(() => importPeptideSearchDlg.ClickNextButton()); WaitForCondition(() => peptidesPerProteinDlg.DocumentFinalCalculated); RunUI(() => { int proteinCount, peptideCount, precursorCount, transitionCount; peptidesPerProteinDlg.NewTargetsAll(out proteinCount, out peptideCount, out precursorCount, out transitionCount); Assert.AreEqual(11, proteinCount); Assert.AreEqual(51, peptideCount); Assert.AreEqual(52, precursorCount); Assert.AreEqual(156, transitionCount); peptidesPerProteinDlg.NewTargetsFinal(out proteinCount, out peptideCount, out precursorCount, out transitionCount); Assert.AreEqual(11, proteinCount); Assert.AreEqual(51, peptideCount); Assert.AreEqual(52, precursorCount); Assert.AreEqual(156, transitionCount); }); OkDialog(peptidesPerProteinDlg, peptidesPerProteinDlg.OkDialog); var allChromGraph = WaitForOpenForm <AllChromatogramsGraph>(); RunUI(() => { allChromGraph.Left = SkylineWindow.Right + 20; allChromGraph.Activate(); }); PauseForScreenShot <AllChromatogramsGraph>("Loading chromatograms window", 13); WaitForDocumentChangeLoaded(doc, 8 * 60 * 1000); // 10 minutes var libraryExplorer = ShowDialog <ViewLibraryDlg>(() => SkylineWindow.OpenLibraryExplorer(documentBaseName)); var matchedPepModsDlg = WaitForOpenForm <AddModificationsDlg>(); PauseForScreenShot <AddModificationsDlg>("Add mods alert", 14); RunUI(() => { Assert.AreEqual(13, matchedPepModsDlg.NumMatched); Assert.AreEqual(0, matchedPepModsDlg.NumUnmatched); matchedPepModsDlg.CancelDialog(); }); RunUI(() => { libraryExplorer.GraphSettings.ShowBIons = true; libraryExplorer.GraphSettings.ShowYIons = true; libraryExplorer.GraphSettings.ShowCharge1 = true; libraryExplorer.GraphSettings.ShowCharge2 = true; libraryExplorer.GraphSettings.ShowPrecursorIon = true; }); PauseForScreenShot <ViewLibraryDlg>("Spectral Library Explorer", 15); RunUI(() => { const string sourceFirst = "100803_0005b_MCF7_TiTip3.wiff"; const double timeFirst = 35.2128; Assert.AreEqual(sourceFirst, libraryExplorer.SourceFile); Assert.AreEqual(timeFirst, libraryExplorer.RetentionTime, 0.01); libraryExplorer.SelectedIndex++; Assert.AreNotEqual(sourceFirst, libraryExplorer.SourceFile); Assert.AreNotEqual(timeFirst, libraryExplorer.RetentionTime, 0.01); }); OkDialog(libraryExplorer, libraryExplorer.CancelDialog); const int TIB_L = 0; // index for Tib_L const int TIP3 = 1; // index for Tip3 AssertEx.IsDocumentState(SkylineWindow.Document, null, 11, 51, 52, 156); AssertResult.IsDocumentResultsState(SkylineWindow.Document, GetFileNameWithoutExtension(searchFiles[TIB_L]), 51, 52, 0, 156, 0); AssertResult.IsDocumentResultsState(SkylineWindow.Document, GetFileNameWithoutExtension(searchFiles[TIP3]), 51, 52, 0, 156, 0); string Tib_LFilename = searchFiles[TIB_L].Replace(".group.xml", PreferedExtAbWiff); string Tip3Filename = searchFiles[TIP3].Replace(".group.xml", PreferedExtAbWiff); // Select the first transition group. RunUI(() => { SkylineWindow.SequenceTree.SelectedPath = SkylineWindow.Document.GetPathTo((int)SrmDocument.Level.Molecules, 0); SkylineWindow.GraphSpectrumSettings.ShowAIons = true; SkylineWindow.GraphSpectrumSettings.ShowBIons = true; SkylineWindow.GraphSpectrumSettings.ShowYIons = true; SkylineWindow.GraphSpectrumSettings.ShowPrecursorIon = true; SkylineWindow.ExpandPrecursors(); SkylineWindow.ChangeTextSize(TreeViewMS.LRG_TEXT_FACTOR); }); RunDlg <SpectrumChartPropertyDlg>(SkylineWindow.ShowSpectrumProperties, dlg => { dlg.FontSize = GraphFontSize.NORMAL; dlg.OkDialog(); }); RunDlg <ChromChartPropertyDlg>(SkylineWindow.ShowChromatogramProperties, dlg => { dlg.FontSize = GraphFontSize.NORMAL; dlg.OkDialog(); }); const int skylineWindowWidth = 1160; const int skylineWindowHeight = 792; RunUI(() => { // Make window screenshot size if (IsPauseForScreenShots && SkylineWindow.WindowState != FormWindowState.Maximized) { SkylineWindow.Width = skylineWindowWidth; SkylineWindow.Height = skylineWindowHeight; } }); RestoreViewOnScreen(13); PauseForScreenShot("Main window with imported data", 16); // RunUIWithDocumentWait(() => // { // SkylineWindow.ToggleIntegrateAll(); // TODO: No longer necessary. Change in tutorial // }); RunUI(() => { SkylineWindow.ShowGraphPeakArea(true); SkylineWindow.ShowPeakAreaReplicateComparison(); SkylineWindow.NormalizeAreaGraphTo(NormalizeOption.NONE); Settings.Default.ShowDotProductPeakArea = true; Settings.Default.ShowLibraryPeakArea = true; }); RunUI(() => { SkylineWindow.Width = 500; var peakAreas = SkylineWindow.GraphPeakArea; var peakAreasFloating = peakAreas.Parent.Parent; peakAreasFloating.Left = SkylineWindow.Right + 20; peakAreasFloating.Top = SkylineWindow.Top; peakAreasFloating.Size = new Size(504, 643); }); PauseForScreenShot <GraphSummary.AreaGraphView>("Peak Areas view (show context menu)", 18); RunUI(() => SkylineWindow.Width = skylineWindowWidth); RestoreViewOnScreen(15); RunUI(() => { SkylineWindow.AutoZoomBestPeak(); SkylineWindow.ArrangeGraphsTiled(); SkylineWindow.ShowChromatogramLegends(false); }); PauseForScreenShot("Main window layout", 19); int atest = 0; CheckAnnotations(TIB_L, 0, atest++); int pepIndex = 3; RunUI(() => SkylineWindow.CollapsePeptides()); RunUI(() => SkylineWindow.ShowAlignedPeptideIDTimes(true)); ChangePeakBounds(TIB_L, pepIndex, 38.79, 39.385); PauseForScreenShot("Chromatogram graphs clipped from main window", 21); CheckAnnotations(TIB_L, pepIndex, atest++); var alignmentForm = ShowDialog <AlignmentForm>(() => SkylineWindow.ShowRetentionTimeAlignmentForm()); const int skylineWindowNarrowWidth = 788; RunUI(() => { SkylineWindow.Width = skylineWindowNarrowWidth; alignmentForm.Width = 660; alignmentForm.Height = 561; alignmentForm.Left = SkylineWindow.Right + 20; alignmentForm.Splitter.SplitterDistance = 75; alignmentForm.ComboAlignAgainst.SelectedIndex = 0; // to match what's in the tutorial doc }); PauseForScreenShot <AlignmentForm>("Retention time alignment form", 22); OkDialog(alignmentForm, alignmentForm.Close); PauseForScreenShot("Status bar clipped from main window - 4/51 pep 4/52 prec 10/156 tran", 23); const string TIP_NAME = "5b_MCF7_TiTip3"; if (IsCoverShotMode) { RestoreCoverViewOnScreen(); ClickChromatogram(TIP_NAME, 34.5, 366); TreeNode selectedNode = null; RunUI(() => selectedNode = SkylineWindow.SequenceTree.SelectedNode); RunUI(() => SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.Nodes[0]); WaitForGraphs(); RunUI(() => SkylineWindow.SequenceTree.SelectedNode = selectedNode); TakeCoverShot(); return; } pepIndex = JumpToPeptide("SSKASLGSLEGEAEAEASSPK"); RunUI(() => SkylineWindow.ShowChromatogramLegends(true)); Assert.IsTrue(8 == pepIndex); PauseForScreenShot("Chromatogram graph metafiles for 9th peptide", 24); CheckAnnotations(TIB_L, pepIndex, atest++); ZoomSingle(TIP3, 31.8, 42.2, 280); // simulate the wheel scroll described in tutorial PauseForScreenShot("Chromatogram graph metafile showing all peaks for 1_MCF_TiB_L", 24); CheckAnnotations(TIB_L, pepIndex, atest++); // current TIB_L peak should have idotp .87 and ppm -6.9 Assert.AreEqual(0.87, GetTransitionGroupChromInfo(TIB_L, pepIndex).IsotopeDotProduct ?? -1, .005); Assert.AreEqual(-10.8, GetTransitionChromInfo(TIB_L, pepIndex, 0).MassError ?? -1, .05); ChangePeakBounds(TIB_L, pepIndex, 36.5, 38.0); // now current TIB_L peak should have idotp .9 and ppm -6.5 Assert.AreEqual(0.9, GetTransitionGroupChromInfo(TIB_L, pepIndex).IsotopeDotProduct ?? -1, .005); Assert.AreEqual(-9.4, GetTransitionChromInfo(TIB_L, pepIndex, 0).MassError ?? -1, .05); CheckAnnotations(TIB_L, pepIndex, atest++); var undoIndex = SkylineWindow.Document.RevisionIndex; // preserve for simulating ctrl-z RunUI(() => SkylineWindow.Width = skylineWindowWidth); PickPeakBoth(pepIndex, 40.471035, 40.8134); // select peak for both chromatograms at these respective retention times PauseForScreenShot <GraphSummary.AreaGraphView>("Peak Areas graph metafile", 25); int[] m1Thru4 = { 1, 2, 3, 4, 5 }; PickTransitions(pepIndex, m1Thru4, "Transition pick list filtered", 26, "Transition pick list unfiltered", 26); // turn on chromatograms PickPeakBoth(pepIndex, 36.992836, 37.3896027); // select peak for both chromatograms at these respective retention times ZoomSingle(TIP3, 32.4, 42.2, 520); // set the view for screenshot RunUI(() => { SkylineWindow.Height = 550; SkylineWindow.ArrangeGraphsTabbed(); }); ActivateReplicate(TIP_NAME); PauseForScreenShot("Chromatogram graph metafile comparing 33 and 37 minute peaks", 27); CheckAnnotations(TIB_L, pepIndex, atest++); CheckAnnotations(TIP3, pepIndex, atest++); RevertDoc(undoIndex); // undo changes ActivateReplicate(TIP_NAME); ClickChromatogram(TIP_NAME, 37.3, 142); PauseForScreenShot("MS1 spectrum graph 37.32 minutes", 28); ClickChromatogram(TIP_NAME, 33.2, 328.1); PauseForScreenShot("MS1 spectrum graph 33.19 minutes", 29); RunUI(() => SkylineWindow.HideFullScanGraph()); RunUI(() => { SkylineWindow.Width = skylineWindowNarrowWidth; SkylineWindow.Height = skylineWindowHeight; SkylineWindow.ArrangeGraphs(DisplayGraphsType.Column); }); pepIndex = JumpToPeptide("ASLGSLEGEAEAEASSPKGK"); // Not L10N Assert.IsTrue(10 == pepIndex); PauseForScreenShot("Chromatogram graph meta files for peptide ASLGSLEGEAEAEASSPKGK", 30); CheckAnnotations(TIB_L, pepIndex, atest++); CheckAnnotations(TIP3, pepIndex, atest++); PickTransitions(pepIndex, m1Thru4); // turn on M+3 and M+4 ChangePeakBounds(TIP3, pepIndex, 37.35, 38.08); ZoomSingle(TIP3, 36.65, 39.11, 300); // simulate the wheel scroll described in tutorial PauseForScreenShot("upper - Chromatogram graph metafile for peptide ASLGSLEGEAEAEASSPKGK with adjusted integration", 31); CheckAnnotations(TIP3, pepIndex, atest++); RevertDoc(undoIndex); // undo changes pepIndex = JumpToPeptide("AEGEWEDQEALDYFSDKESGK"); // Not L10N PauseForScreenShot("lower - Chromatogram graph metafiles for peptide AEGEWEDQEALDYFSDKESGK", 31); CheckAnnotations(TIB_L, pepIndex, atest++); CheckAnnotations(TIP3, pepIndex, atest++); int[] m1Thru5 = { 1, 2, 3, 4, 5, 6 }; PickTransitions(pepIndex, m1Thru5); // turn on M+3 M+4 and M+5 PauseForScreenShot("Chromatogram graph metafiles with M+3, M+4 and M+5 added", 32); CheckAnnotations(TIB_L, pepIndex, atest++); CheckAnnotations(TIP3, pepIndex, atest++); JumpToPeptide("ALVEFESNPEETREPGSPPSVQR"); // Not L10N PauseForScreenShot("Chromatogram graph metafiles for peptide ALVEFESNPEETREPGSPPSVQR", 33); pepIndex = JumpToPeptide("YGPADVEDTTGSGATDSKDDDDIDLFGSDDEEESEEAKR"); // Not L10N if (IsPauseForScreenShots) { RestoreViewOnScreen(34); PauseForScreenShot("upper - Peak Areas graph metafile for peptide YGPADVEDTTGSGATDSKDDDDIDLFGSDDEEESEEAKR", 34); } int[] m1Thru7 = { 1, 2, 3, 4, 5, 6, 7, 8 }; PickTransitions(pepIndex, m1Thru7); // enable [M+3] [M+4] [M+5] [M+6] [M+7] PauseForScreenShot("lower - Peak Areas graph metafile with M+3 through M+7 added", 34); CheckAnnotations(TIB_L, pepIndex, atest++); CheckAnnotations(TIP3, pepIndex, atest++); RunUI(() => SkylineWindow.ShowGraphPeakArea(false)); // page 36 zooming setup RunUI(() => { SkylineWindow.SynchronizeZooming(true); SkylineWindow.LockYChrom(false); SkylineWindow.AlignToFile = GetGraphChromatogram(TIP3).GetChromFileInfoId(); // align to Tip3 }); ZoomBoth(36.5, 39.5, 1600); // simulate the wheel scroll described in tutorial RunUI(() => { SkylineWindow.ShowChromatogramLegends(false); SkylineWindow.Width = skylineWindowWidth; SkylineWindow.Height = 720; }); PauseForScreenShot("Chromatogram graphs clipped from main window with synchronized zooming", 35); ClickChromatogram(TIP_NAME, 37.5, 1107.3); PauseForScreenShot("MS1 spectrum graph 37.50 minutes", 36); RunUI(() => SkylineWindow.HideFullScanGraph()); RunUI(() => { SkylineWindow.ShowChromatogramLegends(true); SkylineWindow.Width = skylineWindowNarrowWidth; SkylineWindow.Height = skylineWindowHeight; }); RestoreViewOnScreen(36); // float the Library Match window RunUI(() => SkylineWindow.GraphSpectrum.SelectSpectrum(new SpectrumIdentifier(MsDataFileUri.Parse(Tip3Filename), 37.6076f))); // set the Library Match view PauseForScreenShot <GraphSpectrum>("Library Match graph metafile - 5b_MCF7_TiTip3 (37.61 Min)", 37); RunUI(() => SkylineWindow.GraphSpectrum.SelectSpectrum(new SpectrumIdentifier(MsDataFileUri.Parse(Tib_LFilename), 37.0335f))); // set the Library Match view PauseForScreenShot <GraphSpectrum>("Library Match graph metafile - 1_MCF_TiB_L (37.03 min)", 37); RestoreViewOnScreen(37); // back to normal view /* pepIndex = */ JumpToPeptide("DQVANSAFVER"); // Not L10N PauseForScreenShot("Chromatogram graph metafiles for peptide DQVANSAFVER", 38); // int[] m1 = {2}; // PickTransitions(pepIndex, m1); // enable [M+1] only // // Measured times in TIB_L are different from displayed times, because of alignment // ChangePeakBounds(TIB_L, pepIndex, 23.99, 25.29); // ChangePeakBounds(TIP3, pepIndex, 23.81, 25.21); // // First transition selected for screenshot // RunUI(() => // { // var pathPep = SkylineWindow.SelectedPath; // var nodePep = ((PeptideTreeNode)SkylineWindow.SelectedNode).DocNode; // var nodeGroup = nodePep.TransitionGroups.First(); // var nodeTran = nodeGroup.Transitions.First(); // SkylineWindow.SelectedPath = new IdentityPath( // new IdentityPath(pathPep, nodeGroup.TransitionGroup), nodeTran.Transition); // }); // PauseForScreenShot("page 36 - M+1 only, with adjusted integration"); // CheckAnnotations(TIB_L, pepIndex, atest++); // CheckAnnotations(TIP3, pepIndex, EXPECTED_ANNOTATIONS[atest]); var docAfter = WaitForProteinMetadataBackgroundLoaderCompletedUI(); // Minimizing a chromatogram cache file. RunUI(SkylineWindow.CollapsePeptides); for (int i = 0; i < 5; i++) // just do the first 5 { int iPeptide = i; var path = docAfter.GetPathTo((int)SrmDocument.Level.Molecules, iPeptide); RunUI(() => { SkylineWindow.SelectedPath = path; }); WaitForGraphs(); } // Eliminate extraneous chromatogram data. doc = WaitForProteinMetadataBackgroundLoaderCompletedUI(); var minimizedFile = GetTestPath("Ms1FilteringTutorial-2min.sky"); // Not L10N var cacheFile = Path.ChangeExtension(minimizedFile, ChromatogramCache.EXT); { // TODO: Figure out why the minimize fails to unlock the .skyd file, if not minimized to current file RunUI(() => SkylineWindow.SaveDocument(minimizedFile)); var manageResultsDlg = ShowDialog <ManageResultsDlg>(SkylineWindow.ManageResults); var minimizeResultsDlg = ShowDialog <MinimizeResultsDlg>(manageResultsDlg.MinimizeResults); RunUI(() => { minimizeResultsDlg.LimitNoiseTime = true; minimizeResultsDlg.NoiseTimeRange = 2; // Not L10N }); PauseForScreenShot <MinimizeResultsDlg>("Minimize Results form (percentages vary slightly)", 39); // old p. 23 OkDialog(minimizeResultsDlg, () => minimizeResultsDlg.MinimizeToFile(minimizedFile)); WaitForCondition(() => File.Exists(cacheFile)); WaitForClosedForm(manageResultsDlg); } WaitForDocumentChange(doc); // Inclusion list method export for MS1 filtering doc = SkylineWindow.Document; RunDlg <PeptideSettingsUI>(() => SkylineWindow.ShowPeptideSettingsUI(PeptideSettingsUI.TABS.Prediction), dlg => { dlg.IsUseMeasuredRT = true; dlg.TimeWindow = 10; dlg.OkDialog(); }); doc = WaitForDocumentChangeLoaded(doc); // Now deviating from the tutorial script for a moment to make sure we can choose a Scheduled export method. // CONSIDER: This refinement seems to be a no-op. Not sure why it is here. RunDlg <RefineDlg>(SkylineWindow.ShowRefineDlg, dlg => { dlg.MinPeptides = 1; // This would get rid of proteins with no peptides (none exist) const double minPeakFoundRatio = 0.1; dlg.MinPeakFoundRatio = minPeakFoundRatio; // This would get rid of undetected transitions (none exist) dlg.OkDialog(); // Will not change the document or add an Undo entry }); // Nothing should have changed on the UI thread RunUI(() => Assert.AreSame(doc, SkylineWindow.DocumentUI)); // Ready to export, although we will just cancel out of the dialog. var exportMethodDlg = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.Method)); RunUI(() => { exportMethodDlg.InstrumentType = ExportInstrumentType.ABI_TOF; // Not L10N exportMethodDlg.MethodType = ExportMethodType.Scheduled; exportMethodDlg.CancelButton.PerformClick(); }); WaitForClosedForm(exportMethodDlg); // Because this was showing up in the nightly test failures WaitForConditionUI(() => exportMethodDlg.IsDisposed); RunUI(() => SkylineWindow.SaveDocument()); RunUI(SkylineWindow.NewDocument); }
private void TofTest() { // Working wih High-Resolution Mass Spectra. // Import a new Document. High-Resolution Mass Spectra, working with TOF p22. string newDocumentFile = GetTestPath(@"TOF\BSA_Agilent.sky"); WaitForCondition(() => File.Exists(newDocumentFile)); RunUI(() => SkylineWindow.OpenFile(newDocumentFile)); bool asSmallMolecules = AsSmallMoleculesTestMode != RefinementSettings.ConvertToSmallMoleculesMode.none; if (asSmallMolecules) { ConvertDocumentToSmallMolecules(AsSmallMoleculesTestMode); } var docCalibrate1 = WaitForDocumentLoaded(); const int pepCount1 = 5, preCount1 = 5, tranCount1 = 30; AssertEx.IsDocumentState(docCalibrate1, null, 1, pepCount1, preCount1, tranCount1); // Try to import a file to show it fails. ImportResultsDlg importResultsDlg3 = ShowDialog <ImportResultsDlg>(SkylineWindow.ImportResults); RunUI(() => importResultsDlg3.NamedPathSets = importResultsDlg3.GetDataSourcePathsFileReplicates( new[] { MsDataFileUri.Parse(GetTestPath(@"TOF\6-BSA-500fmol" + ExtAgilentRaw)) })); var importProgress = ShowDialog <AllChromatogramsGraph>(importResultsDlg3.OkDialog); WaitForDocumentChangeLoaded(docCalibrate1); WaitForConditionUI(() => importProgress.Finished); string expectedErrorFormat = Resources.NoFullScanFilteringException_NoFullScanFilteringException_To_extract_chromatograms_from__0__full_scan_settings_must_be_enabled_; WaitForConditionUI(() => !string.IsNullOrEmpty(importProgress.Error), "Missing expected error text: " + expectedErrorFormat); RunUI(() => AssertEx.AreComparableStrings(expectedErrorFormat, importProgress.Error, 1)); RunUI(() => { importProgress.ClickClose(); SkylineWindow.Undo(); }); var document = SkylineWindow.Document; // Fill out Transition Settings Menu int tranCount2 = (AsSmallMoleculesTestMode != RefinementSettings.ConvertToSmallMoleculesMode.masses_only) ? (tranCount1 + preCount1 * 3) : (tranCount1 + preCount1); // No iostopes for mass-only document using (new CheckDocumentState(1, pepCount1, preCount1, tranCount2)) { var transitionSettingsUI = ShowDialog <TransitionSettingsUI>(SkylineWindow.ShowTransitionSettingsUI); RunUI(() => { transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.FullScan; transitionSettingsUI.PrecursorIsotopesCurrent = FullScanPrecursorIsotopes.Count; transitionSettingsUI.PrecursorMassAnalyzer = FullScanMassAnalyzerType.tof; transitionSettingsUI.Peaks = 3; transitionSettingsUI.AcquisitionMethod = FullScanAcquisitionMethod.Targeted; transitionSettingsUI.ProductMassAnalyzer = FullScanMassAnalyzerType.tof; }); PauseForScreenShot <TransitionSettingsUI.FullScanTab>("Transition Settings - Full-Scan tab for TOF", 28); RunUI(() => { transitionSettingsUI.RetentionTimeFilterType = RetentionTimeFilterType.none; transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.Filter; transitionSettingsUI.FragmentTypes += ", p"; }); PauseForScreenShot <TransitionSettingsUI.FilterTab>("Transition Settings - Filter tab", 29); OkDialog(transitionSettingsUI, transitionSettingsUI.OkDialog); } var docHighRes = WaitForDocumentChange(document); var tranSettingsHighRes = docHighRes.Settings.TransitionSettings; Assert.AreEqual(FullScanPrecursorIsotopes.Count, tranSettingsHighRes.FullScan.PrecursorIsotopes); Assert.AreEqual(FullScanMassAnalyzerType.tof, tranSettingsHighRes.FullScan.PrecursorMassAnalyzer); Assert.AreEqual(FullScanAcquisitionMethod.Targeted, tranSettingsHighRes.FullScan.AcquisitionMethod); Assert.IsTrue(ArrayUtil.EqualsDeep(new[] { IonType.y, IonType.b, IonType.precursor }, tranSettingsHighRes.Filter.IonTypes)); RunUI(() => SkylineWindow.ExpandPrecursors()); // Assert each peptide contains 3 precursors transitions (unless this is a masses-only small molecule doc). foreach (var nodeGroup in SkylineWindow.Document.MoleculeTransitionGroups) { for (int i = 0; i < nodeGroup.Children.Count; i++) { var nodeTran = (TransitionDocNode)nodeGroup.Children[i]; if (i < ((AsSmallMoleculesTestMode == RefinementSettings.ConvertToSmallMoleculesMode.masses_only) ? 1 : 3)) { Assert.AreEqual(IonType.precursor, nodeTran.Transition.IonType); } else { Assert.AreNotEqual(IonType.precursor, nodeTran.Transition.IonType); } } } RestoreViewOnScreen(30); PauseForScreenShot("Targets View tree clipped from main window", 30); RunDlg <ImportResultsDlg>(SkylineWindow.ImportResults, importResultsDlg2 => { string[] filePaths = { GetTestPath(@"TOF\6-BSA-500fmol" + ExtAgilentRaw) }; importResultsDlg2.NamedPathSets = importResultsDlg2.GetDataSourcePathsFileReplicates(filePaths.Select(MsDataFileUri.Parse)); importResultsDlg2.OkDialog(); }); WaitForDocumentChangeLoaded(docHighRes); if (AsSmallMoleculesTestMode != RefinementSettings.ConvertToSmallMoleculesMode.masses_only) { FindNode(asSmallMolecules ? "LVNELTEFAK" : "K.LVNELTEFAK.T [65, 74]"); } else { FindNode(document.MoleculeTransitionGroups.First().CustomIon.DisplayName); } RunUI(() => { SkylineWindow.CollapsePrecursors(); SkylineWindow.AutoZoomNone(); SkylineWindow.ShowGraphPeakArea(false); SkylineWindow.ShowProductTransitions(); }); RestoreViewOnScreen(31); RunUI(() => SkylineWindow.Width = 1013); PauseForScreenShot("Main window full gradient import of high concentration and Targets tree clipped", 31); { var peptideSettingsUI = ShowDialog <PeptideSettingsUI>(SkylineWindow.ShowPeptideSettingsUI); RunUI(() => { peptideSettingsUI.SelectedTab = PeptideSettingsUI.TABS.Prediction; Assert.IsTrue(peptideSettingsUI.IsUseMeasuredRT); Assert.AreEqual(2.0, peptideSettingsUI.TimeWindow); }); PauseForScreenShot <PeptideSettingsUI.PredictionTab>("Peptide Settings - Prediction tab", 32); OkDialog(peptideSettingsUI, peptideSettingsUI.CancelDialog); } using (new CheckDocumentState(1, pepCount1, preCount1, tranCount2)) { var transitionSettingsUI = ShowDialog <TransitionSettingsUI>(SkylineWindow.ShowTransitionSettingsUI); RunUI(() => { transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.FullScan; transitionSettingsUI.SetRetentionTimeFilter(RetentionTimeFilterType.scheduling_windows, 1); }); PauseForScreenShot <TransitionSettingsUI.FullScanTab>("Transition Settings - Full-Scan tab wtih scheduled extraction", 33); OkDialog(transitionSettingsUI, transitionSettingsUI.OkDialog); } var chooseSchedulingReplicateDlg = ShowDialog <ChooseSchedulingReplicatesDlg>(SkylineWindow.ImportResults); RunUI(() => { // Make sure UI is up to date to avoid race condition chooseSchedulingReplicateDlg.UpdateUi(); chooseSchedulingReplicateDlg.SelectOrDeselectAll(true); }); RunDlg <ImportResultsDlg>(chooseSchedulingReplicateDlg.OkDialog, importResultsDlg2 => { string[] filePaths = { GetTestPath(@"TOF\1-BSA-50amol" + ExtAgilentRaw), GetTestPath(@"TOF\2-BSA-100amol" + ExtAgilentRaw), GetTestPath(@"TOF\3-BSA-1fmol" + ExtAgilentRaw), GetTestPath(@"TOF\4-BSA-10fmol" + ExtAgilentRaw), GetTestPath(@"TOF\5-BSA-100fmol" + ExtAgilentRaw), }; importResultsDlg2.NamedPathSets = importResultsDlg2.GetDataSourcePathsFileReplicates(filePaths.Select(MsDataFileUri.Parse)); importResultsDlg2.OkDialog(); }); //Give the Raw files some time to be processed. WaitForCondition(15 * 60 * 1000, () => SkylineWindow.Document.Settings.HasResults && SkylineWindow.Document.Settings.MeasuredResults.IsLoaded); // 15 minutes WaitForClosedAllChromatogramsGraph(); RunUI(() => SkylineWindow.ShowGraphSpectrum(false)); WaitForGraphs(); TryWaitForConditionUI(() => SkylineWindow.GraphChromatograms.Count(graphChrom => !graphChrom.IsHidden) == 6); RunUI(() => { Assert.IsFalse(SkylineWindow.IsGraphSpectrumVisible); var listGraphs = SkylineWindow.GraphChromatograms.Where(graphChrom => !graphChrom.IsHidden).ToList(); if (listGraphs.Count != 6) { string hiddenGraphs = string.Empty; var listHidden = SkylineWindow.GraphChromatograms.Where(graphChrom => graphChrom.IsHidden).ToList(); if (listHidden.Count != 0) { hiddenGraphs = TextUtil.LineSeparate(string.Empty, "Hidden:", TextUtil.LineSeparate(listHidden.Select(g => g.TabText))); } Assert.Fail(TextUtil.LineSeparate(string.Format("Expecting 6 visible graphs but found {0}", listGraphs.Count), TextUtil.LineSeparate(listGraphs.Select(g => g.TabText)), hiddenGraphs)); } var chromGraphs = SkylineWindow.GraphChromatograms.ToArray(); Assert.AreEqual(6, chromGraphs.Length); }); RunDlg <ManageResultsDlg>(SkylineWindow.ManageResults, dlg => { for (int i = 0; i < 5; i++) { dlg.MoveDown(); } dlg.OkDialog(); }); RunDlg <ArrangeGraphsGroupedDlg>(SkylineWindow.ArrangeGraphsGrouped, dlg => { dlg.Groups = 6; dlg.GroupOrder = GroupGraphsOrder.Document; dlg.OkDialog(); }); WaitForGraphs(); RunUI(() => SkylineWindow.Height = 768); PauseForScreenShot("Chromatogram graphs clipped from main window", 34); RunUI(() => { var graphChrom6 = SkylineWindow.GetGraphChrom("6-BSA-500fmol"); var graphChrom5 = SkylineWindow.GetGraphChrom("5-BSA-100fmol"); var graphChrom4 = SkylineWindow.GetGraphChrom("4-BSA-10fmol"); var graphChrom3 = SkylineWindow.GetGraphChrom("3-BSA-1fmol"); var graphChrom2 = SkylineWindow.GetGraphChrom("2-BSA-100amol"); var graphChrom1 = SkylineWindow.GetGraphChrom("1-BSA-50amol"); Assert.AreEqual(13.3, graphChrom6.BestPeakTime ?? 0, 0.05); Assert.AreEqual(13.5, graphChrom5.BestPeakTime ?? 0, 0.05); Assert.AreEqual(13.6, graphChrom4.BestPeakTime ?? 0, 0.05); Assert.AreEqual(13.6, graphChrom3.BestPeakTime ?? 0, 0.05); Assert.AreEqual(13.6, graphChrom2.BestPeakTime ?? 0, 0.05); Assert.AreEqual(13.6, graphChrom1.BestPeakTime ?? 0, 0.05); }); RunUI(SkylineWindow.AutoZoomBestPeak); WaitForGraphs(); PauseForScreenShot("Chromatogram graphs clipped from main window zoomed", 35); RunUI(() => { SkylineWindow.ShowPeakAreaReplicateComparison(); SkylineWindow.ShowPeptideLogScale(true); }); // p. 28 PauseForScreenShot <GraphSummary.AreaGraphView>("Peak Areas Replicate Comparison graph metafile", 36); WaitForDotProducts(); RunUI(() => { Assert.AreEqual((AsSmallMoleculesTestMode == RefinementSettings.ConvertToSmallMoleculesMode.none) ? 7 : 6, SkylineWindow.GraphPeakArea.Categories.Count()); Assert.AreEqual(6, SkylineWindow.GraphPeakArea.CurveCount); }); VerifyDotProducts(0.87, 0.67, 0.91, 0.90, 0.90, 0.90); RunUI(() => { SkylineWindow.ShowAllTransitions(); SkylineWindow.ShowSplitChromatogramGraph(false); SkylineWindow.ArrangeGraphsTabbed(); SkylineWindow.ActivateReplicate("6-BSA-500fmol"); SkylineWindow.Size = new Size(745, 545); SkylineWindow.ShowGraphPeakArea(false); }); PauseForScreenShot("Chromatogram graph metafile for 500 fmol", 37); RunUI(() => { SkylineWindow.ShowGraphPeakArea(true); SkylineWindow.ShowPrecursorTransitions(); SkylineWindow.ArrangeGraphsTiled(); SkylineWindow.ActivateReplicate("4-BSA-10fmol"); }); WaitForDotProducts(); RunUI(() => { Assert.AreEqual(7, SkylineWindow.GraphPeakArea.Categories.Count()); Assert.AreEqual((AsSmallMoleculesTestMode != RefinementSettings.ConvertToSmallMoleculesMode.masses_only) ? 3 : 1, SkylineWindow.GraphPeakArea.CurveCount); }); VerifyDotProducts(0.99, 0.52, 0.98, 1.00, 1.00, 1.00); RunUI(() => { SkylineWindow.ShowGraphPeakArea(false); SkylineWindow.Size = new Size(1013, 768); }); PauseForScreenShot("Main window", 38); RunUI(SkylineWindow.ShowPeakAreaReplicateComparison); PauseForScreenShot <GraphSummary.AreaGraphView>("Peak Areas Replicate Comparison graph metafile", 39); RunUI(() => SkylineWindow.SaveDocument()); WaitForConditionUI(() => !SkylineWindow.Dirty); }
private void LowResTest() { string documentFile = GetTestPath(@"Low Res\BSA_Protea_label_free_meth3.sky"); WaitForCondition(() => File.Exists(documentFile)); RunUI(() => SkylineWindow.OpenFile(documentFile)); bool AsSmallMolecules = AsSmallMoleculesTestMode != RefinementSettings.ConvertToSmallMoleculesMode.none; const int expectedMoleculeCount = 9; int expectedTransitionGroupCount = 10; int expectedTransitionCount = 78; var document = SkylineWindow.Document; if (AsSmallMolecules) { ConvertDocumentToSmallMolecules(AsSmallMoleculesTestMode); document = SkylineWindow.Document; Assert.AreEqual(document.PeptideTransitionGroupCount, 0); Assert.AreEqual(document.MoleculeTransitionGroupCount, expectedTransitionGroupCount); Assert.AreEqual(document.PeptideTransitionCount, 0); Assert.AreEqual(document.MoleculeTransitionCount, expectedTransitionCount); } AssertEx.IsDocumentState(document, null, 3, expectedMoleculeCount, expectedTransitionGroupCount, expectedTransitionCount); // p. 3 Select first peptide RunUI(() => SkylineWindow.SelectedPath = document.GetPathTo((int)SrmDocument.Level.Molecules, 0)); PauseForScreenShot("Main window", 3); // p. 4 Configure Document for Thermo raw files { var transitionSettingsUI = ShowDialog <TransitionSettingsUI>(SkylineWindow.ShowTransitionSettingsUI); RunUI(() => transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.FullScan); PauseForScreenShot <TransitionSettingsUI.FullScanTab>("Peptide Settings - Full-Scan tab blank", 5); RunUI(() => { transitionSettingsUI.PrecursorIsotopesCurrent = FullScanPrecursorIsotopes.Count; transitionSettingsUI.PrecursorMassAnalyzer = FullScanMassAnalyzerType.qit; transitionSettingsUI.AcquisitionMethod = FullScanAcquisitionMethod.Targeted; }); PauseForScreenShot <TransitionSettingsUI.FullScanTab>("Peptide Settings - Full-Scan tab low res", 6); RunUI(() => { transitionSettingsUI.SetRetentionTimeFilter(RetentionTimeFilterType.ms2_ids, 2); // p.6 - library ion match tolerance same as extraction window transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.Library; transitionSettingsUI.IonMatchTolerance = 0.7; }); PauseForScreenShot <TransitionSettingsUI.LibraryTab>("Transition Settings - Library tab match tolerance same as MS/MS resolution", 8); RunUI(() => { // p.6 transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.Filter; transitionSettingsUI.FragmentTypes += ", p"; }); PauseForScreenShot <TransitionSettingsUI.FilterTab>("Transition Settings - Filter tab", 9); OkDialog(transitionSettingsUI, transitionSettingsUI.OkDialog); var docFullScan = WaitForDocumentChange(document); var tranSettingsFullScan = docFullScan.Settings.TransitionSettings; Assert.AreEqual(FullScanPrecursorIsotopes.Count, tranSettingsFullScan.FullScan.PrecursorIsotopes); Assert.AreEqual(FullScanMassAnalyzerType.qit, tranSettingsFullScan.FullScan.PrecursorMassAnalyzer); Assert.AreEqual(FullScanAcquisitionMethod.Targeted, tranSettingsFullScan.FullScan.AcquisitionMethod); Assert.IsTrue(ArrayUtil.EqualsDeep(new[] { IonType.y, IonType.b, IonType.precursor }, tranSettingsFullScan.Filter.IonTypes)); } RunUI(() => SkylineWindow.ExpandPrecursors()); // Check all the precursors on picklists bool pausedForScreenShot = false; foreach (PeptideGroupTreeNode node in SkylineWindow.SequenceTree.GetSequenceNodes()) { foreach (TreeNode child in node.Nodes) { foreach (SrmTreeNodeParent grandChild in child.Nodes) { // Because of RunUI must copy to local variable first. SrmTreeNodeParent child1 = grandChild; RunUI(() => SkylineWindow.SequenceTree.SelectedNode = child1); var picklist = ShowDialog <PopupPickList>(() => SkylineWindow.SequenceTree.ShowPickList(false)); RunUI(() => { picklist.SetItemChecked(0, true); Assert.IsTrue(picklist.GetItemLabel(0).Contains(IonType.precursor.GetLocalizedString())); Assert.IsTrue(picklist.GetItemChecked(0)); }); if (!pausedForScreenShot) { PauseForScreenShot <PopupPickList>("Transitions popup pick-list", 10); pausedForScreenShot = true; } OkDialog(picklist, picklist.OnOk); } } } WaitForDocumentLoaded(); if (!AsSmallMolecules) // No libraries for small molecules, yet { foreach (var nodeGroup in SkylineWindow.Document.MoleculeTransitionGroups) { Assert.IsFalse(nodeGroup.HasLibInfo && nodeGroup.Transitions.All(nodeTran => !nodeTran.HasLibInfo)); } } // All transition groups should now have a precursor transition foreach (var nodeGroup in SkylineWindow.Document.MoleculeTransitionGroups) { Assert.AreEqual(IonType.precursor, nodeGroup.Transitions.First().Transition.IonType); } // p.8 ExportMethodDlg exportMethodDlg = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.Method)); RunUI(() => { exportMethodDlg.SetInstrument("Thermo LTQ"); Assert.AreEqual("Thermo LTQ", exportMethodDlg.InstrumentType); exportMethodDlg.SetMethodType(ExportMethodType.Standard); exportMethodDlg.SetTemplateFile(GetTestPath(@"Low Res\TargetedMSMS_template.meth")); }); PauseForScreenShot <ExportMethodDlg.MethodView>("Export Method form", 11); // p. 10 Ok the error box. { var messageDlg = ShowDialog <MessageDlg>(() => exportMethodDlg.OkDialog(GetTestPath(@"Low Res\TargetedMSMS_BSA_Protea.meth"))); PauseForScreenShot <MessageDlg>("Error message (expected)", 12); OkDialog(messageDlg, messageDlg.OkDialog); } // Making a report by hand p.11 ExportLiveReportDlg exportReportDlg = ShowDialog <ExportLiveReportDlg>(() => SkylineWindow.ShowExportReportDialog()); var editReportListDlg = ShowDialog <ManageViewsForm>(exportReportDlg.EditList); var viewEditor = ShowDialog <ViewEditor>(editReportListDlg.AddView); RunUI(() => { Assert.IsTrue(viewEditor.ChooseColumnsTab.TrySelect(PropertyPath.Parse("Proteins!*.Name"))); viewEditor.ChooseColumnsTab.AddSelectedColumn(); Assert.AreEqual(1, viewEditor.ChooseColumnsTab.ColumnCount); var columnsToAdd = new[] { PropertyPath.Parse("Proteins!*.Peptides!*.Precursors!*.ModifiedSequence"), PropertyPath.Parse("Proteins!*.Peptides!*.Precursors!*.Charge"), PropertyPath.Parse("Proteins!*.Peptides!*.Precursors!*.Mz"), }; foreach (var id in columnsToAdd) { Assert.IsTrue(viewEditor.ChooseColumnsTab.TrySelect(id), "Unable to select {0}", id); viewEditor.ChooseColumnsTab.AddSelectedColumn(); } Assert.AreEqual(4, viewEditor.ChooseColumnsTab.ColumnCount); }); PauseForScreenShot <ViewEditor>("Edit Report form", 13); { var previewReportDlg = ShowDialog <DocumentGridForm>(viewEditor.ShowPreview); var expectedRows = 10 + (TestSmallMolecules ? 1 : 0); WaitForConditionUI(() => previewReportDlg.IsComplete && previewReportDlg.RowCount == expectedRows); RunUI(() => { Assert.AreEqual(4, previewReportDlg.ColumnCount); var precursors = SkylineWindow.Document.MoleculeTransitionGroups.ToArray(); const int precursorIndex = 3; for (int i = 0; i < expectedRows; i++) { Assert.AreEqual(precursors[i].PrecursorMz, double.Parse(previewReportDlg.DataGridView.Rows[i].Cells[precursorIndex].Value.ToString()), 0.000001); } var precursorMzCol = previewReportDlg.DataGridView.Columns[precursorIndex]; Assert.IsNotNull(precursorMzCol); previewReportDlg.DataGridView.Sort(precursorMzCol, ListSortDirection.Ascending); }); PauseForScreenShot <DocumentGridForm>("Preview New Report window", 14); OkDialog(previewReportDlg, previewReportDlg.Close); } // Press the Esc key until all forms have been dismissed. RunUI(() => { viewEditor.Close(); editReportListDlg.Close(); exportReportDlg.CancelClick(); }); WaitForClosedForm(viewEditor); WaitForClosedForm(editReportListDlg); WaitForClosedForm(exportReportDlg); //p. 12 Import Full-Scan Data // Launch import peptide search wizard var importPeptideSearchDlg = ShowDialog <ImportPeptideSearchDlg>(SkylineWindow.ShowImportPeptideSearchDlg); RunUI(() => importPeptideSearchDlg.BuildPepSearchLibControl.WorkflowType = ImportPeptideSearchDlg.Workflow.prm); PauseForScreenShot <ImportPeptideSearchDlg.SpectraPage>("Import Peptide Search Build Spectral Library blank page", 15); const int prefixLen = 35; const string lowResDir = "Low Res"; const string searchDir = "search"; const string lowRes20Base = "klc_20100329v_Protea_Peptide_Curve_20fmol_uL_tech1"; string lowRes20File = GetTestPath(Path.Combine(lowResDir, lowRes20Base + ExtThermoRaw)); string lowRes20FileRaw = Path.ChangeExtension(lowRes20File, ExtThermoRaw); string lowRes20Search = GetTestPath(Path.Combine(lowResDir, Path.Combine(searchDir, lowRes20Base + BiblioSpecLiteBuilder.EXT_PERCOLATOR))); string shortLowRes20FileName = (Path.GetFileNameWithoutExtension(lowRes20File) ?? "").Substring(prefixLen); const string lowRes80Base = "klc_20100329v_Protea_Peptide_Curve_80fmol_uL_tech1"; string lowRes80File = GetTestPath(Path.Combine(lowResDir, lowRes80Base + ExtThermoRaw)); string lowRes80Search = GetTestPath(Path.Combine(lowResDir, Path.Combine(searchDir, lowRes80Base + BiblioSpecLiteBuilder.EXT_PERCOLATOR))); string shortLowRes80FileName = (Path.GetFileNameWithoutExtension(lowRes80File) ?? "").Substring(prefixLen); string[] searchFiles = { lowRes20Search, lowRes80Search }; var doc = SkylineWindow.Document; RunUI(() => { Assert.IsTrue(importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.spectra_page); importPeptideSearchDlg.BuildPepSearchLibControl.AddSearchFiles(searchFiles); importPeptideSearchDlg.BuildPepSearchLibControl.CutOffScore = 0.99; importPeptideSearchDlg.BuildPepSearchLibControl.FilterForDocumentPeptides = true; }); PauseForScreenShot <ImportPeptideSearchDlg.SpectraPage>("Import Peptide Search Build Spectral Library with files page", 16); RunDlg <MessageDlg>(importPeptideSearchDlg.ClickNextButtonNoCheck, dlg => dlg.OkDialog()); doc = WaitForDocumentChangeLoaded(doc); // Verify document library was built string docLibPath = BiblioSpecLiteSpec.GetLibraryFileName(documentFile); string redundantDocLibPath = BiblioSpecLiteSpec.GetRedundantName(docLibPath); Assert.IsTrue(File.Exists(docLibPath) && File.Exists(redundantDocLibPath)); var librarySettings = SkylineWindow.Document.Settings.PeptideSettings.Libraries; Assert.IsTrue(librarySettings.HasDocumentLibrary); PauseForScreenShot <ImportPeptideSearchDlg.ChromatogramsPage>("Import Peptide Search Extract Chromatograms page", 17); // We're on the "Extract Chromatograms" page of the wizard. // All the test results files are in the same directory as the // document file, so all the files should be found, and we should // just be able to move to the next page. TryWaitForConditionUI(() => importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.chromatograms_page); var correctPage = false; ImportPeptideSearchDlg.Pages currentPage = 0; RunUI(() => correctPage = ImportPeptideSearchDlg.Pages.chromatograms_page == (currentPage = importPeptideSearchDlg.CurrentPage)); if (!correctPage) { WaitForConditionUI(1, // Immediate timeout - just want the richer error message that WaitForConditionUI provides () => importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.chromatograms_page, string.Format("Expected to be on chromatograms_page, on {0} instead", currentPage)); } var importResultsNameDlg = ShowDialog <ImportResultsNameDlg>(() => importPeptideSearchDlg.ClickNextButton()); OkDialog(importResultsNameDlg, importResultsNameDlg.YesDialog); // Modifications are already set up, so that page should get skipped. // We're on the "Configure Transition Settings" page of the wizard. // We've already set up these settings, so just click next. WaitForConditionUI(() => importPeptideSearchDlg.IsNextButtonEnabled); RunUI(() => { Assert.IsTrue(importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.transition_settings_page); Assert.IsTrue(importPeptideSearchDlg.ClickNextButton()); }); // We're on the "Configure Full-Scan Settings" page of the wizard. // We've already set up these settings, so just click next. WaitForConditionUI(() => importPeptideSearchDlg.IsNextButtonEnabled); RunUI(() => { Assert.IsTrue(importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.full_scan_settings_page); Assert.IsTrue(importPeptideSearchDlg.ClickNextButton()); }); doc = WaitForDocumentChange(doc); // Add FASTA also skipped because filter for document peptides was chosen. WaitForClosedForm(importPeptideSearchDlg); PauseForScreenShot <AllChromatogramsGraph>("Loading chromatograms window", 18); WaitForDocumentChangeLoaded(doc, 15 * 60 * 1000); // 15 minutes WaitForClosedAllChromatogramsGraph(); expectedTransitionGroupCount = 10; // Expect this many with results expectedTransitionCount = 87; // Expect this many with results AssertResult.IsDocumentResultsState(SkylineWindow.Document, shortLowRes20FileName, expectedMoleculeCount, expectedTransitionGroupCount, 0, expectedTransitionCount, 0); AssertResult.IsDocumentResultsState(SkylineWindow.Document, shortLowRes80FileName, expectedMoleculeCount, expectedTransitionGroupCount, 0, expectedTransitionCount, 0); RunUI(() => { Assert.IsTrue(SkylineWindow.IsGraphSpectrumVisible); SkylineWindow.ArrangeGraphsTiled(); SkylineWindow.CollapsePrecursors(); SkylineWindow.Width = 1070; }); // Select the first precursor. if (AsSmallMoleculesTestMode != RefinementSettings.ConvertToSmallMoleculesMode.masses_only) { FindNode(AsSmallMolecules ? "LVNELTEFAK" : "K.LVNELTEFAK.T [65, 74]"); } else { FindNode(document.MoleculeTransitionGroups.First().CustomIon.DisplayName); } // Ensure Graphs look like p17. (checked) WaitForGraphs(); RestoreViewOnScreen(18); PauseForScreenShot("Main window with data imported", 19); const double minDotp = 0.9; foreach (var nodeGroup in SkylineWindow.Document.PeptideTransitionGroups) { double dotp = nodeGroup.Results[0][0].LibraryDotProduct ?? 0; Assert.IsTrue(Math.Round(dotp, 2) >= minDotp, string.Format("Library dot-product {0} found below {1}", dotp, minDotp)); } RunUI(() => SkylineWindow.AutoZoomBestPeak()); // Ensure Graphs look like p18. (checked) WaitForGraphs(); PauseForScreenShot("Chromatogram graphs clipped from main window with zoomed peaks", 20); RestoreViewOnScreen(21); RunUI(() => SkylineWindow.GraphSpectrum.SelectSpectrum(new SpectrumIdentifier(lowRes20FileRaw, 77.7722))); PauseForScreenShot <GraphSpectrum>("Library Match view clipped from main window with noisy spectrum", 21); RunUI(() => { SkylineWindow.ShowGraphSpectrum(false); Assert.IsFalse(SkylineWindow.IsGraphSpectrumVisible); SkylineWindow.ShowPeptideIDTimes(false); }); RunUI(() => { var chromGraphs = SkylineWindow.GraphChromatograms.ToArray(); Assert.AreEqual(2, chromGraphs.Length); Assert.AreEqual(46.8, chromGraphs[0].GraphItems.First().BestPeakTime, 0.05); Assert.AreEqual(46.8, chromGraphs[1].GraphItems.First().BestPeakTime, 0.05); SkylineWindow.ShowPeakAreaReplicateComparison(); SkylineWindow.ShowProductTransitions(); }); WaitForCondition(() => !SkylineWindow.GraphPeakArea.IsHidden); if (!AsSmallMolecules) // No libraries (yet?) { WaitForDotProducts(); } RunUI(() => { // Graph p.15 Assert.AreEqual(AsSmallMolecules ? 2 : 3, SkylineWindow.GraphPeakArea.Categories.Count()); Assert.AreEqual(6, SkylineWindow.GraphPeakArea.CurveCount); }); PauseForScreenShot <GraphSummary.AreaGraphView>("Peak Areas Replicate Comparison graph metafile", 22); if (!AsSmallMolecules) // No libraries (yet?) { VerifyDotProducts(0.99, 0.98); } // Check graph p15. (checked) RunUI(() => { SkylineWindow.ShowAllTransitions(); SkylineWindow.ShowSplitChromatogramGraph(true); }); // p. 16 screenshot of full 5-point dilution curve // Select precursor if (AsSmallMoleculesTestMode != RefinementSettings.ConvertToSmallMoleculesMode.masses_only) { FindNode(AsSmallMolecules ? "DRVYIHPF" : "R.DRVYIHPF.- [34, 41]"); // May be localized " (missed 1)" } else { FindNode(Resources.CustomIon_DisplayName_Ion + " [1047"); } WaitForGraphs(); PauseForScreenShot <GraphSummary.AreaGraphView>("Peak Areas Replicate Comparison graph metafile with split graphs", 24); RunUI(() => { SkylineWindow.Size = new Size(990, 620); SkylineWindow.ShowGraphPeakArea(false); }); PauseForScreenShot("Chromatogram graphs clipped from main window with split graphs", 25); // PeakAreaGraph Normalize to total p.20. RunUI(() => { SkylineWindow.ShowGraphPeakArea(true); SkylineWindow.ShowProductTransitions(); SkylineWindow.NormalizeAreaGraphTo(AreaNormalizeToView.area_percent_view); }); // Ensure graph looks like p20. if (AsSmallMoleculesTestMode != RefinementSettings.ConvertToSmallMoleculesMode.masses_only) { FindNode(AsSmallMolecules ? "KNLQSLDPSH" : "R.IKNLQSLDPSH.- [80, 90]"); FindNode(AsSmallMolecules ? "KNLQSLDPSH" : "R.IKNLQSLDPSH.- [80, 90]"); // Phosphorylated } else { FindNode(Resources.CustomIon_DisplayName_Ion + " [1333"); } WaitForGraphs(); PauseForScreenShot <GraphSummary.AreaGraphView>("figure 1a - Area Replicate graph metafile for IKNLQSLDPSH", 26); RunUI(() => { Assert.AreEqual(AsSmallMolecules ? 2 : 3, SkylineWindow.GraphPeakArea.Categories.Count()); Assert.AreEqual(9, SkylineWindow.GraphPeakArea.CurveCount); }); if (AsSmallMoleculesTestMode != RefinementSettings.ConvertToSmallMoleculesMode.masses_only) { FindNode(AsSmallMolecules ? "HLVDEPQNLIK" : "K.HLVDEPQNLIK.Q [401, 411]"); } else { FindNode(Resources.CustomIon_DisplayName_Ion + " [1306"); } WaitForGraphs(); PauseForScreenShot("figure 1b - Area replicate graph metafile for HLVDEPQNLIK", 26); RunUI(() => { Assert.AreEqual(AsSmallMolecules ? 2 : 3, SkylineWindow.GraphPeakArea.Categories.Count()); Assert.AreEqual(7, SkylineWindow.GraphPeakArea.CurveCount); }); RunUI(() => SkylineWindow.ShowGraphPeakArea(false)); WaitForCondition(() => SkylineWindow.GraphPeakArea.IsHidden); RunUI(() => SkylineWindow.SaveDocument()); }
protected override void DoTest() { var folderAbsoluteQuant = UseRawFiles ? "AbsoluteQuant" : "AbsoluteQuantMzml"; // Generating a Transition List, p. 4 { var doc = SkylineWindow.Document; var transitionSettingsUI = ShowDialog <TransitionSettingsUI>(SkylineWindow.ShowTransitionSettingsUI); RunUI(() => { // Predicition Settings transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.Prediction; transitionSettingsUI.PrecursorMassType = MassType.Monoisotopic; transitionSettingsUI.FragmentMassType = MassType.Monoisotopic; transitionSettingsUI.RegressionCEName = "Thermo TSQ Vantage"; transitionSettingsUI.RegressionDPName = Resources.SettingsList_ELEMENT_NONE_None; }); PauseForScreenShot <TransitionSettingsUI.PredictionTab>("Transition Settings - Prediction tab", 4); RunUI(() => { // Filter Settings transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.Filter; transitionSettingsUI.PrecursorCharges = "2"; transitionSettingsUI.ProductCharges = "1"; transitionSettingsUI.FragmentTypes = "y"; transitionSettingsUI.RangeFrom = Resources.TransitionFilter_FragmentStartFinders_ion_3; transitionSettingsUI.RangeTo = Resources.TransitionFilter_FragmentEndFinders_last_ion_minus_1; transitionSettingsUI.SpecialIons = new string[0]; }); PauseForScreenShot <TransitionSettingsUI.FilterTab>("Transition Settings - Filter tab", 4); OkDialog(transitionSettingsUI, transitionSettingsUI.OkDialog); WaitForDocumentChange(doc); } // Configuring Peptide settings p. 4 PeptideSettingsUI peptideSettingsUI = ShowDialog <PeptideSettingsUI>(SkylineWindow.ShowPeptideSettingsUI); RunUI(() => peptideSettingsUI.SelectedTab = PeptideSettingsUI.TABS.Modifications); PauseForScreenShot <PeptideSettingsUI.ModificationsTab>("Peptide Settings - Modification tab", 5); var modHeavyK = new StaticMod("Label:13C(6)15N(2) (C-term K)", "K", ModTerminus.C, false, null, LabelAtoms.C13 | LabelAtoms.N15, RelativeRT.Matching, null, null, null); AddHeavyMod(modHeavyK, peptideSettingsUI, "Edit Isotope Modification over Transition Settings", 5); RunUI(() => peptideSettingsUI.PickedHeavyMods = new[] { modHeavyK.Name }); PauseForScreenShot <PeptideSettingsUI.ModificationsTab>("Peptide Settings - Modification tab with mod added", 5); OkDialog(peptideSettingsUI, peptideSettingsUI.OkDialog); // Inserting a peptide sequence p. 5 using (new CheckDocumentState(1, 1, 2, 10)) { RunUI(() => SetClipboardText("IEAIPQIDK\tGST-tag")); var pasteDlg = ShowDialog <PasteDlg>(SkylineWindow.ShowPastePeptidesDlg); RunUI(pasteDlg.PastePeptides); WaitForProteinMetadataBackgroundLoaderCompletedUI(); PauseForScreenShot <PasteDlg.PeptideListTab>("Insert Peptide List", 6); OkDialog(pasteDlg, pasteDlg.OkDialog); } RunUI(SkylineWindow.ExpandPrecursors); RunUI(() => SkylineWindow.SaveDocument(TestFilesDir.GetTestPath(folderAbsoluteQuant + @"test_file.sky"))); WaitForCondition(() => File.Exists(TestFilesDir.GetTestPath(folderAbsoluteQuant + @"test_file.sky"))); PauseForScreenShot("Main window with Targets view", 6); // Exporting a transition list p. 6 { var exportMethodDlg = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.List)); RunUI(() => { exportMethodDlg.InstrumentType = ExportInstrumentType.THERMO; exportMethodDlg.ExportStrategy = ExportStrategy.Single; exportMethodDlg.OptimizeType = ExportOptimize.NONE; exportMethodDlg.MethodType = ExportMethodType.Standard; }); PauseForScreenShot <ExportMethodDlg.TransitionListView>("Export Transition List", 7); OkDialog(exportMethodDlg, () => exportMethodDlg.OkDialog(TestFilesDir.GetTestPath("Quant_Abs_Thermo_TSQ_Vantage.csv"))); } // Importing RAW files into Skyline p. 7 var importResultsDlg = ShowDialog <ImportResultsDlg>(SkylineWindow.ImportResults); PauseForScreenShot <ImportResultsDlg>("Import Results - click OK to get shot of Import Results Files and then cancel", 8); RunUI(() => { var rawFiles = DataSourceUtil.GetDataSources(TestFilesDirs[0].FullPath).First().Value.Skip(1); var namedPathSets = from rawFile in rawFiles select new KeyValuePair <string, MsDataFileUri[]>( rawFile.GetFileNameWithoutExtension(), new[] { rawFile }); importResultsDlg.NamedPathSets = namedPathSets.ToArray(); }); RunDlg <ImportResultsNameDlg>(importResultsDlg.OkDialog, importResultsNameDlg => importResultsNameDlg.NoDialog()); WaitForGraphs(); RunUI(() => { SkylineWindow.SelectedPath = SkylineWindow.Document.GetPathTo((int)SrmDocument.Level.Molecules, 0); Settings.Default.ArrangeGraphsOrder = GroupGraphsOrder.Document.ToString(); Settings.Default.ArrangeGraphsReversed = false; SkylineWindow.ArrangeGraphsTiled(); SkylineWindow.AutoZoomBestPeak(); }); WaitForCondition(() => Equals(8, SkylineWindow.GraphChromatograms.Count(graphChrom => !graphChrom.IsHidden)), "unexpected visible graphChromatogram count"); WaitForCondition(10 * 60 * 1000, // ten minutes () => SkylineWindow.Document.Settings.HasResults && SkylineWindow.Document.Settings.MeasuredResults.IsLoaded); PauseForScreenShot("Main window with imported data", 9); // Analyzing SRM Data from FOXN1-GST Sample p. 9 RunDlg <ImportResultsDlg>(SkylineWindow.ImportResults, importResultsDlg1 => { var rawFiles = DataSourceUtil.GetDataSources(TestFilesDirs[0].FullPath).First().Value.Take(1); var namedPathSets = from rawFile in rawFiles select new KeyValuePair <string, MsDataFileUri[]>( rawFile.GetFileNameWithoutExtension(), new[] { rawFile }); importResultsDlg1.NamedPathSets = namedPathSets.ToArray(); importResultsDlg1.OkDialog(); }); WaitForGraphs(); CheckReportCompatibility.CheckAll(SkylineWindow.Document); WaitForCondition(5 * 60 * 1000, // five minutes () => SkylineWindow.Document.Settings.HasResults && SkylineWindow.Document.Settings.MeasuredResults.IsLoaded); RunUI(() => { SkylineWindow.ToggleIntegrateAll(); SkylineWindow.ArrangeGraphsTabbed(); SkylineWindow.ShowRTReplicateGraph(); SkylineWindow.ShowPeakAreaReplicateComparison(); // Total normalization SkylineWindow.NormalizeAreaGraphTo(AreaNormalizeToView.area_percent_view); }); RunUI(() => SkylineWindow.ActivateReplicate("FOXN1-GST")); WaitForGraphs(); RunUI(() => SkylineWindow.SelectedPath = SkylineWindow.DocumentUI.GetPathTo((int)SrmDocument.Level.TransitionGroups, 0)); WaitForGraphs(); RunUI(() => { Assert.AreEqual(SkylineWindow.SelectedResultsIndex, SkylineWindow.GraphPeakArea.ResultsIndex); Assert.AreEqual(SkylineWindow.SelectedResultsIndex, SkylineWindow.GraphRetentionTime.ResultsIndex); }); RunUI(() => { int transitionCount = SkylineWindow.DocumentUI.PeptideTransitionGroups.First().TransitionCount; CheckGstGraphs(transitionCount, transitionCount); }); PauseForScreenShot("Main window with Peak Areas, Retention Times and FOXN1-GST for light", 10); RunUI(() => SkylineWindow.SelectedPath = SkylineWindow.DocumentUI.GetPathTo((int)SrmDocument.Level.TransitionGroups, 1)); WaitForGraphs(); RunUI(() => { int transitionCount = SkylineWindow.DocumentUI.PeptideTransitionGroups.ToArray()[1].TransitionCount; CheckGstGraphs(transitionCount, transitionCount); }); PauseForScreenShot("Main window with Peak Areas, Retention Times and FOXN1-GST for heavy", 10); RunUI(() => SkylineWindow.SelectedPath = SkylineWindow.DocumentUI.GetPathTo((int)SrmDocument.Level.Molecules, 0)); WaitForGraphs(); // Heavy normalization RunUI(() => SkylineWindow.NormalizeAreaGraphTo(AreaNormalizeToView.area_ratio_view)); WaitForGraphs(); RunUI(() => { int transitionGroupCount = SkylineWindow.DocumentUI.Peptides.First().TransitionGroupCount; CheckGstGraphs(transitionGroupCount, transitionGroupCount - 1); }); PauseForScreenShot("Main window with totals graphs for light and heavy and FOXN1-GST", 11); const int columnsToAddCount = 4; var columnSeparator = TextUtil.CsvSeparator; // Generating a Calibration Curve p. 11 var exportLiveReportDlg = ShowDialog <ExportLiveReportDlg>(SkylineWindow.ShowExportReportDialog); var editReportListDlg = ShowDialog <ManageViewsForm>(exportLiveReportDlg.EditList); const string reportName = "Peptide Ratio Results Test"; var columnsToAdd = new[] { PropertyPath.Parse("Proteins!*.Peptides!*.Sequence"), PropertyPath.Parse("Proteins!*.Name"), PropertyPath.Parse("Replicates!*.Name"), PropertyPath.Parse("Proteins!*.Peptides!*.Results!*.Value.RatioToStandard"), }; Assert.AreEqual(columnsToAddCount, columnsToAdd.Length); { var viewEditor = ShowDialog <ViewEditor>(editReportListDlg.AddView); RunUI(() => { viewEditor.ViewName = reportName; foreach (var id in columnsToAdd) { Assert.IsTrue(viewEditor.ChooseColumnsTab.TrySelect(id), "Unable to select {0}", id); viewEditor.ChooseColumnsTab.AddSelectedColumn(); } Assert.AreEqual(columnsToAdd.Length, viewEditor.ChooseColumnsTab.ColumnCount); }); // TODO: MultiViewProvider not yet supported in Common PauseForScreenShot <ViewEditor>("Edit Report form", 12); OkDialog(viewEditor, viewEditor.OkDialog); } RunUI(editReportListDlg.OkDialog); WaitForClosedForm(editReportListDlg); RunUI(() => { exportLiveReportDlg.ReportName = reportName; exportLiveReportDlg.OkDialog(TestFilesDir.GetTestPath("Calibration.csv"), columnSeparator); }); // Check if export file is correct. string filePath = TestFilesDir.GetTestPath("Calibration.csv"); Assert.IsTrue(File.Exists(filePath)); string[] lines = File.ReadAllLines(filePath); string[] line0 = lines[0].Split(columnSeparator); int count = line0.Length; Assert.IsTrue(lines.Count() == SkylineWindow.Document.Settings.MeasuredResults.Chromatograms.Count + 1); Assert.AreEqual(columnsToAddCount, count); // Check export file data double ratio1 = Double.Parse(lines[1].Split(new[] { columnSeparator }, 4)[3]); double ratio2 = Double.Parse(lines[2].Split(new[] { columnSeparator }, 4)[3]); double ratio3 = Double.Parse(lines[3].Split(new[] { columnSeparator }, 4)[3]); double ratio4 = Double.Parse(lines[4].Split(new[] { columnSeparator }, 4)[3]); double ratio5 = Double.Parse(lines[5].Split(new[] { columnSeparator }, 4)[3]); double ratio6 = Double.Parse(lines[6].Split(new[] { columnSeparator }, 4)[3]); double ratio7 = Double.Parse(lines[7].Split(new[] { columnSeparator }, 4)[3]); double ratio8 = Double.Parse(lines[8].Split(new[] { columnSeparator }, 4)[3]); double ratio9 = Double.Parse(lines[9].Split(new[] { columnSeparator }, 4)[3]); Assert.AreEqual(21.4513, ratio1, 0.1); Assert.AreEqual(6.2568, ratio2, 0.1); Assert.AreEqual(2.0417, ratio3, 0.1); Assert.AreEqual(0.8244, ratio4, 0.1); Assert.AreEqual(0.2809, ratio5, 0.1); Assert.AreEqual(0.1156, ratio6, 0.1); Assert.AreEqual(0.0819, ratio7, 0.1); Assert.AreEqual(0.0248, ratio8, 0.1); Assert.AreEqual(0.7079, ratio9, 0.1); CheckReportCompatibility.CheckAll(SkylineWindow.Document); }
protected override void DoTest() { var testFilesDir = TestFilesDir; var skyFile = "test_b.sky"; var basename = "289_97"; var sourceData = TestFilesDir.GetTestPath(basename + ExtensionTestContext.ExtMzml); string docPath; var doc = InitHighReplicateCountDocument(testFilesDir, skyFile, out docPath); Settings.Default.ImportResultsSimultaneousFiles = (int)MultiFileLoader.ImportResultsSimultaneousFileOptions .many; // use maximum threads for multiple file import var listChromatograms = new List <ChromatogramSet>(); var filenames = new List <string>(); var TOO_MANY_FILES = Skyline.SkylineWindow.MAX_GRAPH_CHROM * 2; int count; for (count = 0; count < TOO_MANY_FILES; count++) { var fname = TestFilesDir.GetTestPath(GetReplicateNameFromIndex(count)); filenames.Add(fname); if (count != Skyline.SkylineWindow.MAX_GRAPH_CHROM) { File.Copy(sourceData, fname); } var path = MsDataFileUri.Parse(fname); listChromatograms.Add(AssertResult.FindChromatogramSet(doc, path) ?? new ChromatogramSet(path.GetFileName().Replace('.', '_'), new[] { path })); } var docResults = doc.ChangeMeasuredResults(new MeasuredResults(listChromatograms)); Assert.IsTrue(SkylineWindow.SetDocument(docResults, doc)); var document = WaitForDocumentLoaded(); float tolerance = (float)document.Settings.TransitionSettings.Instrument.MzMatchTolerance; foreach (var pair in document.MoleculePrecursorPairs) { for (var f = 0; f < filenames.Count; f++) { ChromatogramGroupInfo[] chromGroupInfo; Assert.IsTrue(document.Settings.MeasuredResults.TryLoadChromatogram(f, pair.NodePep, pair.NodeGroup, tolerance, true, out chromGroupInfo)); } } WaitForClosedAllChromatogramsGraph(); // We expect 0th display to be R0, then as we move on to high undisplayed chromatograms we expect r0 to be replaced with R100, R1 with R101 etc var graphChromatograms = SkylineWindow.GraphChromatograms.ToList(); Assert.IsTrue(graphChromatograms.Any(g => g.NameSet.Equals("R0_mzML"))); var oldest = graphChromatograms[0].NameSet; var newest = "distinct_mzML"; // This replicate should have a different peak Assert.IsFalse(graphChromatograms.Any(g => g.NameSet.Equals(newest))); // Now select a graph not currently displayed RunUI(() => SkylineWindow.SelectedResultsIndex = Skyline.SkylineWindow.MAX_GRAPH_CHROM); WaitForGraphs(); graphChromatograms = SkylineWindow.GraphChromatograms.ToList(); Assert.IsFalse(graphChromatograms.Any(g => g.NameSet.Equals(oldest))); Assert.IsTrue(graphChromatograms.Any(g => g.NameSet.Equals(newest))); RunUI(() => SkylineWindow.ArrangeGraphsTiled()); // Arrange so that all are fully visible, so we can use .Visible in test below // Now close all, then open them back up again with ctrl-up/ctrl-down hotkeys, and verify that we see the ones we expect RunUI(() => SkylineWindow.CloseAllChromatograms()); WaitForClosedAllChromatogramsGraph(); // Now run through the replicates for (count = 0; count < TOO_MANY_FILES; count++) { RunUI(() => SkylineWindow.SelectedResultsIndex = count); var name = GetReplicateNameFromIndex(count).Replace(@".", @"_"); WaitForConditionUI(() => SkylineWindow.GraphChromatograms.Any(g => g.NameSet.Equals(name) && g.Visible)); graphChromatograms = SkylineWindow.GraphChromatograms.ToList(); for (var index = 0; index < TOO_MANY_FILES; index++) { name = GetReplicateNameFromIndex(index).Replace(@".", @"_"); var visible = graphChromatograms.Any(g => g.NameSet.Equals(name) && g.Visible); var shouldBeVisible = (index > count - Skyline.SkylineWindow.MAX_GRAPH_CHROM) && (index <= count); Assert.IsTrue(visible == shouldBeVisible); if (shouldBeVisible) { // Make sure it's showing the right data Assert.IsTrue(graphChromatograms.First(g => g.NameSet.Equals(name)).FilePath.ToString().Contains(GetReplicateNameFromIndex(index))); } } } }