Пример #1
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)));
            }
        }
Пример #2
0
        public void TestIncludesAaIndex()
        {
            var peptide         = new Peptide("AD");
            var transitionGroup = new TransitionGroup(peptide, Adduct.SINGLY_PROTONATED, IsotopeLabelType.light);
            var precursor       =
                new ComplexFragmentIon(new Transition(transitionGroup, IonType.precursor, peptide.Length - 1, 0, Adduct.SINGLY_PROTONATED), null, LinkedPeptide.EMPTY_CROSSLINK_STRUCTURE);

            Assert.IsTrue(precursor.IncludesAaIndex(0));
            Assert.IsTrue(precursor.IncludesAaIndex(1));
            var y1 = new ComplexFragmentIon(new Transition(transitionGroup, IonType.y, Transition.OrdinalToOffset(IonType.y, 1, peptide.Length), 0, Adduct.SINGLY_PROTONATED), null, LinkedPeptide.EMPTY_CROSSLINK_STRUCTURE);

            Assert.AreEqual(1, y1.Transition.Ordinal);
            Assert.IsFalse(y1.IncludesAaIndex(0));
            Assert.IsTrue(y1.IncludesAaIndex(1));
            var b1 = new ComplexFragmentIon(new Transition(transitionGroup, IonType.b, Transition.OrdinalToOffset(IonType.b, 1, peptide.Length), 0, Adduct.SINGLY_PROTONATED), null, LinkedPeptide.EMPTY_CROSSLINK_STRUCTURE);

            Assert.AreEqual(1, b1.Transition.Ordinal);
            Assert.IsTrue(b1.IncludesAaIndex(0));
            Assert.IsFalse(b1.IncludesAaIndex(1));
        }