Example #1
0
        public void TestSingleAminoAcidLinkedPeptide()
        {
            var srmSettings                = SrmSettingsList.GetDefault();
            var mainPeptide                = new Peptide("A");
            var staticMod                  = new StaticMod("crosslinker", null, null, "-C2");
            var linkedPeptide              = new LinkedPeptide(new Peptide("D"), 0, null);
            var mainTransitionGroup        = new TransitionGroup(mainPeptide, Adduct.SINGLY_PROTONATED, IsotopeLabelType.light);
            var mainTransitionGroupDocNode = new TransitionGroupDocNode(mainTransitionGroup,
                                                                        Annotations.EMPTY, srmSettings, null, null,
                                                                        ExplicitTransitionGroupValues.EMPTY, null, new TransitionDocNode[0], false);
            var modsWithoutLinkedPeptide = new ExplicitMods(mainPeptide, new[] { new ExplicitMod(0, staticMod), }, new TypedExplicitModifications[0]);

            Assert.AreEqual("C3H7NO2", AminoAcidFormulas.Default.GetFormula("A").ToString());
            Assert.AreEqual("C3H7NO2", mainTransitionGroupDocNode.GetNeutralFormula(srmSettings, null).Molecule.ToString());
            Assert.AreEqual("CH7NO2", mainTransitionGroupDocNode.GetNeutralFormula(srmSettings, modsWithoutLinkedPeptide).Molecule.ToString());
            Assert.AreEqual("C4H7NO4", AminoAcidFormulas.Default.GetFormula("D").ToString());
            var modsWithLinkedPeptide = new ExplicitMods(mainPeptide,
                                                         new[] { new ExplicitMod(0, staticMod).ChangeLinkedPeptide(linkedPeptide) },
                                                         new TypedExplicitModifications[0]);

            Assert.AreEqual("C5H14N2O6", mainTransitionGroupDocNode.GetNeutralFormula(srmSettings, modsWithLinkedPeptide).Molecule.ToString());
            var mainComplexFragmentIon   = new ComplexFragmentIon(new Transition(mainTransitionGroup, IonType.precursor, mainPeptide.Length - 1, 0, Adduct.SINGLY_PROTONATED), null, modsWithLinkedPeptide.Crosslinks);
            var linkedComplexFragmentIon = new ComplexFragmentIon(
                new Transition(linkedPeptide.GetTransitionGroup(IsotopeLabelType.light, Adduct.SINGLY_PROTONATED),
                               IonType.precursor, linkedPeptide.Peptide.Length - 1, 0, Adduct.SINGLY_PROTONATED), null, LinkedPeptide.EMPTY_CROSSLINK_STRUCTURE);
            var complexFragmentIon =
                mainComplexFragmentIon.AddChild(new ModificationSite(0, staticMod.Name), linkedComplexFragmentIon);
            var transition       = complexFragmentIon.MakeTransitionDocNode(srmSettings, modsWithLinkedPeptide, null);
            var sequenceMassCalc = new SequenceMassCalc(MassType.Monoisotopic);
            var expectedMz       = sequenceMassCalc.GetPrecursorMass("A") + sequenceMassCalc.GetPrecursorMass("D") - 24 - BioMassCalc.MassProton;

            Assert.AreEqual(expectedMz, transition.Mz, .00001);
        }
Example #2
0
        public void TestComplexIonMz()
        {
            var srmSettings      = SrmSettingsList.GetDefault();
            var peptide          = new Peptide("DLGEEHFKGLVLIAFSQYLQQCPFDEHVK");
            var linkedPeptide    = new LinkedPeptide(new Peptide("LVNELTEFAKTCVADESHAGCEK"), 9, null);
            var transitionGroup  = new TransitionGroup(peptide, Adduct.QUADRUPLY_PROTONATED, IsotopeLabelType.light);
            var crosslinkMod     = new StaticMod("linker", "K", null, "C8H10O2");
            var explicitMod      = new ExplicitMod(7, crosslinkMod).ChangeLinkedPeptide(linkedPeptide);
            var explicitMods     = new ExplicitMods(peptide, new[] { explicitMod }, new List <TypedExplicitModifications>());
            var linkedTransition =
                new Transition(linkedPeptide.GetTransitionGroup(IsotopeLabelType.light, Adduct.SINGLY_PROTONATED),
                               IonType.precursor, linkedPeptide.Peptide.Length - 1, 0, Adduct.SINGLY_PROTONATED);
            var expectedMzs = new[]
            {
                Tuple.Create(IonType.b, 2, 1, 229.1183),
                Tuple.Create(IonType.b, 10, 3, 1291.2766)
            };

            foreach (var tuple in expectedMzs)
            {
                int offset             = Transition.OrdinalToOffset(tuple.Item1, tuple.Item2, peptide.Sequence.Length);
                var transition         = new Transition(transitionGroup, tuple.Item1, offset, 0, Adduct.FromChargeProtonated(tuple.Item3));
                var complexFragmentIon = new ComplexFragmentIon(transition, null, explicitMods.Crosslinks);
                if (complexFragmentIon.IncludesAaIndex(explicitMod.IndexAA))
                {
                    complexFragmentIon = complexFragmentIon.AddChild(explicitMod.ModificationSite,
                                                                     new ComplexFragmentIon(linkedTransition, null, LinkedPeptide.EMPTY_CROSSLINK_STRUCTURE));
                }
                var complexTransitionDocNode = complexFragmentIon.MakeTransitionDocNode(srmSettings, explicitMods, null);
                Assert.AreEqual(tuple.Item4, complexTransitionDocNode.Mz, .0001, "{0}{1}{2}", tuple.Item1, tuple.Item2,
                                Transition.GetChargeIndicator(Adduct.FromChargeProtonated(tuple.Item3)));
            }
        }