Exemplo n.º 1
0
        public void TestLooplinkCrosslinkLibraryKey()
        {
            var crosslinkLibraryKey = new CrosslinkLibraryKey(new [] { new PeptideLibraryKey("AKIQDKEGIPPDQQR", 0) }, new[] { new CrosslinkLibraryKey.Crosslink("+138.0681", new[] { new [] { 2, 6 } }) }, 3);
            var srmSettings         = SrmSettingsList.GetDefault();

            srmSettings = srmSettings.ChangePeptideSettings(
                srmSettings.PeptideSettings.ChangeModifications(srmSettings.PeptideSettings.Modifications
                                                                .ChangeStaticModifications(
                                                                    srmSettings.PeptideSettings.Modifications.StaticModifications
                                                                    .Append(new StaticMod("DSS", "K", null, "C8H10O2").ChangeCrosslinkerSettings(
                                                                                CrosslinkerSettings.EMPTY)).ToList()
                                                                    )));
            var libKeyModificationMatcher = new LibKeyModificationMatcher();

            libKeyModificationMatcher.CreateMatches(srmSettings, new[] { new LibKey(crosslinkLibraryKey) },
                                                    new MappedList <string, StaticMod>(), new MappedList <string, StaticMod>());

            var peptideDocNode = libKeyModificationMatcher.CreateDocNodeFromSettings(new LibKey(crosslinkLibraryKey),
                                                                                     new Peptide("AKIQDKEGIPPDQQR"), SrmSettingsDiff.ALL, out _);

            Assert.IsNotNull(peptideDocNode);
            Assert.IsNotNull(peptideDocNode.ExplicitMods);
            Assert.AreEqual(1, peptideDocNode.ExplicitMods.Crosslinks.Count);
            Assert.AreEqual(null, peptideDocNode.ExplicitMods.Crosslinks[0].Value.Peptide);
        }
Exemplo n.º 2
0
        public void TestCrosslinkWithModifications()
        {
            CrosslinkLibraryKey libKey = CrosslinkSequenceParser.ParseCrosslinkLibraryKey(
                "C[+57.02146]C[+57.02146]TKPESER-EKVLTSSAR-[+138.0681@4,2]", 1);

            Assert.AreEqual(2, libKey.PeptideLibraryKeys.Count);
            Assert.AreEqual("C[+57.02146]C[+57.02146]TKPESER", libKey.PeptideLibraryKeys[0].ModifiedSequence);
            Assert.AreEqual("EKVLTSSAR", libKey.PeptideLibraryKeys[1].ModifiedSequence);
            Assert.AreEqual("+138.0681", libKey.Crosslinks[0].Name);
            Assert.AreEqual(2, libKey.Crosslinks[0].Positions.Count);
            Assert.AreEqual(ImmutableList.Singleton(4), libKey.Crosslinks[0].Positions[0]);
            Assert.AreEqual(ImmutableList.Singleton(2), libKey.Crosslinks[0].Positions[1]);
        }
Exemplo n.º 3
0
        public void TestCrosslinkSequenceParser()
        {
            CrosslinkLibraryKey libKey =
                CrosslinkSequenceParser.ParseCrosslinkLibraryKey("VTIAQGGVLPNIQAVLLPKK-TESHHKACGK-[+138.0681@19,6]", 1);

            Assert.AreEqual(2, libKey.PeptideLibraryKeys.Count);
            Assert.AreEqual("VTIAQGGVLPNIQAVLLPKK", libKey.PeptideLibraryKeys[0].ModifiedSequence);
            Assert.AreEqual("TESHHKACGK", libKey.PeptideLibraryKeys[1].ModifiedSequence);
            Assert.AreEqual(1, libKey.Crosslinks.Count);
            Assert.AreEqual("+138.0681", libKey.Crosslinks[0].Name);
            Assert.AreEqual(2, libKey.Crosslinks[0].Positions.Count);
            Assert.AreEqual(ImmutableList.Singleton(19), libKey.Crosslinks[0].Positions[0]);
            Assert.AreEqual(ImmutableList.Singleton(6), libKey.Crosslinks[0].Positions[1]);
        }
Exemplo n.º 4
0
        public override IEnumerable <AAModInfo> GetCurrentSequenceInfos()
        {
            if (_sequences.Current != null)
            {
                CrosslinkLibraryKey crosslinkLibraryKey =
                    CrosslinkSequenceParser.TryParseCrosslinkLibraryKey(_sequences.Current, 0);
                if (crosslinkLibraryKey != null)
                {
                    return(crosslinkLibraryKey.PeptideLibraryKeys.SelectMany(peptideLibraryKey =>
                                                                             EnumerateAaModInfos(peptideLibraryKey.ModifiedSequence)));
                }
            }

            return(EnumerateAaModInfos(_sequences.Current ?? string.Empty));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Transforms an ordinary peptide sequence into a crosslinked peptide composed of three parts attached together
        /// with the Hydrolysis crosslinker.
        /// The crosslinked peptide ends up being the middle peptide sequence which has attachments to the left and right parts of
        /// the peptide sequence.
        ///
        /// For example, AVVQDPALKPLALVYGEATSR becomes:
        /// LKPLALV-AVVQDPA-YGEATSR-[Hydrolysis@1,7,*][Hydrolysis@7,*,1]
        /// </summary>
        private string MakeCrosslinkedSequence(string flatPeptideSequence)
        {
            var aaMods       = TokenizeModifiedSequence(flatPeptideSequence).ToList();
            int leftLength   = aaMods.Count / 3;
            int middleLength = (2 * aaMods.Count) / 3 - leftLength;

            var left   = new PeptideLibraryKey(string.Join(string.Empty, aaMods.Take(leftLength)), 0);
            var middle = new PeptideLibraryKey(string.Join(string.Empty, aaMods.Skip(leftLength).Take(middleLength)), 0);
            var right  = new PeptideLibraryKey(string.Join(string.Empty, aaMods.Skip(leftLength + middleLength)), 0);
            var crosslinkLibraryKey = new CrosslinkLibraryKey(new [] { middle, left, right }, new []
            {
                new CrosslinkLibraryKey.Crosslink(crosslinkerName, new [] { new[] { 1 }, new [] { leftLength }, Enumerable.Empty <int>() }),
                new CrosslinkLibraryKey.Crosslink(crosslinkerName, new[] { new[] { middleLength }, Enumerable.Empty <int>(), new [] { 1 } })
            }, 0);

            return(crosslinkLibraryKey.ToString());
        }