示例#1
0
        public void OnMsMsSearchResultChange(SpectrumSearchResult spectrumSearchResult)
        {
            CurrentSpectrumSearchResult = spectrumSearchResult;
            CurrentLipidTarget          = LipidUtil.CreateLipidTarget((spectrumSearchResult.HcdSpectrum ?? spectrumSearchResult.CidSpectrum).IsolationWindow.IsolationWindowTargetMz, TargetFragmentationMode, TargetAdduct);

            OnPropertyChanged("CurrentSpectrumSearchResult");
            OnPropertyChanged("CurrentLipidTarget");
        }
示例#2
0
        public LipidTarget CreateLipidTarget()
        {
            Adduct            adduct;
            FragmentationMode fragmentationMode;

            if (AdductFull == "[M+H]+")
            {
                adduct            = Adduct.Hydrogen;
                fragmentationMode = FragmentationMode.Positive;
            }
            else if (AdductFull == "[M+NH4]+")
            {
                adduct            = Adduct.Ammonium;
                fragmentationMode = FragmentationMode.Positive;
            }
            else if (AdductFull == "[M+Na]+")
            {
                adduct            = Adduct.Sodium;
                fragmentationMode = FragmentationMode.Positive;
            }
            else if (AdductFull == "[M+K]+")
            {
                adduct            = Adduct.Potassium;
                fragmentationMode = FragmentationMode.Positive;
            }
            else if (AdductFull == "[M+Oac]-")
            {
                adduct            = Adduct.Acetate;
                fragmentationMode = FragmentationMode.Negative;
            }
            else if (AdductFull == "[M-H]-")
            {
                adduct            = Adduct.Hydrogen;
                fragmentationMode = FragmentationMode.Negative;
            }
            else if (AdductFull == "[M-2H]--")
            {
                adduct            = Adduct.Dihydrogen;
                fragmentationMode = FragmentationMode.Negative;
            }
            else
            {
                throw new SystemException("Unknown adduct: " + AdductFull);
            }

            var lipidTarget = LipidUtil.CreateLipidTarget(CommonName, fragmentationMode, adduct);

            return(lipidTarget);
        }
示例#3
0
        public void SearchForTarget(string commonName, Adduct adduct, FragmentationMode fragmentationMode, double hcdMassError, double cidMassError)
        {
            CurrentLipidTarget = LipidUtil.CreateLipidTarget(commonName, fragmentationMode, adduct);
            OnPropertyChanged("CurrentLipidTarget");

            SpectrumSearchResultList = InformedWorkflow.RunInformedWorkflow(CurrentLipidTarget, LcMsRun, hcdMassError, cidMassError, ScoreModel);
            OnPropertyChanged("SpectrumSearchResultList");

            if (SpectrumSearchResultList.Any())
            {
                var spectrumSearchResult = SpectrumSearchResultList.OrderByDescending(x => x.NumMatchingMsMsPeaks).First();
                OnSpectrumSearchResultChange(spectrumSearchResult);
            }
            else
            {
                CurrentSpectrumSearchResult = null;
            }
        }
示例#4
0
        public void SearchForFragments(double hcdError, double cidError, FragmentationMode fragmentationMode, int numResultsPerScanToInclude, int minMatches, Adduct adduct)
        {
            IProgress <int> progress = new Progress <int>(ReportFragmentSearchProgress);

            SpectrumSearchResultList = InformedWorkflow.RunFragmentWorkflow(FragmentSearchList, LcMsRun, hcdError, cidError, minMatches, progress);
            OnPropertyChanged("SpectrumSearchResultList");
            progress.Report(0);
            if (SpectrumSearchResultList.Any())
            {
                var spectrumSearchResult =
                    SpectrumSearchResultList.OrderByDescending(x => x.ApexScanNum).First();
                CurrentLipidTarget = LipidUtil.CreateLipidTarget((spectrumSearchResult.HcdSpectrum ?? spectrumSearchResult.CidSpectrum).IsolationWindow.IsolationWindowTargetMz, fragmentationMode, adduct);
                //OnMsMsSearchResultChange(spectrumSearchResult);
                OnSpectrumSearchResultChange(spectrumSearchResult);
            }
            else
            {
                CurrentSpectrumSearchResult = null;
            }
        }
示例#5
0
        public void TestSingleTarget()
        {
            // Testing PC(16:0/18:1) +H
            const string            commonName        = "PC(16:0/18:1)";
            const string            empiricalFormula  = "C42H83NO8P";
            const LipidClass        lipidClass        = LipidClass.PC;
            const FragmentationMode fragmentationMode = FragmentationMode.Positive;
            var acylChainList = new List <AcylChain> {
                new AcylChain("16:0"), new AcylChain("18:1")
            };

            var lipidTarget = LipidUtil.CreateLipidTarget(commonName, empiricalFormula, lipidClass, fragmentationMode, acylChainList);

            var rawFileLocation  = @"../../../testFiles/XGA121_lipid_Skin_1.raw";
            var informedWorkflow = new InformedWorkflow(rawFileLocation);
            var resultList       = informedWorkflow.RunInformedWorkflow(lipidTarget, 30, 500);

            foreach (var result in resultList.OrderByDescending(x => x.GetNumMatchingMsMsPeaks()))
            {
                Console.WriteLine(result.Xic.GetApexScanNum() + " - " + result.HcdSpectrum.ScanNum + " - " + result.CidSpectrum.ScanNum + " - " + result.GetNumMatchingMsMsPeaks());
            }
        }
示例#6
0
        public void TestSingleConfidentTarget()
        {
            // Testing PE(18:3/20:5) +H
            const string            commonName        = "PE(18:3/20:5)";
            const string            empiricalFormula  = "C43H71NO8P";
            const LipidClass        lipidClass        = LipidClass.PE;
            const FragmentationMode fragmentationMode = FragmentationMode.Positive;
            var acylChainList = new List <AcylChain> {
                new AcylChain("18:3"), new AcylChain("20:5")
            };

            var lipidTarget = LipidUtil.CreateLipidTarget(commonName, empiricalFormula, lipidClass, fragmentationMode, acylChainList);

            var rawFileLocation  = @"../../../testFiles/Daphnia_gut_TLE_POS_Gimli_21Jan14_13-07-01.raw";
            var informedWorkflow = new InformedWorkflow(rawFileLocation);
            var resultList       = informedWorkflow.RunInformedWorkflow(lipidTarget, 30, 500);

            foreach (var result in resultList.OrderByDescending(x => x.GetNumMatchingMsMsPeaks()))
            {
                Console.WriteLine(result.Xic.GetApexScanNum() + " - " + result.HcdSpectrum.ScanNum + " - " + result.CidSpectrum.ScanNum + " - " + result.GetNumMatchingMsMsPeaks());
            }
        }