// Disabled 20170131 because Skyline Chorus API is offline
//        [TestMethod] TODO(nicksh) re-enable when Chorus is reliable
        public void TestThermoDIA()
        {
            if (!RunPerfTests)
            {
                return; // PerfTests only run when the global "allow perf tests" flag is set
            }
            var xmlSerializer = new XmlSerializer(typeof(ChromatogramRequestDocument));
            var stream        = typeof(PerfChorusGenerateChromatograms).Assembly.GetManifestResourceStream(
                typeof(PerfChorusGenerateChromatograms), "ThermoDIA.ChorusRequest.xml");

            Assert.IsNotNull(stream);
            var           chromatogramRequestDocument = (ChromatogramRequestDocument)xmlSerializer.Deserialize(stream);
            var           chorusUrl     = TEST_ACCOUNT.GetChorusUrl().SetFileId(28836);
            var           srmDocument   = new SrmDocument(SrmSettingsList.GetDefault());
            DateTime      startTime     = DateTime.Now;
            ChromTaskList chromTaskList = new ChromTaskList(() => {}, srmDocument, TEST_ACCOUNT, chorusUrl, new[] { chromatogramRequestDocument });

            chromTaskList.SetMinimumSimultaneousTasks(2);
            while (chromTaskList.PercentComplete < 100)
            {
                Thread.Sleep(100);
            }
            DateTime endTime = DateTime.Now;

            AssertEx.AreNoExceptions(chromTaskList.ListExceptions());
            Console.Out.WriteLine("Elapsed time {0}", endTime.Subtract(startTime));
        }
 protected override void DoTest()
 {
     var chorusAccount = new ChorusAccount("https://chorusproject.org", "*****@*****.**", "pwd");
     RunUI(() => SkylineWindow.OpenFile(TestFilesDir.GetTestPath("Hoofnagle_MSe_targeted.sky")));
     var importResultsDlg = ShowDialog<ImportResultsDlg>(SkylineWindow.ImportResults);
     var openDataSourceDialog = ShowDialog<OpenDataSourceDialog>(importResultsDlg.OkDialog);
     var multiButtonMsgDlg = ShowDialog<MultiButtonMsgDlg>(() => openDataSourceDialog.CurrentDirectory = ChorusUrl.EMPTY);
     OkDialog(multiButtonMsgDlg, multiButtonMsgDlg.Btn1Click);
     var editChorusAccountDlg = WaitForOpenForm<EditChorusAccountDlg>();
     RunUI(()=>
     {
         editChorusAccountDlg.SetChorusAccount(chorusAccount);
     });
     OkDialog(editChorusAccountDlg, editChorusAccountDlg.OkDialog);
     Assert.AreEqual(chorusAccount.GetChorusUrl(), openDataSourceDialog.CurrentDirectory);
     RunUI(() =>
     {
         openDataSourceDialog.CurrentDirectory = chorusAccount.GetChorusUrl().AddPathPart("myFiles");
     });
     WaitForConditionUI(() => !openDataSourceDialog.WaitingForData);
     RunUI(() =>
     {
         openDataSourceDialog.SelectFile("2013_03_13_UWash_S1_MSE_Adj_001.raw.zip");
         openDataSourceDialog.SelectFile("2013_03_13_UWash_S2_MSE_Adj_001.raw.zip");
     });
     OkDialog(openDataSourceDialog, openDataSourceDialog.Open);
     ImportResultsNameDlg importResultsNameDlg = WaitForOpenForm<ImportResultsNameDlg>();
     OkDialog(importResultsNameDlg, importResultsNameDlg.NoDialog);
     WaitForConditionUI(() =>
         SkylineWindow.DocumentUI.Settings.HasResults &&
         SkylineWindow.DocumentUI.Settings.MeasuredResults.IsLoaded
         );
     Assert.AreEqual(2, SkylineWindow.Document.Settings.MeasuredResults.Chromatograms.Count);
 }
示例#3
0
        //[TestMethod]
        public void TestDdaSmall()
        {
            ChorusAccount TEST_ACCOUNT = new ChorusAccount("https://chorusproject.org", "*****@*****.**", "pwd");
            var stream = typeof (ChromTaskListTest).Assembly.GetManifestResourceStream(typeof (ChromTaskListTest),
                "DdaSmall.ChorusRequest.xml");
            Assert.IsNotNull(stream);
            var chromatogramRequest = (ChromatogramRequestDocument) new XmlSerializer(typeof (ChromatogramRequestDocument)).Deserialize(stream);
            var chromTaskList = new ChromTaskList(() => { }, new SrmDocument(SrmSettingsList.GetDefault()), TEST_ACCOUNT,
                TEST_ACCOUNT.GetChorusUrl().SetFileId(28836), ChromTaskList.ChunkChromatogramRequest(chromatogramRequest, 100));
            chromTaskList.SetMinimumSimultaneousTasks(10);
            var failedTasks = new HashSet<ChromatogramGeneratorTask>();
            foreach (var chromKey in chromTaskList.ChromKeys)
            {
                float[] times;
                float[] intensities;
                float[] massErrors;
                int[] scanIds;
                chromTaskList.GetChromatogram(chromKey, out times, out scanIds, out intensities, out massErrors);
                if (null == times)
                {
                    var task = chromTaskList.GetGeneratorTask(chromKey);
                    if (failedTasks.Add(task))
                    {
                        var memoryStream = new MemoryStream();
                        var xmlWriter = XmlWriter.Create(memoryStream, new XmlWriterSettings {Encoding = Encoding.UTF8});
                        new XmlSerializer(typeof(ChromatogramRequestDocument)).Serialize(xmlWriter, task.ChromatogramRequestDocument);
                        Console.Out.WriteLine("Failed to get data for {0}", Encoding.UTF8.GetString(memoryStream.ToArray()));

                    }
                }
            }
            Assert.AreEqual(0, failedTasks.Count);
        }
