Ejemplo n.º 1
0
        private void BuildLibrary(string inputDir, IEnumerable <string> inputFiles, string libraryPath,
                                  bool keepRedundant, bool includeAmbiguous, bool filterPeptides, bool append, IrtStandard irtStandard)
        {
            EnsurePeptideSettings();

            var           buildLibraryDlg = ShowDialog <BuildLibraryDlg>(PeptideSettingsUI.ShowBuildLibraryDlg);
            List <string> inputPaths      = null;

            if (inputFiles != null)
            {
                inputPaths = new List <string>(inputFiles).ConvertAll(f => Path.Combine(inputDir, f));
            }
            string autoLibPath = null;

            RunUI(() =>
            {
                if (libraryPath != null)
                {
                    buildLibraryDlg.LibraryPath = libraryPath;
                }
                buildLibraryDlg.LibraryName = _libraryName;
                autoLibPath = buildLibraryDlg.LibraryPath;
                buildLibraryDlg.LibraryKeepRedundant    = keepRedundant;
                buildLibraryDlg.IncludeAmbiguousMatches = includeAmbiguous;
                buildLibraryDlg.LibraryFilterPeptides   = filterPeptides;
                buildLibraryDlg.LibraryBuildAction      = (append ?
                                                           LibraryBuildAction.Append : LibraryBuildAction.Create);
                if (irtStandard != null && !irtStandard.Equals(IrtStandard.EMPTY))
                {
                    buildLibraryDlg.IrtStandard = irtStandard;
                }
                buildLibraryDlg.OkWizardPage();
                if (inputPaths != null)
                {
                    buildLibraryDlg.AddInputFiles(inputPaths);
                }
                else
                {
                    buildLibraryDlg.AddDirectory(inputDir);
                }
            });
            OkDialog(buildLibraryDlg, buildLibraryDlg.OkWizardPage);

            if (inputPaths != null)
            {
                foreach (var inputFile in inputPaths)
                {
                    if (BiblioSpecLiteBuilder.HasEmbeddedSpectra(inputFile))
                    {
                        var embeddedSpectraDlg = WaitForOpenForm <MultiButtonMsgDlg>();
                        OkDialog(embeddedSpectraDlg, embeddedSpectraDlg.BtnYesClick);
                    }
                }
            }

            Assert.AreEqual(TestFilesDir.GetTestPath(_libraryName + BiblioSpecLiteSpec.EXT),
                            autoLibPath);
        }
Ejemplo n.º 2
0
        private void BuildLibrary(string inputDir, IEnumerable <string> inputFiles,
                                  string libraryPath, bool keepRedundant, bool filterPeptides, bool append, IrtStandard irtStandard)
        {
            EnsurePeptideSettings();

            var           buildLibraryDlg = ShowDialog <BuildLibraryDlg>(PeptideSettingsUI.ShowBuildLibraryDlg);
            List <string> inputPaths      = null;

            if (inputFiles != null)
            {
                inputPaths = new List <string>(inputFiles).ConvertAll(f => Path.Combine(inputDir, f));
            }
            string autoLibPath = null;

            RunUI(() =>
            {
                if (libraryPath != null)
                {
                    buildLibraryDlg.LibraryPath = libraryPath;
                }
                buildLibraryDlg.LibraryName = _libraryName;
                autoLibPath = buildLibraryDlg.LibraryPath;
                buildLibraryDlg.LibraryKeepRedundant  = keepRedundant;
                buildLibraryDlg.LibraryFilterPeptides = filterPeptides;
                buildLibraryDlg.LibraryBuildAction    = (append ?
                                                         LibraryBuildAction.Append : LibraryBuildAction.Create);
                if (irtStandard != null && !irtStandard.Equals(IrtStandard.NULL))
                {
                    buildLibraryDlg.IrtStandard = irtStandard;
                }
                buildLibraryDlg.OkWizardPage();
                if (inputPaths != null)
                {
                    buildLibraryDlg.AddInputFiles(inputPaths);
                }
                else
                {
                    buildLibraryDlg.AddDirectory(inputDir);
                }
            });
            OkDialog(buildLibraryDlg, buildLibraryDlg.OkWizardPage);
            Assert.AreEqual(TestFilesDir.GetTestPath(_libraryName + BiblioSpecLiteSpec.EXT),
                            autoLibPath);
        }