示例#1
0
 private void closeAllChromatogramsMenuItem_Click(object sender, EventArgs e)
 {
     SkylineWindow.CloseAllChromatograms();
 }
示例#2
0
        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)));
                    }
                }
            }
        }