Пример #1
0
        public void executeWorkflowTest1()
        {
            var testFile  = FileRefs.SipperRawDataFile;
            var peaksFile =
                @"C:\Users\d3x720\Documents\PNNL\My_DataAnalysis\2012\C12C13YellowStone\2011_02_20_SIPPER_workflow_standards\Yellow_C13_070_23Mar10_Griffin_10-01-28_peaks.txt";

            peaksFile =
                @"\\protoapps\UserData\Slysz\Standard_Testing\Targeted_FeatureFinding\SIPPER_standard_testing\Yellow_C13_070_23Mar10_Griffin_10-01-28_peaks.txt";

            var run = RunUtilities.CreateAndLoadPeaks(testFile, peaksFile);


            var lcmsfeaturesFile =
                @"\\protoapps\UserData\Slysz\Standard_Testing\Targeted_FeatureFinding\SIPPER_standard_testing\Yellow_C13_070_23Mar10_Griffin_10-01-28_LCMSFeatures.txt";

            // load LCMSFeatures as targets
            var importer =
                new LcmsTargetFromFeaturesFileImporter(lcmsfeaturesFile);

            var lcmsTargetCollection = importer.Import();


            // load MassTags
            var massTagFile1 =
                @"\\protoapps\UserData\Slysz\Standard_Testing\Targeted_FeatureFinding\SIPPER_standard_testing\Yellow_C13_070_23Mar10_Griffin_10-01-28_MassTags.txt";

            var massTagImporter   = new MassTagFromTextFileImporter(massTagFile1);
            var massTagCollection = massTagImporter.Import();


            var masstagIDlist = (from n in massTagCollection.TargetList select n.ID).ToList();


            // Update LCMSFeatures using MassTag info

            int[] testMassTags = { 344540889, 344972415, 354881152, 355157363, 355162540, 355315129, 355054192, 355160150 };

            //testMassTags = new[] {344540889};

            //testMassTags = new int[]
            //                   {
            //                       354942933, 355066611, 354882356, 354928525, 17440471, 355046165, 355008036, 354977066,
            //                       355166304, 354879605, 344965520, 354870998, 355084057, 355034961, 354963652, 344969970,
            //                       355157492, 355176429, 355162540, 355244316, 355139611, 355036935, 355044786, 355139579,
            //                       355163558, 355065622, 355167968, 355033793, 354879421, 355090391, 355034165, 354880925,
            //                       344747857, 354879494, 355315129, 344968376, 355022502, 354879347, 354881152, 354879406,
            //                       344968302, 355037491, 355033717, 355034652, 354879414, 344972415, 355039789, 355025762,
            //                       355129038, 355355053, 354879164, 355037247, 355033862, 355034180, 355033668, 344540889,
            //                       355160123, 345073233, 354880183, 354879165, 354879192, 354879842, 355046211, 355033627,
            //                       355030074, 355033620, 354879142, 354879360, 355034183, 354879174, 354879150
            //                   };

            //no enrichment peptides:
            //testMassTags = new int[] { 355057553, 355058671, 355084418 };

            //enriched
            //testMassTags = new int[] { 355116553, 355129038, 355160150, 355162540, 355163371 };


            //testMassTags = new int[] { 355008295 };

            //co-elution peptides
            //testMassTags = new int[] {355034154, 355033668, 355154211, 355035781};

            //testMassTags = new int[] { 355033668 };


            //testMassTags = new int[]{355157492};

            testMassTags = new int[] { 355033977 };

            var filteredLcmsFeatureTargets = (from n in lcmsTargetCollection.TargetList
                                              where testMassTags.Contains(((LcmsFeatureTarget)n).FeatureToMassTagID)
                                              select n).ToList();


            foreach (LcmsFeatureTarget target in filteredLcmsFeatureTargets)
            {
                if (masstagIDlist.Contains(target.FeatureToMassTagID))
                {
                    var mt = massTagCollection.TargetList.Where(p => p.ID == target.FeatureToMassTagID).First();
                    target.Code             = mt.Code;
                    target.EmpiricalFormula = mt.EmpiricalFormula;
                }
                else
                {
                    //get target's code + empirical formula based on averagine model
                }
            }



            TargetedWorkflowParameters parameters = new BasicTargetedWorkflowParameters();

            parameters.ChromPeakSelectorMode = Globals.PeakSelectorMode.ClosestToTarget;

            var workflow = new SipperTargetedWorkflow(run, parameters);


            var outputFolder = @"C:\data\temp\SipperOutput";

            if (!Directory.Exists(outputFolder))
            {
                Directory.CreateDirectory(outputFolder);
            }


            var stopwatch = new Stopwatch();

            stopwatch.Start();
            foreach (var target in filteredLcmsFeatureTargets)
            {
                run.CurrentMassTag = target;

                workflow.Execute();

                OutputMassSpectrum(outputFolder, workflow.MassSpectrumXYData, target, workflow.Result as SipperLcmsTargetedResult);
            }
            stopwatch.Stop();

            foreach (var targetedResultBase in (run.ResultCollection.MassTagResultList))
            {
                var result = (SipperLcmsTargetedResult)targetedResultBase.Value;



                Console.WriteLine(result + "\t" + result.Target.IsotopicProfile.Peaklist.Count);
            }

            Console.WriteLine("Total workflow time (ms) = " + stopwatch.ElapsedMilliseconds);
            Console.WriteLine("Time per target (ms) = " + stopwatch.ElapsedMilliseconds / (double)filteredLcmsFeatureTargets.Count);
        }
