public void serializeUIMFDataTest1()
        {
            Run        run           = new UIMFRun(uimfFilepath2);
            List <Run> runCollection = new List <Run>();

            runCollection.Add(run);

            int startFrame = 1200;
            int stopFrame  = 1205;

            int numFramesSummed = 3;
            int numScansSummed  = 3;


            FrameSetCollectionCreator framesetCreator = new FrameSetCollectionCreator(run, startFrame, stopFrame, numFramesSummed, 1);

            framesetCreator.Create();

            ScanSetCollectionCreator scanSetCreator = new ScanSetCollectionCreator(run, numScansSummed, 1);

            scanSetCreator.Create();

            Task msgen = new UIMF_MSGenerator();

            DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters();
            detectorParams.PeakBackgroundRatio    = 3;
            detectorParams.PeakFitType            = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC;
            detectorParams.SignalToNoiseThreshold = 3;
            detectorParams.ThresholdedData        = true;

            Task peakdetector = new DeconToolsPeakDetector(detectorParams);

            Task decon = new RapidDeconvolutor();

            TaskCollection taskcollection = new TaskCollection();

            taskcollection.TaskList.Add(msgen);
            taskcollection.TaskList.Add(peakdetector);
            taskcollection.TaskList.Add(decon);


            TaskController taskcontroller = new UIMF_TaskController(taskcollection);

            taskcontroller.IsosResultThresholdNum = 50;
            taskcontroller.Execute(runCollection);


            ResultCollection       results;
            IsosResultDeSerializer deserializer = new IsosResultDeSerializer(run.Filename + "_tmp.bin");
            int counter = 0;

            do
            {
                counter++;
                results = deserializer.GetNextSetOfResults();
            } while (results != null);

            Assert.AreEqual(8, counter);
        }
        public void test1_summing()
        {
            Project.Reset();
            Project project = Project.getInstance();

            UIMFRun run = new UIMFRun(uimfFilepath, 1201, 1201);

            project.RunCollection.Add(run);

            int numFramesSummed = 3;
            int numScansSummed  = 3;

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 250, 270, numScansSummed, 1);

            sscc.Create();

            FrameSetCollectionCreator fscc = new FrameSetCollectionCreator(run, run.MinFrame, run.MaxFrame, numFramesSummed, 1);

            fscc.Create();

            Task msGen = new UIMF_MSGenerator(200, 2000);

            DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters();
            detectorParams.PeakBackgroundRatio    = 3;
            detectorParams.PeakFitType            = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC;
            detectorParams.SignalToNoiseThreshold = 3;
            Task peakDetector = new DeconToolsPeakDetector(detectorParams);

            Task decon = new HornDeconvolutor();

            Task scanResultsUpdater = new ScanResultUpdater();

            Task originalIntensitiesExtractor = new OriginalIntensitiesExtractor();


            project.TaskCollection.TaskList.Add(msGen);
            project.TaskCollection.TaskList.Add(peakDetector);
            project.TaskCollection.TaskList.Add(decon);
            project.TaskCollection.TaskList.Add(scanResultsUpdater);
            project.TaskCollection.TaskList.Add(originalIntensitiesExtractor);

            TaskController controller = new UIMF_TaskController(project.TaskCollection);

            controller.Execute(project.RunCollection);

            ResultCollection rc = project.RunCollection[0].ResultCollection;

            Assert.AreEqual(180, rc.ResultList.Count);

            StringBuilder sb = new StringBuilder();

            IsosResultUtilities.DisplayResults(sb, rc.ResultList);
            Console.Write(sb.ToString());
        }
        public void multipleFrames_horn_test1()
        {
            Project.Reset();
            Project project = Project.getInstance();

            project.LoadOldDecon2LSParameters(uimfParameters1);

            UIMFRun run = new UIMFRun(uimfFilepath, 1201, 1203);

            project.RunCollection.Add(run);

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 9, 1);

            sscc.Create();

            FrameSetCollectionCreator fscc = new FrameSetCollectionCreator(run, run.MinFrame, run.MaxFrame, 1, 1);

            fscc.Create();

            Task msGen      = new UIMF_MSGenerator(0, 5000);
            Task zeroFiller = new DeconToolsZeroFiller(3);

            Task peakDetector = new DeconToolsPeakDetector(project.Parameters.OldDecon2LSParameters.PeakProcessorParameters);

            Task decon = new HornDeconvolutor(project.Parameters.OldDecon2LSParameters.HornTransformParameters);

            Task scanResultsUpdater = new ScanResultUpdater();

            project.TaskCollection.TaskList.Add(msGen);
            project.TaskCollection.TaskList.Add(zeroFiller);

            project.TaskCollection.TaskList.Add(peakDetector);
            project.TaskCollection.TaskList.Add(decon);
            project.TaskCollection.TaskList.Add(scanResultsUpdater);

            Stopwatch sw = new Stopwatch();

            sw.Start();
            TaskController controller = new UIMF_TaskController(project.TaskCollection);

            controller.Execute(project.RunCollection);
            sw.Stop();

            Console.WriteLine("Time required (ms) = " + sw.ElapsedMilliseconds);
            Console.WriteLine("Scans analyzed = " + project.RunCollection[0].ScanSetCollection.ScanSetList.Count);
            Console.WriteLine("Features found = " + project.RunCollection[0].ResultCollection.ResultList.Count);
            Console.WriteLine("Peaks found = " + project.RunCollection[0].ResultCollection.ScanResultList[0].NumPeaks);



            StringBuilder sb = new StringBuilder();
        }
        public void test1()
        {
            Project project = Project.getInstance();
            //TODO:  add project parameters  (for summing)

            Run run = new UIMFRun(uimfFilepath, 1200, 1202, 300, 400);

            project.RunCollection.Add(run);

            FrameSetCollectionCreator framesetCreator = new FrameSetCollectionCreator(run, ((UIMFRun)run).MinFrame, ((UIMFRun)run).MaxFrame, 1, 1);

            framesetCreator.Create();

            ScanSetCollectionCreator scanSetcreator = new ScanSetCollectionCreator(run, run.MinScan, run.MaxScan, 1, 1, false);

            scanSetcreator.Create();

            Task msGen = new UIMF_MSGenerator(200, 2000);

            DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters();
            detectorParams.PeakBackgroundRatio    = 3;
            detectorParams.PeakFitType            = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC;
            detectorParams.SignalToNoiseThreshold = 3;
            detectorParams.ThresholdedData        = false;
            Task peakDetector = new DeconToolsPeakDetector(detectorParams);

            Task rapidDecon = new RapidDeconvolutor();

            Task scanresultUpdater = new ScanResultUpdater();


            project.TaskCollection.TaskList.Add(msGen);
            project.TaskCollection.TaskList.Add(peakDetector);
            project.TaskCollection.TaskList.Add(rapidDecon);
            project.TaskCollection.TaskList.Add(scanresultUpdater);

            TaskController controller = new UIMF_TaskController(project.TaskCollection);

            controller.Execute(project.RunCollection);

            UIMFScansExporter scansExporter = new UIMFScansExporter(uimfScansExporterTest1output);

            scansExporter.Export(project.RunCollection[0].ResultCollection);
        }
        public void smallExportTest1()
        {
            Project project = Project.getInstance();

            //TODO:  add project parameters  (for summing)

            project.RunCollection.Add(new UIMFRun(uimfFilepath, 1200, 1202, 250, 300));

            Task msGen = new UIMF_MSGenerator(200, 2000);

            DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters();
            detectorParams.PeakBackgroundRatio    = 3;
            detectorParams.PeakFitType            = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC;
            detectorParams.SignalToNoiseThreshold = 3;
            detectorParams.ThresholdedData        = false;
            Task peakDetector = new DeconToolsPeakDetector(detectorParams);

            Task decon = new HornDeconvolutor();

            Task driftTimeExtractor = new UIMFDriftTimeExtractor();


            project.TaskCollection.TaskList.Add(msGen);
            project.TaskCollection.TaskList.Add(peakDetector);
            project.TaskCollection.TaskList.Add(decon);
            project.TaskCollection.TaskList.Add(driftTimeExtractor);


            TaskController controller = new UIMF_TaskController(project.TaskCollection);

            controller.Execute(project.RunCollection);

            UIMFIsosExporter isosExporter = new UIMFIsosExporter(uimfIsosExporterTest1output);

            isosExporter.Export(project.RunCollection[0].ResultCollection);
        }
        public void multipleFrames_horn_test4()
        {
            Project.Reset();

            //Project.getInstance().LoadOldDecon2LSParameters(uimfParameters1);

            UIMFRun run = new UIMFRun(uimfFilepath, 1202, 1202);

            Project.getInstance().RunCollection.Add(run);


            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 9, 1);

            sscc.Create();

            FrameSetCollectionCreator fscc = new FrameSetCollectionCreator(run, run.MinFrame, run.MaxFrame, 1, 1);

            fscc.Create();

            Task msGen      = new UIMF_MSGenerator(0, 5000);
            Task zeroFiller = new DeconToolsZeroFiller(3);


            DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters();
            detectorParams.PeakBackgroundRatio    = 4;
            detectorParams.SignalToNoiseThreshold = 3;
            detectorParams.PeakFitType            = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC;


            Task peakDetector = new DeconToolsPeakDetector(detectorParams);


            DeconToolsV2.HornTransform.clsHornTransformParameters hornParams = new DeconToolsV2.HornTransform.clsHornTransformParameters();
            hornParams.CompleteFit               = true;
            hornParams.LeftFitStringencyFactor   = 2.5;
            hornParams.RightFitStringencyFactor  = 0.5;
            hornParams.PeptideMinBackgroundRatio = 4;
            hornParams.MaxFit            = 0.4;
            hornParams.UseMZRange        = false;
            hornParams.UseMercuryCaching = true;

            Task decon = new HornDeconvolutor(hornParams);

            Task scanResultsUpdater = new ScanResultUpdater();

            Project.getInstance().TaskCollection.TaskList.Add(msGen);
            Project.getInstance().TaskCollection.TaskList.Add(zeroFiller);

            Project.getInstance().TaskCollection.TaskList.Add(peakDetector);
            Project.getInstance().TaskCollection.TaskList.Add(decon);
            Project.getInstance().TaskCollection.TaskList.Add(scanResultsUpdater);

            Stopwatch sw = new Stopwatch();

            sw.Start();
            TaskController controller = new UIMF_TaskController(Project.getInstance().TaskCollection);

            controller.Execute(Project.getInstance().RunCollection);
            sw.Stop();

            Console.WriteLine("Time required (ms) = " + sw.ElapsedMilliseconds);
            Console.WriteLine("Scans analyzed = " + Project.getInstance().RunCollection[0].ScanSetCollection.ScanSetList.Count);
            Console.WriteLine("Features found = " + Project.getInstance().RunCollection[0].ResultCollection.ResultList.Count);
            Console.WriteLine("Peaks found = " + Project.getInstance().RunCollection[0].ResultCollection.ScanResultList[0].NumPeaks);



            StringBuilder sb = new StringBuilder();
        }
        public void test1()
        {
            Project.Reset();
            Project project = Project.getInstance();

            UIMFRun run = new UIMFRun(uimfFilepath, 1200, 1202);

            project.RunCollection.Add(run);

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 1, 1);

            sscc.Create();

            FrameSetCollectionCreator fscc = new FrameSetCollectionCreator(run, run.MinFrame, run.MaxFrame, 1, 1);

            fscc.Create();

            Task msGen = new UIMF_MSGenerator(200, 2000);

            DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters();
            detectorParams.PeakBackgroundRatio    = 3;
            detectorParams.PeakFitType            = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC;
            detectorParams.SignalToNoiseThreshold = 3;
            detectorParams.ThresholdedData        = false;
            Task peakDetector = new DeconToolsPeakDetector(detectorParams);

            Task rapidDecon = new RapidDeconvolutor();

            Task scanResultsUpdater = new ScanResultUpdater();

            project.TaskCollection.TaskList.Add(msGen);
            project.TaskCollection.TaskList.Add(peakDetector);
            project.TaskCollection.TaskList.Add(rapidDecon);
            project.TaskCollection.TaskList.Add(scanResultsUpdater);

            Stopwatch sw = new Stopwatch();

            sw.Start();
            TaskController controller = new UIMF_TaskController(project.TaskCollection);

            controller.Execute(project.RunCollection);
            sw.Stop();

            Console.WriteLine("Time required (ms) = " + sw.ElapsedMilliseconds);
            Console.WriteLine("Scans analyzed = " + project.RunCollection[0].ScanSetCollection.ScanSetList.Count);
            Console.WriteLine("Features found = " + project.RunCollection[0].ResultCollection.ResultList.Count);



            Assert.AreEqual(1, Project.getInstance().RunCollection.Count);
            Assert.AreEqual(4, project.TaskCollection.TaskList.Count);

            Assert.AreEqual(600, project.RunCollection[0].ScanSetCollection.ScanSetList.Count);

            UIMFRun uimfRun = (UIMFRun)(project.RunCollection[0]);

            Assert.AreEqual(3, uimfRun.FrameSetCollection.FrameSetList.Count);


            StringBuilder sb = new StringBuilder();

            foreach (IsosResult result in project.RunCollection[0].ResultCollection.ResultList)
            {
                Assert.IsInstanceOfType(typeof(UIMFIsosResult), result);
                UIMFIsosResult uimfResult = (UIMFIsosResult)result;
                sb.Append(uimfResult.FrameSet.PrimaryFrame);
                sb.Append("\t");
                sb.Append(uimfResult.ScanSet.PrimaryScanNumber);
                sb.Append("\t");
                sb.Append(uimfResult.IsotopicProfile.Peaklist[0].XValue);
                sb.Append("\t");
                sb.Append(uimfResult.IsotopicProfile.GetAbundance());
                sb.Append("\t");
                //sb.Append(uimfResult.IsotopicProfile.
                sb.Append(Environment.NewLine);
            }
            Console.Write(sb.ToString());
        }
