protected override void DoTest() { // Formerly this little .sky file would not update its (unsearchable) protein metdata on load RunUI(() => SkylineWindow.OpenFile(TestFilesDir.GetTestPath("Mutant Peptides with Braf AG A00Y - Cut Down.sky"))); var doc = WaitForDocumentLoaded(); var nodeProt = doc.MoleculeGroups.First(); var metadata = nodeProt.ProteinMetadata; Assert.IsFalse(metadata.NeedsSearch()); RunUI(() => SkylineWindow.OpenFile(TestFilesDir.GetTestPath("ProteinMetadataFunctionalTests.sky"))); doc = WaitForDocumentLoaded(); nodeProt = doc.MoleculeGroups.First(); metadata = nodeProt.ProteinMetadata; // Examine the various View | Targets | By* modes foreach (ProteinMetadataManager.ProteinDisplayMode mode in Enum.GetValues(typeof(ProteinMetadataManager.ProteinDisplayMode))) { ProteinMetadataManager.ProteinDisplayMode arg = mode; RunUI(() => SkylineWindow.UpdateTargetsDisplayMode(arg)); // This should alter the text displayed by the node in the sequence tree view WaitForConditionUI(() => { var displayText = SkylineWindow.SequenceTree.GetSequenceNodes().First().Text; if (arg != ProteinMetadataManager.ProteinDisplayMode.ByName && Equals(displayText, GetDisplayText(ProteinMetadataManager.ProteinDisplayMode.ByName, metadata))) { return(false); } return(Equals(displayText, GetDisplayText(arg, metadata))); }); } // Examine the various Edit | Refine | Sort Proteins | By* modes Assert.AreEqual("YIL075C", nodeProt.Name); // unsorted foreach (ProteinMetadataManager.ProteinDisplayMode mode in Enum.GetValues(typeof(ProteinMetadataManager.ProteinDisplayMode))) { string expectedTopName = null; switch (mode) { case ProteinMetadataManager.ProteinDisplayMode.ByName: expectedTopName = "YAL003W"; RunUI(() => SkylineWindow.sortProteinsByNameToolStripMenuItem_Click(null, null)); break; case ProteinMetadataManager.ProteinDisplayMode.ByAccession: expectedTopName = TestSmallMolecules ? "ZZZTESTINGNONPROTEOMICMOLECULEGROUP" : "YFL038C"; RunUI(() => SkylineWindow.sortProteinsByAccessionToolStripMenuItem_Click(null, null)); break; case ProteinMetadataManager.ProteinDisplayMode.ByPreferredName: RunUI(() => SkylineWindow.sortProteinsByPreferredNameToolStripMenuItem_Click(null, null)); expectedTopName = TestSmallMolecules ? "ZZZTESTINGNONPROTEOMICMOLECULEGROUP" : "YAL016W"; break; case ProteinMetadataManager.ProteinDisplayMode.ByGene: RunUI(() => SkylineWindow.sortProteinsByGeneToolStripMenuItem_Click(null, null)); expectedTopName = TestSmallMolecules ? "ZZZTESTINGNONPROTEOMICMOLECULEGROUP" : "YGL234W"; break; } var actualTopName = WaitForDocumentLoaded().MoleculeGroups.First().Name.ToUpperInvariant(); Assert.AreEqual(expectedTopName, actualTopName); } // Now paste in our fake fasta test data, and handle it with our fake webaccess handler var protdbLoader = SkylineWindow.BackgroundProteomeManager; protdbLoader.FastaImporter = new WebEnabledFastaImporter(new CommonTest.FastaImporterTest.PlaybackProvider()); var treeLoader = SkylineWindow.ProteinMetadataManager; treeLoader.FastaImporter = new WebEnabledFastaImporter(new CommonTest.FastaImporterTest.PlaybackProvider()); const int maxEntries = 5; var fastaText = CommonTest.FastaImporterTest.GetFastaTestText(maxEntries); // Just get the first few SetClipboardTextUI(fastaText); var pasteDlg = ShowDialog <PasteDlg>(SkylineWindow.ShowPasteFastaDlg); // Show the paste dialog RunDlg <EmptyProteinsDlg>(() => // Anticpate the EmptyProteinsDialog as a side effect { pasteDlg.PasteFasta(); // Doing this in pastDlg... pasteDlg.OkDialog(); }, dlg => { Assert.AreEqual(maxEntries, dlg.EmptyProteins); dlg.KeepEmptyProteins(); dlg.OkDialog(); // ... will cause EmptyProteinsDlg to pop up, so OK it. }); // Check that IPI:IPI00197700.1 got an accession number P04638 WaitForCondition(() => SkylineWindow.Document.MoleculeGroups.Any(pg => Equals("IPI:IPI00197700.1", pg.Name))); doc = WaitForDocumentLoaded(); nodeProt = doc.MoleculeGroups.First(pg => Equals("IPI:IPI00197700.1", pg.Name)); Assert.AreEqual("P04638", nodeProt.ProteinMetadata.Accession); // Now make our fake fasta into a protdb file, and check statement completion against that const string basename = "fake.fasta"; var protdbPath = TestFilesDir.GetTestPath(basename + ProteomeDb.EXT_PROTDB); var fastapath = TestFilesDir.GetTestPath(basename); using (StreamWriter outfile = new StreamWriter(fastapath)) { outfile.Write(CommonTest.FastaImporterTest.GetFastaTestText()); // write them all } BackgroundProteomeTest.CreateBackgroundProteome(protdbPath, basename, fastapath); doc = WaitForDocumentChange(doc); // Test for getting accession info from protdb RunUI(() => { SequenceTree sequenceTree = SkylineWindow.SequenceTree; SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.Nodes[SkylineWindow.SequenceTree.Nodes.Count - 1]; // Select the creation node sequenceTree.BeginEdit(false); // ReSharper disable LocalizableElement sequenceTree.StatementCompletionEditBox.TextBox.Text = "NP_313205"; // ReSharper restore LocalizableElement sequenceTree.CommitEditBox(false); }); doc = WaitForDocumentChange(doc); nodeProt = doc.MoleculeGroups.First(pg => Equals("NP_313205", pg.Name)); Assert.AreEqual("P0A7T9", nodeProt.ProteinMetadata.Accession); var snapshot = SkylineWindow.Document; // Test for getting protein from protdb by preferredName const string uniRef100A5Di11 = "UniRef100_A5DI11"; const string a5Di11 = "A5DI11"; RunUI(() => { SequenceTree sequenceTree = SkylineWindow.SequenceTree; SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.Nodes[SkylineWindow.SequenceTree.Nodes.Count - 1]; // Select the creation node sequenceTree.BeginEdit(false); // ReSharper disable LocalizableElement sequenceTree.StatementCompletionEditBox.TextBox.Text = "EF2_PICGU"; // PreferredName for UniRef100_A5DI11 // ReSharper restore LocalizableElement sequenceTree.CommitEditBox(false); }); WaitForCondition(() => SkylineWindow.Document.MoleculeGroups.Any(pg => Equals(uniRef100A5Di11, pg.Name))); doc = WaitForDocumentChange(doc); nodeProt = doc.MoleculeGroups.First(pg => Equals(uniRef100A5Di11, pg.Name)); Assert.AreEqual(a5Di11, nodeProt.ProteinMetadata.Accession); // Paste in some junk and make sure we handle the View Targets By* gracefully const string badname = "badname"; RunUI(() => { SequenceTree sequenceTree = SkylineWindow.SequenceTree; SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.Nodes[SkylineWindow.SequenceTree.Nodes.Count - 1]; // Select the creation node sequenceTree.BeginEdit(false); sequenceTree.StatementCompletionEditBox.TextBox.Text = badname; sequenceTree.CommitEditBox(false); }); doc = WaitForDocumentChange(doc); var nodeText = SkylineWindow.SequenceTree.GetSequenceNodes().Last(n => !SrmDocument.IsSpecialNonProteomicTestDocNode(n.DocNode)).Text; var failsafe = String.Format(Resources.PeptideGroupTreeNode_ProteinModalDisplayText__name___0__, badname); // As in PeptideGroupTreeNode.cs Assert.AreEqual(failsafe, nodeText); // Revert those changes, so we can insert another way Assert.IsTrue(SkylineWindow.SetDocument(snapshot, doc)); WaitForCondition(() => !SkylineWindow.Document.MoleculeGroups.Any(pg => Equals(uniRef100A5Di11, pg.Name))); doc = SkylineWindow.Document; // Test for pasting accession number in protein paste dialog, and having it populate with correct name SetClipboardTextUI(a5Di11); PasteDlg pasteProteinsDlgA = ShowDialog <PasteDlg>(SkylineWindow.ShowPasteProteinsDlg); RunUI(() => { var selectedNode = SkylineWindow.SequenceTree.Nodes[SkylineWindow.SequenceTree.Nodes.Count - 1]; SkylineWindow.SequenceTree.SelectedNode = selectedNode; pasteProteinsDlgA.SelectedPath = SkylineWindow.SequenceTree.SelectedPath; pasteProteinsDlgA.PasteProteins(); }); OkDialog(pasteProteinsDlgA, pasteProteinsDlgA.OkDialog); WaitForCondition(() => SkylineWindow.Document.MoleculeGroups.Any(pg => Equals(uniRef100A5Di11, pg.Name))); doc = WaitForDocumentChange(doc); nodeProt = doc.MoleculeGroups.First(pg => Equals(uniRef100A5Di11, pg.Name)); Assert.AreEqual(a5Di11, nodeProt.ProteinMetadata.Accession); // See what happens when you paste in a gene name shared by a couple of proteins const string dupeGene = "Apoa2"; const string ipi00197700 = "IPI:IPI00197700.1"; SetClipboardTextUI(dupeGene); PasteDlg pasteProteinsDlgB = ShowDialog <PasteDlg>(SkylineWindow.ShowPasteProteinsDlg); RunUI(() => { var selectedNode = SkylineWindow.SequenceTree.Nodes[SkylineWindow.SequenceTree.Nodes.Count - 1]; SkylineWindow.SequenceTree.SelectedNode = selectedNode; pasteProteinsDlgB.SelectedPath = SkylineWindow.SequenceTree.SelectedPath; pasteProteinsDlgB.PasteProteins(); }); OkDialog(pasteProteinsDlgB, pasteProteinsDlgB.OkDialog); WaitForCondition(() => SkylineWindow.Document.MoleculeGroups.Any(pg => Equals(ipi00197700, pg.Name))); doc = WaitForDocumentChange(doc); nodeProt = doc.MoleculeGroups.First(pg => Equals(ipi00197700, pg.Name)); Assert.AreEqual(dupeGene, nodeProt.ProteinMetadata.Gene); // Test for pasting in protein PasteDlg with sequence and metadata - metadata values are same as DocumentGrid column names const string pasteProteinName = "Protein"; const string pasteProteinDescription = "Description"; const string pasteProteinAccession = "Accession"; const string pasteProteinPreferredName = "PreferredName"; const string pasteProteinGene = "Gene"; const string pasteProteinSpecies = "Species"; var pasteProteinText = String.Join("\t", pasteProteinName, pasteProteinDescription, "MFEQFDLDSELLASINK IGYTKPTSIQELVIPQAMV", pasteProteinAccession, pasteProteinPreferredName, // Note the whitespace embedded in the sequence - UI should deal with that pasteProteinGene, pasteProteinSpecies); SetClipboardTextUI(pasteProteinText); PasteDlg pasteProteinsDlg = ShowDialog <PasteDlg>(SkylineWindow.ShowPasteProteinsDlg); RunUI(() => { var selectedNode = SkylineWindow.SequenceTree.Nodes[SkylineWindow.SequenceTree.Nodes.Count - 1]; SkylineWindow.SequenceTree.SelectedNode = selectedNode; pasteProteinsDlg.SelectedPath = SkylineWindow.SequenceTree.SelectedPath; pasteProteinsDlg.PasteProteins(); }); OkDialog(pasteProteinsDlg, pasteProteinsDlg.OkDialog); WaitForCondition(() => SkylineWindow.Document.MoleculeGroups.Any(pg => Equals(pasteProteinName, pg.Name))); doc = WaitForDocumentChange(doc); nodeProt = doc.MoleculeGroups.First(pg => Equals(pasteProteinName, pg.Name)); Assert.AreEqual(pasteProteinAccession, nodeProt.ProteinMetadata.Accession); // Verify DocumentGrid's use of protein metadata - last line should agree with var pasteProteinText var documentGrid = ShowDialog <DocumentGridForm>(() => SkylineWindow.ShowDocumentGrid(true)); RunUI(() => documentGrid.ChooseView(Resources.SkylineViewContext_GetDocumentGridRowSources_Proteins)); WaitForCondition(() => (documentGrid.RowCount > 0)); // Let it initialize foreach (var colName in new[] { pasteProteinAccession, pasteProteinPreferredName, pasteProteinGene, pasteProteinSpecies }) { // Column content should match column name, for pasteProteinText as input string value = null; string name = colName; RunUI(() => { var col = documentGrid.FindColumn(PropertyPath.Parse(name)); value = documentGrid.DataGridView.Rows[documentGrid.RowCount - 1].Cells[col.Index].Value.ToString(); }); Assert.AreEqual(colName, value); } }
protected override void DoTest() { // Creating a MS/MS Spectral Library, p. 1 PeptideSettingsUI peptideSettingsUI = ShowDialog <PeptideSettingsUI>(SkylineWindow.ShowPeptideSettingsUI); RunDlg <BuildLibraryDlg>(peptideSettingsUI.ShowBuildLibraryDlg, buildLibraryDlg => { buildLibraryDlg.LibraryPath = TestFilesDirs[0].GetTestPath(@"MethodEdit\Library\"); // Not L10N buildLibraryDlg.LibraryName = YEAST_ATLAS; buildLibraryDlg.LibraryCutoff = 0.95; buildLibraryDlg.LibraryAuthority = "peptideatlas.org"; // Not L10N buildLibraryDlg.OkWizardPage(); IList <string> inputPaths = new List <string> { TestFilesDirs[0].GetTestPath(@"MethodEdit\Yeast_atlas\interact-prob.pep.xml") // Not L10N }; buildLibraryDlg.AddInputFiles(inputPaths); buildLibraryDlg.OkWizardPage(); }); PeptideSettingsUI peptideSettingsUI1 = peptideSettingsUI; RunUI(() => { peptideSettingsUI1.SelectedTab = PeptideSettingsUI.TABS.Library; peptideSettingsUI1.PickedLibraries = new[] { YEAST_ATLAS }; }); WaitForOpenForm <PeptideSettingsUI>(); // To show Library tab for Forms testing PauseForScreenShot <PeptideSettingsUI.LibraryTab>("Peptide Settings - Library tab", 4); // Not L10N RunUI(() => peptideSettingsUI1.SelectedTab = PeptideSettingsUI.TABS.Digest); WaitForOpenForm <PeptideSettingsUI>(); // To show Digestion tab for Forms testing // Creating a Background Proteome File, p. 3 FileEx.SafeDelete(TestFilesDirs[0].GetTestPath(@"MethodEdit\FASTA\Yeast" + ProteomeDb.EXT_PROTDB)); // Not L10N var buildBackgroundProteomeDlg = ShowDialog <BuildBackgroundProteomeDlg>(peptideSettingsUI.ShowBuildBackgroundProteomeDlg); RunUI(() => { buildBackgroundProteomeDlg.BackgroundProteomePath = TestFilesDirs[0].GetTestPath(@"MethodEdit\FASTA\Yeast"); // Not L10N buildBackgroundProteomeDlg.BackgroundProteomeName = "Yeast"; // Not L10N buildBackgroundProteomeDlg.AddFastaFile( TestFilesDirs[0].GetTestPath(@"MethodEdit\FASTA\sgd_yeast.fasta")); // Not L10N }); PauseForScreenShot <BuildBackgroundProteomeDlg>("Edit Background Proteome form", 5); // Not L10N OkDialog(buildBackgroundProteomeDlg, buildBackgroundProteomeDlg.OkDialog); PauseForScreenShot <PeptideSettingsUI.DigestionTab>("Peptide Settings - Digestion tab", 6); // Not L10N var docB = SkylineWindow.Document; OkDialog(peptideSettingsUI, peptideSettingsUI.OkDialog); WaitForDocumentChange(docB); if (!TryWaitForCondition(() => SkylineWindow.Document.Settings.PeptideSettings.Libraries.IsLoaded && SkylineWindow.Document.Settings.PeptideSettings.Libraries.Libraries.Count > 0)) { Assert.Fail("Timed out loading libraries: libCount={0}, NotLoadedExplained={1}", SkylineWindow.Document.Settings.PeptideSettings.Libraries.Libraries.Count, SkylineWindow.Document.Settings.PeptideSettings.Libraries.IsNotLoadedExplained ?? "<null>"); } WaitForCondition(() => { var peptideSettings = SkylineWindow.Document.Settings.PeptideSettings; var backgroundProteome = peptideSettings.BackgroundProteome; return(backgroundProteome.HasDigestion(peptideSettings)); }, "backgroundProteome.HasDigestion"); // Wait a bit in case web access is turned on and backgroundProteome is actually resolving protein metadata int millis = (AllowInternetAccess ? 300 : 60) * 1000; WaitForCondition(millis, () => !SkylineWindow.Document.Settings.PeptideSettings.BackgroundProteome.NeedsProteinMetadataSearch, "backgroundProteome.NeedsProteinMetadataSearch"); // Pasting FASTA Sequences, p. 5 RunUI(() => SetClipboardFileText(@"MethodEdit\FASTA\fasta.txt")); // Not L10N // New in v0.7 : Skyline asks about removing empty proteins. using (new CheckDocumentState(35, 25, 25, 75)) { var emptyProteinsDlg = ShowDialog <EmptyProteinsDlg>(SkylineWindow.Paste); RunUI(() => emptyProteinsDlg.IsKeepEmptyProteins = true); OkDialog(emptyProteinsDlg, emptyProteinsDlg.OkDialog); WaitForCondition(millis, () => SkylineWindow.SequenceTree.Nodes.Count > 4); } RunUI(() => { SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.Nodes[3].Nodes[0]; }); RestoreViewOnScreen(07); PauseForScreenShot("Main window", 7); // Not L10N RunUI(() => { Settings.Default.ShowBIons = true; SkylineWindow.SequenceTree.SelectedNode.Expand(); SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.SelectedNode.Nodes[0].Nodes[1]; }); PauseForScreenShot("Main window showing effect of selection on Library Match graph", 8); // Not L10N CheckTransitionCount("VDIIANDQGNR", 3); // Not L10N using (new CheckDocumentState(35, 28, 31, 155)) { var transitionSettingsUI = ShowDialog <TransitionSettingsUI>(SkylineWindow.ShowTransitionSettingsUI); RunUI(() => { transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.Filter; transitionSettingsUI.PrecursorCharges = "2, 3"; // Not L10N transitionSettingsUI.ProductCharges = "1"; // Not L10N transitionSettingsUI.FragmentTypes = "y, b"; // Not L10N }); WaitForOpenForm <TransitionSettingsUI>(); // To show Filter tab for Forms testing PauseForScreenShot <TransitionSettingsUI.FilterTab>("Transition Settings - Filter tab", 9); // Not L10N RunUI(() => { transitionSettingsUI.SelectedTab = TransitionSettingsUI.TABS.Library; transitionSettingsUI.IonCount = 5; }); PauseForScreenShot <TransitionSettingsUI.LibraryTab>("Transition Settings - Library tab", 10); // Not L10N OkDialog(transitionSettingsUI, transitionSettingsUI.OkDialog); } PauseForScreenShot("Targets tree clipped from main window", 11); // Not L10N CheckTransitionCount("VDIIANDQGNR", 5); // Not L10N // Using a Public Spectral Library, p. 9 peptideSettingsUI = ShowDialog <PeptideSettingsUI>(SkylineWindow.ShowPeptideSettingsUI); var editListUI = ShowDialog <EditListDlg <SettingsListBase <LibrarySpec>, LibrarySpec> >(peptideSettingsUI.EditLibraryList); var addLibUI = ShowDialog <EditLibraryDlg>(editListUI.AddItem); RunUI(() => addLibUI.LibrarySpec = new BiblioSpecLibSpec(YEAST_GPM, TestFilesDirs[0].GetTestPath(@"MethodEdit\Library\yeast_cmp_20.hlf"))); // Not L10N OkDialog(addLibUI, addLibUI.OkDialog); WaitForClosedForm(addLibUI); OkDialog(editListUI, editListUI.OkDialog); // Limiting Peptides per Protein, p. 11 using (new CheckDocumentState(35, 182, 219, 1058)) { RunUI(() => { peptideSettingsUI.SelectedTab = PeptideSettingsUI.TABS.Library; peptideSettingsUI.PickedLibraries = new[] { YEAST_ATLAS, YEAST_GPM }; }); PauseForScreenShot <PeptideSettingsUI.LibraryTab>("Peptide Settings - Library tab", 12); // Not L10N OkDialog(peptideSettingsUI, peptideSettingsUI.OkDialog); Assert.IsTrue(WaitForCondition( () => SkylineWindow.Document.Settings.PeptideSettings.Libraries.IsLoaded && SkylineWindow.Document.Settings.PeptideSettings.Libraries.Libraries.Count > 0)); } using (new CheckDocumentState(35, 47, 47, 223, 2, true)) // Wait for change loaded, and expect 2 document revisions. { RunDlg <PeptideSettingsUI>(SkylineWindow.ShowPeptideSettingsUI, peptideSettingsUI2 => { peptideSettingsUI2.PickedLibraries = new[] { YEAST_GPM }; peptideSettingsUI2.LimitPeptides = true; peptideSettingsUI2.RankID = XHunterLibSpec.PEP_RANK_EXPECT; peptideSettingsUI2.PeptidesPerProtein = 3; peptideSettingsUI2.OkDialog(); }); } using (new CheckDocumentState(19, 47, 47, 223)) { RunUI(() => { var refinementSettings = new RefinementSettings { MinPeptidesPerProtein = 1 }; SkylineWindow.ModifyDocument("Remove empty proteins", refinementSettings.Refine); // Not L10N }); } // Inserting a Protein List, p. 11 using (new CheckDocumentState(36, 58, 58, 278)) { PasteDlg pasteProteinsDlg = ShowDialog <PasteDlg>(SkylineWindow.ShowPasteProteinsDlg); RunUI(() => { var node = SkylineWindow.SequenceTree.Nodes[SkylineWindow.SequenceTree.Nodes.Count - 1]; SkylineWindow.SequenceTree.SelectedNode = node; SetClipboardFileText(@"MethodEdit\FASTA\Protein list.txt"); // Not L10N pasteProteinsDlg.SelectedPath = SkylineWindow.SequenceTree.SelectedPath; pasteProteinsDlg.PasteProteins(); }); PauseForScreenShot <PasteDlg.ProteinListTab>("Insert Protein List - For Screenshot, select last (empty) item in list", 14); // Not L10N OkDialog(pasteProteinsDlg, pasteProteinsDlg.OkDialog); } using (new CheckDocumentState(24, 58, 58, 278)) { RunUI(() => { var refinementSettings = new RefinementSettings { MinPeptidesPerProtein = 1 }; SkylineWindow.ModifyDocument("Remove empty proteins", refinementSettings.Refine); // Not L10N }); } // Inserting a Peptide List, p. 13 using (new CheckDocumentState(25, 70, 70, 338)) { RunUI(() => { SetClipboardFileText(@"MethodEdit\FASTA\Peptide list.txt"); // Not L10N SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.Nodes[0]; SkylineWindow.Paste(); // ReSharper disable LocalizableElement SkylineWindow.SequenceTree.Nodes[0].Text = "Primary Peptides"; // Not L10N // ReSharper restore LocalizableElement }); FindNode("TLTAQSMQNSTQSAPNK"); // Not L10N PauseForScreenShot("Main window", 16); // Not L10N } using (new CheckDocumentState(35, 70, 70, 338)) { RunUI(() => SkylineWindow.Undo()); PasteDlg pastePeptidesDlg = ShowDialog <PasteDlg>(SkylineWindow.ShowPastePeptidesDlg); RunUI(pastePeptidesDlg.PastePeptides); PauseForScreenShot <PasteDlg.PeptideListTab>("Insert Peptide List - For screenshot, select last (empty) line in list", 17); // Not L10N OkDialog(pastePeptidesDlg, pastePeptidesDlg.OkDialog); } // Simple Refinement, p. 16 var findPeptideDlg = ShowDialog <FindNodeDlg>(SkylineWindow.ShowFindNodeDlg); RunUI(() => findPeptideDlg.SearchString = "IPEE"); // Not L10N OkDialog(findPeptideDlg, () => { findPeptideDlg.FindNext(); findPeptideDlg.Close(); }); PauseForScreenShot <GraphSpectrum>("Library Match graph metafile", 18); // Not L10N using (new CheckDocumentState(35, 64, 64, 320)) { RefineDlg refineDlg = ShowDialog <RefineDlg>(SkylineWindow.ShowRefineDlg); RunUI(() => refineDlg.MinTransitions = 5); OkDialog(refineDlg, refineDlg.OkDialog); PauseForScreenShot("29/35 prot 50/64 pep 50/64 prec 246/320 tran", 18); // Not L10N } // Checking Peptide Uniqueness, p. 18 RunUI(() => { var node = SkylineWindow.SequenceTree.Nodes[SkylineWindow.SequenceTree.Nodes.Count - (TestSmallMolecules ? 3 : 2)]; SkylineWindow.SequenceTree.SelectedNode = node; }); using (new CheckDocumentState(34, 63, 63, 315)) { var uniquePeptidesDlg = ShowDialog <UniquePeptidesDlg>(SkylineWindow.ShowUniquePeptidesDlg); WaitForConditionUI(() => uniquePeptidesDlg.GetDataGridView().RowCount == 1); RunUI(() => { Assert.AreEqual(1, uniquePeptidesDlg.GetDataGridView().RowCount); Assert.AreEqual(7, uniquePeptidesDlg.GetDataGridView().ColumnCount); }); PauseForScreenShot <UniquePeptidesDlg>("Unique Peptides form", 19); // Not L10N OkDialog(uniquePeptidesDlg, uniquePeptidesDlg.OkDialog); RunUI(() => SkylineWindow.EditDelete()); } // Protein Name Auto-Completion PauseForScreenShot("(fig. 1): For screenshot, click at bottom of document tree, type 'ybl087' and see the autocomplete text. Make sure to undo this new entry before proceeding.", 20); // Not L10N TestAutoComplete("ybl087", 0); // Not L10N var peptideGroups = new List <PeptideGroupDocNode>(Program.ActiveDocument.PeptideGroups); Assert.AreEqual("YBL087C", peptideGroups[peptideGroups.Count - 1].Name); // Not L10N // Protein Description Auto-Completion PauseForScreenShot("(fig. 2): For screenshot, click at bottom of document tree, type 'eft2' and see the autocomplete text, then down-arrow twice. Make sure to undo this new entry before proceeding.", 20); // Not L10N TestAutoComplete("eft2", 0); // Sorting logic puts this at the 0th entry in the list - Not L10N peptideGroups = new List <PeptideGroupDocNode>(Program.ActiveDocument.PeptideGroups); Assert.AreEqual("YDR385W", peptideGroups[peptideGroups.Count - 1].Name); // Not L10N // Peptide Sequence Auto-Completion, p. 21 TestAutoComplete("IQGP", 0); // Not L10N var peptides = new List <PeptideDocNode>(Program.ActiveDocument.Peptides); Assert.AreEqual("K.AYLPVNESFGFTGELR.Q [769, 784]", peptides[peptides.Count - 1].Peptide.ToString()); // Not L10N PauseForScreenShot("(fig. 1) - For screenshot, click at the bottom of the document tree", 21); // Not L10N // Pop-up Pick-Lists, p. 21 using (new CheckDocumentState(36, 71, 71, 355)) { RunUI(() => { var node = SkylineWindow.SequenceTree.Nodes[SkylineWindow.SequenceTree.Nodes.Count - (TestSmallMolecules ? 4 : 3)]; SkylineWindow.SequenceTree.SelectedNode = node; }); var pickList = ShowDialog <PopupPickList>(SkylineWindow.ShowPickChildrenInTest); RunUI(() => { pickList.ApplyFilter(false); pickList.SetItemChecked(8, true); pickList.AutoManageChildren = false; // TODO: Because calling SetItemChecked does not do this }); PauseForScreenShot <PopupPickList>("(fig. 2) - YBL087C Peptides picklist", 21); // Not L10N RunUI(pickList.OnOk); } using (new CheckDocumentState(36, 71, 71, 355)) { RunUI(() => { SkylineWindow.SequenceTree.Nodes[34].ExpandAll(); var node = SkylineWindow.SequenceTree.Nodes[34].Nodes[0].Nodes[0]; SkylineWindow.SequenceTree.SelectedNode = node; }); var pickList1 = ShowDialog <PopupPickList>(SkylineWindow.ShowPickChildrenInTest); RunUI(() => { pickList1.SearchString = "y"; // Not L10N pickList1.SetItemChecked(0, false); pickList1.SetItemChecked(1, false); pickList1.ApplyFilter(false); pickList1.ToggleFind(); pickList1.SearchString = "b ++"; // Not L10N pickList1.SetItemChecked(4, true); pickList1.SetItemChecked(6, true); }); PauseForScreenShot <PopupPickList>("b ++ filtered picklist", 22); // Not L10N RunUI(pickList1.OnOk); } // Bigger Picture, p. 22. Drag and Drop, p. 23 RunUI(() => { ITipProvider nodeTip = SkylineWindow.SequenceTree.SelectedNode as ITipProvider; Assert.IsTrue(nodeTip != null && nodeTip.HasTip); var nodeName = SkylineWindow.SequenceTree.Nodes[1].Name; IdentityPath selectPath; SkylineWindow.ModifyDocument("Drag and drop", // Not L10N doc => doc.MoveNode(SkylineWindow.Document.GetPathTo(0, 1), SkylineWindow.Document.GetPathTo(0, 0), out selectPath)); Assert.IsTrue(SkylineWindow.SequenceTree.Nodes[0].Name == nodeName); }); FindNode(string.Format("L [b5] - {0:F04}+", 484.3130)); // Not L10N - may be localized " (rank 3)" PauseForScreenShot("For Screenshots, First hover over YBL087C, then over 672.671+++", 23); // Not L10N // Preparing to Measure, p. 25 RunDlg <TransitionSettingsUI>(() => SkylineWindow.ShowTransitionSettingsUI(TransitionSettingsUI.TABS.Prediction), transitionSettingsUI => { transitionSettingsUI.RegressionCE = Settings.Default.GetCollisionEnergyByName("ABI 4000 QTrap"); // Not L10N transitionSettingsUI.RegressionDP = Settings.Default.GetDeclusterPotentialByName("ABI"); // Not L10N transitionSettingsUI.InstrumentMaxMz = 1800; transitionSettingsUI.OkDialog(); }); RunUI(() => SkylineWindow.SaveDocument(TestFilesDirs[0].GetTestPath("MethodEdit Tutorial.sky"))); // Not L10N var exportDialog = ShowDialog <ExportMethodDlg>(() => SkylineWindow.ShowExportMethodDialog(ExportFileType.List)); RunUI(() => { exportDialog.ExportStrategy = ExportStrategy.Buckets; exportDialog.MethodType = ExportMethodType.Standard; exportDialog.OptimizeType = ExportOptimize.NONE; exportDialog.IgnoreProteins = true; exportDialog.MaxTransitions = 75; }); PauseForScreenShot <ExportMethodDlg.TransitionListView>("Export Transition List form", 25); // Not L10N const string basename = "Yeast_list"; // Not L10N OkDialog(exportDialog, () => exportDialog.OkDialog(TestFilesDirs[0].GetTestPath(basename))); // write Yeast_list_000n.csv // check the output files for (int n = 0; n++ < 5;) { var csvname = String.Format("{0}_{1}.csv", basename, n.ToString("D4")); // Not L10N // AssertEx.FieldsEqual is hard-coded with CultureInfo.InvariantCulture, but so is transition list CSV export, so OK using (TextReader actual = new StreamReader(TestFilesDirs[0].GetTestPath(csvname))) using (TextReader target = new StreamReader(TestFilesDirs[1].GetTestPath(csvname))) { AssertEx.FieldsEqual(target, actual, 6, null, true, TestSmallMolecules ? 3 : 0); } } }