Пример #2
0
        public void executeWorkflowTest1()
        {
            var testFile = FileRefs.SipperRawDataFile;


            var exportedResultFile = Path.Combine(FileRefs.OutputFolderPath, "ExportedSipperResults1.txt");


            var peaksFile =
                @"\\protoapps\UserData\Slysz\Standard_Testing\Targeted_FeatureFinding\SIPPER_standard_testing\Yellow_C13_070_23Mar10_Griffin_10-01-28_peaks.txt";

            var run = RunUtilities.CreateAndLoadPeaks(testFile, peaksFile);


            var lcmsfeaturesFile =
                @"\\protoapps\UserData\Slysz\Standard_Testing\Targeted_FeatureFinding\SIPPER_standard_testing\Yellow_C13_070_23Mar10_Griffin_10-01-28_LCMSFeatures.txt";

            // load LCMSFeatures as targets
            var importer =
                new LcmsTargetFromFeaturesFileImporter(lcmsfeaturesFile);

            var lcmsTargetCollection = importer.Import();


            // load MassTags
            var massTagFile1 =
                @"\\protoapps\UserData\Slysz\Standard_Testing\Targeted_FeatureFinding\SIPPER_standard_testing\Yellow_C13_070_23Mar10_Griffin_10-01-28_MassTags.txt";

            var massTagImporter   = new MassTagFromTextFileImporter(massTagFile1);
            var massTagCollection = massTagImporter.Import();

            //enriched
            var testMassTags = new int[] { 355116553, 355129038, 355160150, 355162540, 355163371 };


            var filteredLcmsFeatureTargets = (from n in lcmsTargetCollection.TargetList
                                              where testMassTags.Contains(((LcmsFeatureTarget)n).FeatureToMassTagID)
                                              select n).ToList();


            TargetCollection.UpdateTargetsWithMassTagInfo(filteredLcmsFeatureTargets, massTagCollection.TargetList);


            TargetedWorkflowParameters parameters = new BasicTargetedWorkflowParameters();

            parameters.ChromPeakSelectorMode = Globals.PeakSelectorMode.ClosestToTarget;

            var workflow = new SipperTargetedWorkflow(run, parameters);


            foreach (var target in filteredLcmsFeatureTargets)
            {
                run.CurrentMassTag = target;

                workflow.Execute();
            }



            var results = run.ResultCollection.GetMassTagResults();

            var repo = new TargetedResultRepository();

            repo.AddResults(run.ResultCollection.GetMassTagResults());

            var exporter = new SipperResultToLcmsFeatureExporter(exportedResultFile);

            exporter.ExportResults(repo.Results);
        }