Beispiel #8
0
        public void test1()
        {
            Run uimfrun    = new UIMFRun(inputUIMFFile1);
            int startFrame = 800;
            int stopFrame  = 800;

            int numFramesSummed = 3;
            int numScansSummed  = 9;

            FrameSetCollectionCreator framesetCreator = new FrameSetCollectionCreator(uimfrun, startFrame, stopFrame, numFramesSummed, 1);

            framesetCreator.Create();

            ScanSetCollectionCreator scansetCreator = new ScanSetCollectionCreator(uimfrun, 230, 240, numScansSummed, 1, false);

            scansetCreator.Create();

            Project project = Project.getInstance();

            project.RunCollection.Add(uimfrun);

            Task msGen = new UIMF_MSGenerator(200, 2000);


            DeconToolsV2.Peaks.clsPeakProcessorParameters detectorParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters();
            detectorParams.PeakBackgroundRatio    = 3;
            detectorParams.PeakFitType            = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC;
            detectorParams.SignalToNoiseThreshold = 3;
            detectorParams.ThresholdedData        = false;
            Task peakDetector = new DeconToolsPeakDetector(detectorParams);

            Task decon = new HornDeconvolutor();



            Task driftTimeExtractor = new UIMFDriftTimeExtractor();


            project.TaskCollection.TaskList.Add(msGen);
            project.TaskCollection.TaskList.Add(peakDetector);
            project.TaskCollection.TaskList.Add(decon);
            project.TaskCollection.TaskList.Add(driftTimeExtractor);


            TaskController controller = new UIMF_TaskController(project.TaskCollection);

            controller.Execute(project.RunCollection);

            Assert.AreEqual(252, project.RunCollection[0].ResultCollection.ResultList.Count);


            if (File.Exists(outputFile1))
            {
                File.Delete(outputFile1);
            }


            Stopwatch sw = new Stopwatch();

            sw.Start();
            UIMFSQLiteIsosExporter isosExporter = new UIMFSQLiteIsosExporter(outputFile1);

            isosExporter.Export(project.RunCollection[0].ResultCollection);

            sw.Stop();
            Console.Write("\n\n----------- Time taken for UIMFSQLiteIsosExporter (milliseconds) = \t" + sw.ElapsedMilliseconds);
        }