public void outputToText_xcaliburData_Test2()
        {
            string testFile = xcalibur_text_IsosResultOutputFile1;



            List <Run> runcoll = new List <Run>();
            Run        run     = new XCaliburRun(xcaliburFile1);

            runcoll.Add(run);

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 6000, 6020, 1, 1, false);

            sscc.Create();

            Task msgen        = new GenericMSGenerator();
            Task peakDetector = new DeconToolsPeakDetector();
            Task decon        = new HornDeconvolutor();
            Task flagger      = new ResultValidatorTask();
            BasicIsosResultTextFileExporter isosExporter = new BasicIsosResultTextFileExporter(testFile);


            Stopwatch sw;

            foreach (ScanSet scan in run.ScanSetCollection.ScanSetList)
            {
                run.CurrentScanSet = scan;
                msgen.Execute(run.ResultCollection);
                peakDetector.Execute(run.ResultCollection);

                decon.Execute(run.ResultCollection);
                flagger.Execute(run.ResultCollection);
            }

            isosExporter.ExportIsosResults(run.ResultCollection.ResultList);

            Assert.AreEqual(true, File.Exists(testFile));

            FileInfo fi = new FileInfo(testFile);

            //Assert.AreEqual(25881, fi.Length);
            Console.Write(fi.Length);
        }
Example #2
0
        public static IsosResultExporter CreateIsosExporter(Globals.ResultType resultType, Globals.ExporterType exporterType, string outputFileName)
        {
            IsosResultExporter isosExporter;

            switch (resultType)
            {
            case Globals.ResultType.BASIC_TRADITIONAL_RESULT:
                switch (exporterType)
                {
                case Globals.ExporterType.Text:
                    isosExporter = new BasicIsosResultTextFileExporter(outputFileName, TriggerToExportValue);
                    break;

                case Globals.ExporterType.Sqlite:
                    isosExporter = new BasicIsosResultSqliteExporter(outputFileName, TriggerToExportValue);
                    break;

                default:
                    isosExporter = new BasicIsosResultTextFileExporter(outputFileName, TriggerToExportValue);
                    break;
                }

                break;

            case Globals.ResultType.UIMF_TRADITIONAL_RESULT:
                switch (exporterType)
                {
                case Globals.ExporterType.Text:
                    isosExporter = new UIMFIsosResultTextFileExporter(outputFileName, TriggerToExportValue);
                    break;

                case Globals.ExporterType.Sqlite:
                    isosExporter = new UIMFIsosResultSqliteExporter(outputFileName, TriggerToExportValue);
                    break;

                default:
                    isosExporter = new UIMFIsosResultTextFileExporter(outputFileName, TriggerToExportValue);
                    break;
                }

                break;

            case Globals.ResultType.IMS_TRADITIONAL_RESULT:
                switch (exporterType)
                {
                case Globals.ExporterType.Text:
                    isosExporter = new IMFIsosResult_TextFileExporter(outputFileName, TriggerToExportValue);
                    break;

                case Globals.ExporterType.Sqlite:
                    throw new NotImplementedException();

                default:
                    isosExporter = new IMFIsosResult_TextFileExporter(outputFileName, TriggerToExportValue);
                    break;
                }

                break;

            case Globals.ResultType.O16O18_TRADITIONAL_RESULT:
                switch (exporterType)
                {
                case Globals.ExporterType.Text:
                    isosExporter = new O16O18IsosResultTextFileExporter(outputFileName, TriggerToExportValue);
                    break;

                case Globals.ExporterType.Sqlite:
                    throw new NotImplementedException();

                default:
                    isosExporter = new IMFIsosResult_TextFileExporter(outputFileName, TriggerToExportValue);
                    break;
                }
                break;

            case Globals.ResultType.BASIC_TARGETED_RESULT:
                throw new ApplicationException("Cannot create IsosExporter for Targeted-type results");

            case Globals.ResultType.O16O18_TARGETED_RESULT:
                throw new ApplicationException("Cannot create IsosExporter for Targeted-type results");

            case Globals.ResultType.N14N15_TARGETED_RESULT:
                throw new ApplicationException("Cannot create IsosExporter for Targeted-type results");

            case Globals.ResultType.DEUTERATED_TARGETED_RESULT:
                throw new ApplicationException("Cannot create IsosExporter for Targeted-type results");

            default:
                throw new ApplicationException("Cannot create IsosExporter for this type of Result: " + resultType);
            }

            return(isosExporter);
        }