Exemplo n.º 1
0
        private void UpdateModel(int x)
        {
            Ms2ScanWithSpecificMass msScanForDraw = arrayOfMs2ScansSortedByMass.Where(p => p.OneBasedScanNumber == x).First();

            //mainViewModel.UpdateScanModel(msScanForDraw);

            PsmCross psmCross = PSMs.Where(p => p.ScanNumber == x).First();

            var lp = new List <ProductType> {
                ProductType.BnoB1ions, ProductType.Y
            };
            Tolerance productMassTolerance = new PpmTolerance(20);

            var pmm = PsmCross.XlCalculateTotalProductMassesForSingle(psmCross, lp, false);

            var matchedIonMassesListPositiveIsMatch = new MatchedIonInfo(pmm.ProductMz.Length);

            double pmmScore = PsmCross.XlMatchIons(msScanForDraw.TheScan, productMassTolerance, pmm.ProductMz, pmm.ProductName, matchedIonMassesListPositiveIsMatch);

            matchedIonMassesListPositiveIsMatch.PredictedIonName      = psmCross.ProductMassesMightHaveDuplicatesAndNaNs(lp).ProductName;
            matchedIonMassesListPositiveIsMatch.PredictedIonMZ        = psmCross.ProductMassesMightHaveDuplicatesAndNaNs(lp).ProductMz;
            matchedIonMassesListPositiveIsMatch.PredictedIonIntensity = predictedIntensities[psmCross.ScanNumber];

            psmCross.MatchedIonInfo = matchedIonMassesListPositiveIsMatch;


            mainViewModel.UpdateCrosslinkModelForSingle(msScanForDraw, psmCross);

            pdeepModelView.UpdataModelForPdeep(psmCross);
        }
Exemplo n.º 2
0
        public void TestMods()
        {
            PsmCross PSM = new PsmCross();

            PSM.BaseSequence           = "DMHGDSEYNIMFGPDICGPGTK";
            PSM.FullSequence           = "DM[Common Variable:Oxidation of M]HGDSEYNIM[Common Variable:Oxidation of M]FGPDIC[Common Fixed:Carbamidomethyl of C]GPGTK";
            PSM.PeptideMonisotopicMass = 2472.0032;

            var mods = TsvResultReader.GetMods(PSM);

            Dictionary <int, ModificationWithMass> allModsOneIsNterminus = new Dictionary <int, ModificationWithMass>();

            foreach (var item in mods)
            {
                ModificationMotif.TryGetMotif(item.Value, out ModificationMotif modificationMotif);

                ModificationWithMass mod = new ModificationWithMass("mod", null, modificationMotif, TerminusLocalization.Any, 10);

                allModsOneIsNterminus.Add(item.Key, mod);
            }

            PepWithSetModForCompactPep pepWithSetModForCompactPep = new PepWithSetModForCompactPep();

            pepWithSetModForCompactPep.allModsOneIsNterminus = allModsOneIsNterminus;
            pepWithSetModForCompactPep.BaseSequence          = PSM.BaseSequence;
            pepWithSetModForCompactPep.Length           = PSM.BaseSequence.Length;
            pepWithSetModForCompactPep.MonoisotopicMass = (double)PSM.PeptideMonisotopicMass;

            var compactPeptide = new CompactPeptide(pepWithSetModForCompactPep, TerminusType.None);

            PSM.CompactPeptide = compactPeptide;

            var lp = new List <ProductType> {
                ProductType.BnoB1ions, ProductType.Y
            };
            Tolerance productMassTolerance = new PpmTolerance(10);

            var pmm = PsmCross.XlCalculateTotalProductMassesForSingle(PSM, lp, false);

            var matchedIonMassesListPositiveIsMatch = new MatchedIonInfo(pmm.ProductMz.Length);
            //double pmmScore = PsmCross.XlMatchIons(theScan.TheScan, productMassTolerance, pmm.ProductMz, pmm.ProductName, matchedIonMassesListPositiveIsMatch);
        }