Esempio n. 1
0
        public override void Execute(ResultCollection resultList)
        {
            Check.Require(resultList.Run.CurrentMassTag != null, string.Format("{0} failed. Mass tags haven't been defined.", Name));
            if (resultList.Run.CurrentMassTag == null)
            {
                return;
            }

            resultList.ResultType = Globals.ResultType.N14N15_TARGETED_RESULT;

            _FeatureGenerator.GenerateTheorFeature(resultList.Run.CurrentMassTag);   //generate theor profile for unlabeled feature
            var labeledProfile = _N15IsotopicProfileGenerator.GetN15IsotopicProfile(resultList.Run.CurrentMassTag, 0.005);

            var chromExtractor = new IsotopicProfileMultiChromatogramExtractor(
                NumPeaksForGeneratingChrom, ToleranceInPPM);

            var massTagResult = resultList.CurrentTargetedResult;

            if (!(massTagResult is N14N15_TResult n14n15result))
            {
                throw new InvalidOperationException(string.Format("{0} failed. There was a problem with the Result type; massTagResult is not class N14N15_TResult ", Name));
            }

            n14n15result.UnlabeledPeakChromData = chromExtractor.GetChromatogramsForIsotopicProfilePeaks(resultList.MSPeakResultList, resultList.Run.CurrentMassTag.IsotopicProfile);
            n14n15result.LabeledPeakChromData   = chromExtractor.GetChromatogramsForIsotopicProfilePeaks(resultList.MSPeakResultList, labeledProfile);
        }
Esempio n. 2
0
        public void test1()
        {
            Run     run = new XCaliburRun(xcaliburTestfile);
            MassTag mt  = TestUtilities.GetMassTagStandard(1);

            PeakImporterFromText peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(xcaliburPeakDataFile);

            peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList);

            run.CurrentMassTag = mt;

            Task theorFeatureGen = new TomTheorFeatureGenerator();

            theorFeatureGen.Execute(run.ResultCollection);


            int numPeaksForExtractingChrom = 3;
            int toleranceInPPM             = 25;

            IsotopicProfileMultiChromatogramExtractor multiChromExtractor = new IsotopicProfileMultiChromatogramExtractor(
                numPeaksForExtractingChrom, toleranceInPPM);

            List <int> ms1Levels = run.GetMSLevelScanValues();

            Dictionary <MSPeak, XYData> chromDataForIsotopicProfile = multiChromExtractor.GetChromatogramsForIsotopicProfilePeaks(run.ResultCollection.MSPeakResultList, run.CurrentMassTag.IsotopicProfile, true, ms1Levels);

            multiChromExtractor.SmoothChromatograms(chromDataForIsotopicProfile, new DeconTools.Backend.ProcessingTasks.Smoothers.DeconToolsSavitzkyGolaySmoother(11, 11, 2));
            XYData xydata1 = chromDataForIsotopicProfile.Values.First();
            XYData xydata2 = chromDataForIsotopicProfile.Values.ElementAt(1);
            XYData xydata3 = chromDataForIsotopicProfile.Values.ElementAt(2);



            TestUtilities.DisplayXYValues(xydata3);
        }