Beispiel #1
0
        //Calculate score based on All possible Products Masses for inter- or intra- crosslinks and deadend.
        public static void XlLocalizationForLoopCrosslink(Ms2ScanWithSpecificMass theScan, PsmCross psmCross, double modMass, CrosslinkerTypeClass crosslinker, List <ProductType> lp, Tolerance fragmentTolerance, List <int> linkPos)
        {
            var pmmhList = PsmCross.XlCalculateTotalProductMassesForLoopCrosslink(psmCross, modMass, crosslinker, lp, linkPos);

            List <double>         scoreList = new List <double>();
            List <MatchedIonInfo> miil      = new List <MatchedIonInfo>();

            foreach (var pmm in pmmhList)
            {
                var    matchedIonMassesListPositiveIsMatch = new MatchedIonInfo(pmm.ProductMz.Length);
                double pmmScore = PsmCross.XlMatchIons(theScan.TheScan, fragmentTolerance, pmm.ProductMz, pmm.ProductName, matchedIonMassesListPositiveIsMatch);
                miil.Add(matchedIonMassesListPositiveIsMatch);
                scoreList.Add(pmmScore);
            }

            psmCross.XLBestScore    = scoreList.Max();
            psmCross.MatchedIonInfo = miil[scoreList.IndexOf(scoreList.Max())];
            psmCross.XlPos          = pmmhList[scoreList.IndexOf(scoreList.Max())].XlPos + 1;
            psmCross.XlPos2         = pmmhList[scoreList.IndexOf(scoreList.Max())].XlPos2 + 1;
        }
Beispiel #2
0
        //Calculate score based on All possible Products Masses for inter- or intra- crosslinks and deadend.
        public static void XlLocalization(Ms2ScanWithSpecificMass theScan, PsmCross psmCross, double modMass,
                                          CrosslinkerTypeClass crosslinker, List <ProductType> lp, Tolerance fragmentTolerance, bool Charge_2_3, bool Charge_2_3_PrimeFragment, List <int> linkPos)
        {
            var pmmhList = PsmCross.XlCalculateTotalProductMasses(psmCross, modMass, crosslinker, lp, Charge_2_3, Charge_2_3_PrimeFragment, linkPos);

            List <double>         scoreList = new List <double>();
            List <MatchedIonInfo> miil      = new List <MatchedIonInfo>();

            foreach (var pmm in pmmhList)
            {
                var    matchedIonMassesListPositiveIsMatch = new MatchedIonInfo(pmm.ProductMz.Length);
                double pmmScore = PsmCross.XlMatchIons(theScan.TheScan, fragmentTolerance, pmm.ProductMz, pmm.ProductName, matchedIonMassesListPositiveIsMatch);
                miil.Add(matchedIonMassesListPositiveIsMatch);
                scoreList.Add(pmmScore);
            }

            psmCross.XLBestScore    = scoreList.Max();
            psmCross.MatchedIonInfo = miil[scoreList.IndexOf(scoreList.Max())];
            psmCross.XlPos          = pmmhList[scoreList.IndexOf(scoreList.Max())].XlPos + 1;
            if (crosslinker.Cleavable)
            {
                psmCross.ParentIonMaxIntensityRanks = new List <int>();
                if (psmCross.MatchedIonInfo.MatchedIonName.Any(p => p != null && p.Contains("PepS")))
                {
                    psmCross.ParentIonExist    += "PepS";
                    psmCross.ParentIonExistNum += 1;
                }
                if (psmCross.MatchedIonInfo.MatchedIonName.Any(p => p != null && p.Contains("PepL")))
                {
                    psmCross.ParentIonExist    += "PepL";
                    psmCross.ParentIonExistNum += 1;
                }
                //if (psmCross.MatchedIonInfo.MatchedIonName.Any(p => p != null && p.Equals("PepS2")))
                //{
                //    psmCross.ParentIonExist += "PepS2";
                //    psmCross.ParentIonExistNum += 1;
                //}
                //if (psmCross.MatchedIonInfo.MatchedIonName.Any(p => p != null && p.Equals("PepL2")))
                //{
                //    psmCross.ParentIonExist += "PepL2";
                //    psmCross.ParentIonExistNum += 1;
                //}
                for (int i = 0; i < psmCross.MatchedIonInfo.MatchedIonName.Length; i++)
                {
                    if (psmCross.MatchedIonInfo.MatchedIonName[i] != null)
                    {
                        if (psmCross.MatchedIonInfo.MatchedIonName[i].Contains("Pep"))
                        {
                            psmCross.ParentIonMaxIntensityRanks.Add(psmCross.MatchedIonInfo.MatchedIonIntensityRank[i]);
                        }
                    }
                }
            }
            if (Charge_2_3 || Charge_2_3_PrimeFragment)
            {
                int Charge2IonExist = 0;
                for (int i = 0; i < psmCross.MatchedIonInfo.MatchedIonName.Length; i++)
                {
                    if (psmCross.MatchedIonInfo.MatchedIonName[i] != null && (psmCross.MatchedIonInfo.MatchedIonName[i].Contains("t2") || psmCross.MatchedIonInfo.MatchedIonName[i].Contains("t3")))
                    {
                        Charge2IonExist++;
                    }
                }
                psmCross.Charge2IonExist = Charge2IonExist;
            }
        }