示例#4
0
        //[TestMethod]
        public void TestDdaSmall()
        {
            ChorusAccount TEST_ACCOUNT = new ChorusAccount("https://chorusproject.org", "*****@*****.**", "pwd");
            var           stream       = typeof(ChromTaskListTest).Assembly.GetManifestResourceStream(typeof(ChromTaskListTest),
                                                                                                      "DdaSmall.ChorusRequest.xml");

            Assert.IsNotNull(stream);
            var chromatogramRequest = (ChromatogramRequestDocument) new XmlSerializer(typeof(ChromatogramRequestDocument)).Deserialize(stream);
            var chromTaskList       = new ChromTaskList(() => { }, new SrmDocument(SrmSettingsList.GetDefault()), TEST_ACCOUNT,
                                                        TEST_ACCOUNT.GetChorusUrl().SetFileId(28836), ChromTaskList.ChunkChromatogramRequest(chromatogramRequest, 100));

            chromTaskList.SetMinimumSimultaneousTasks(10);
            var failedTasks = new HashSet <ChromatogramGeneratorTask>();

            foreach (var chromKey in chromTaskList.ChromKeys)
            {
                TimeIntensities timeIntensities;
                chromTaskList.GetChromatogram(chromKey, out timeIntensities);
                if (null == timeIntensities)
                {
                    var task = chromTaskList.GetGeneratorTask(chromKey);
                    if (failedTasks.Add(task))
                    {
                        var memoryStream = new MemoryStream();
                        var xmlWriter    = XmlWriter.Create(memoryStream, new XmlWriterSettings {
                            Encoding = Encoding.UTF8
                        });
                        new XmlSerializer(typeof(ChromatogramRequestDocument)).Serialize(xmlWriter, task.ChromatogramRequestDocument);
                        Console.Out.WriteLine("Failed to get data for {0}", Encoding.UTF8.GetString(memoryStream.ToArray()));
                    }
                }
            }
            Assert.AreEqual(0, failedTasks.Count);
        }
示例#5
0
        protected override void DoTest()
        {
            var chorusAccount = new ChorusAccount("https://chorusproject.org", "*****@*****.**", "pwd");

            RunUI(() => SkylineWindow.OpenFile(TestFilesDir.GetTestPath("Hoofnagle_MSe_targeted.sky")));
            var importResultsDlg     = ShowDialog <ImportResultsDlg>(SkylineWindow.ImportResults);
            var openDataSourceDialog = ShowDialog <OpenDataSourceDialog>(importResultsDlg.OkDialog);
            var multiButtonMsgDlg    = ShowDialog <MultiButtonMsgDlg>(() => openDataSourceDialog.CurrentDirectory = RemoteUrl.EMPTY);

            OkDialog(multiButtonMsgDlg, multiButtonMsgDlg.Btn1Click);
            var editChorusAccountDlg = WaitForOpenForm <EditRemoteAccountDlg>();

            RunUI(() =>
            {
                editChorusAccountDlg.SetRemoteAccount(chorusAccount);
            });
            OkDialog(editChorusAccountDlg, editChorusAccountDlg.OkDialog);
            Assert.AreEqual(chorusAccount.GetChorusUrl(), openDataSourceDialog.CurrentDirectory);
            RunUI(() =>
            {
                openDataSourceDialog.CurrentDirectory = chorusAccount.GetChorusUrl().AddPathPart("myFiles");
            });
            WaitForConditionUI(() => !openDataSourceDialog.WaitingForData);
            RunUI(() =>
            {
                openDataSourceDialog.SelectFile("2013_03_13_UWash_S1_MSE_Adj_001.raw.zip");
                openDataSourceDialog.SelectFile("2013_03_13_UWash_S2_MSE_Adj_001.raw.zip");
            });
            OkDialog(openDataSourceDialog, openDataSourceDialog.Open);
            ImportResultsNameDlg importResultsNameDlg = WaitForOpenForm <ImportResultsNameDlg>();

            OkDialog(importResultsNameDlg, importResultsNameDlg.NoDialog);
            WaitForConditionUI(() =>
                               SkylineWindow.DocumentUI.Settings.HasResults &&
                               SkylineWindow.DocumentUI.Settings.MeasuredResults.IsLoaded
                               );
            Assert.AreEqual(2, SkylineWindow.Document.Settings.MeasuredResults.Chromatograms.Count);
        }