当前位置: 首页>>代码示例>>C#>>正文


C# SrmDocument.ChangePeptideMods方法代码示例

本文整理汇总了C#中SrmDocument.ChangePeptideMods方法的典型用法代码示例。如果您正苦于以下问题:C# SrmDocument.ChangePeptideMods方法的具体用法?C# SrmDocument.ChangePeptideMods怎么用?C# SrmDocument.ChangePeptideMods使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SrmDocument的用法示例。


在下文中一共展示了SrmDocument.ChangePeptideMods方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MultiLabelExplicitSerialTest

        public void MultiLabelExplicitSerialTest()
        {
            // Create a simple document and add two peptides
            SrmDocument document = new SrmDocument(SrmSettingsList.GetDefault());
            const string pepSequence1 = "QFVLSCVILR";
            const string pepSequence2 = "DIEVYCDGAITTK";
            var reader = new StringReader(string.Join("\n", new[] {">peptides1", pepSequence1, pepSequence2}));
            IdentityPath path;
            document = document.ImportFasta(reader, true, IdentityPath.ROOT, out path);
            Assert.AreEqual(2, document.PeptideCount);

            // Add some modifications in two new label types
            var modCarb = new StaticMod("Carbamidomethyl Cysteine", "C", null, "C2H3ON");
            var modOther = new StaticMod("Another Cysteine", "C", null, "CO8N2");
            var staticMods = new[] {modCarb, modOther};
            var mod15N = new StaticMod("All 15N", null, null, null, LabelAtoms.N15, null, null);
            var modK13C = new StaticMod("13C K", "K", ModTerminus.C, null, LabelAtoms.C13, null, null);
            var modR13C = new StaticMod("13C R", "R", ModTerminus.C, null, LabelAtoms.C13, null, null);
            var modV13C = new StaticMod("Heavy V", "V", null, null, LabelAtoms.C13 | LabelAtoms.N15, null, null);
            var heavyMods = new[] { mod15N, modK13C, modR13C, modV13C };
            var labelTypeAA = new IsotopeLabelType("heavy AA", IsotopeLabelType.FirstHeavy);
            var labelTypeAll = new IsotopeLabelType("heavy All", IsotopeLabelType.FirstHeavy + 1);

            var settings = document.Settings;
            settings = settings.ChangePeptideModifications(mods =>
                new PeptideModifications(mods.StaticModifications,
                    new[]
                        {
                            new TypedModifications(labelTypeAA, new[] {modK13C, modR13C}),
                            new TypedModifications(labelTypeAll, new[] {mod15N})
                        }));
            document = document.ChangeSettings(settings);
            Assert.AreEqual(6, document.PeptideTransitionGroupCount);

            // Add modifications to light and heavy AA in the first peptide
            path = document.GetPathTo((int) SrmDocument.Level.Molecules, 0);
            var nodePepMod = (PeptideDocNode) document.FindNode(path);
            var explicitMod = new ExplicitMods(nodePepMod.Peptide,
                new[] {new ExplicitMod(pepSequence1.IndexOf('C'), modOther)},
                new[] {new TypedExplicitModifications(nodePepMod.Peptide, labelTypeAA, new ExplicitMod[0])});
            document = document.ChangePeptideMods(path, explicitMod, staticMods, heavyMods);
            Assert.AreEqual(5, document.PeptideTransitionGroupCount);

            // Add a modification to heavy All in the second peptide
            path = document.GetPathTo((int)SrmDocument.Level.Molecules, 1);
            nodePepMod = (PeptideDocNode)document.FindNode(path);
            explicitMod = new ExplicitMods(nodePepMod.Peptide, null,
                new[] { new TypedExplicitModifications(nodePepMod.Peptide, labelTypeAll,
                            new[] {new ExplicitMod(pepSequence2.IndexOf('V'), modV13C)}) });
            document = document.ChangePeptideMods(path, explicitMod, staticMods, heavyMods);
            Assert.AreEqual(5, document.PeptideTransitionGroupCount);

            AssertEx.Serializable(document, 3, AssertEx.DocumentCloned);
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:54,代码来源:IsotypeModTest.cs


注:本文中的SrmDocument.ChangePeptideMods方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。