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


C# Peptide.SetModification方法代码示例

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


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

示例1: PeptideParitalCloneInternalWithCTerminusModification

        public void PeptideParitalCloneInternalWithCTerminusModification()
        {
            Peptide pepA = new Peptide("DEREK");
            pepA.SetModification(new ChemicalFormula("H2O"), Terminus.C);
            Peptide pepB = new Peptide(pepA, 2, 3);

            Peptide pepC = new Peptide("REK");
            pepC.SetModification(new ChemicalFormula("H2O"), Terminus.C);

            Assert.AreEqual(pepB,pepC);
        }
开发者ID:kmmbvnr,项目名称:CSMSL,代码行数:11,代码来源:PeptideTestFixture.cs

示例2: PeptideInEqualityAminoAcidModification

        public void PeptideInEqualityAminoAcidModification()
        {
            Peptide pepA = new Peptide("DEREK");
            Peptide pepB = new Peptide("DEREK");
            pepB.SetModification(new ChemicalFormula("H2O"), 'R');

            Assert.AreNotEqual(pepA,pepB);
        }
开发者ID:kmmbvnr,项目名称:CSMSL,代码行数:8,代码来源:PeptideTestFixture.cs

示例3: PeptideCloneWithModification

        public void PeptideCloneWithModification()
        {
            Peptide pepA = new Peptide("DEREK");
            pepA.SetModification(new ChemicalFormula("H2O"), 'R');
            Peptide pepB = new Peptide(pepA);

            Assert.AreEqual(pepB, pepA);
        }
开发者ID:kmmbvnr,项目名称:CSMSL,代码行数:8,代码来源:PeptideTestFixture.cs

示例4: PeptideExamples

        /// <summary>
        /// Basic overview of how peptides can be used and modified
        /// </summary>
        private static void PeptideExamples()
        {
            Console.WriteLine("**Peptide Examples**");

            // Simple Peptide creation
            Peptide peptide1 = new Peptide("ACDEFGHIKLMNPQRSTVWY");
            WritePeptideToConsole(peptide1);

            // Fragmenting a peptide is simple, you can include as many fragment types as you want
            Console.WriteLine("{0,-4} {1,-20} {2,-10} {3,-10} {4,-5}", "Type", "Formula", "Mass", "m/z +1", "Sequence");
            foreach (Fragment fragment in peptide1.Fragment(FragmentTypes.b | FragmentTypes.y))
            {
                WriteFragmentToConsole(fragment);
            }

            // Modifications can be applied to any residue or termini
            Console.WriteLine("Lets add some Iron to our peptide...");
            peptide1.SetModification(new ChemicalFormula("Fe"), Terminus.C | Terminus.N);
            WritePeptideToConsole(peptide1);

            // A chemicalmodification is a simple wrapper for a chemical formula. You can name your mods if you want
            Console.WriteLine("Add a modification of Oxygen with the name \"Oxidation\" to all Methionines");
            ChemicalFormulaModification oxMod = new ChemicalFormulaModification("O", "Oxidation");
            peptide1.SetModification(oxMod, 'M');
            WritePeptideToConsole(peptide1);

            // If you fragment a modified peptide, the modifications stay part of the fragments
            Console.WriteLine("{0,-4} {1,-20} {2,-20} {3,-5}", "Type", "Formula", "Mass", "m/z +1");
            foreach (Fragment fragment in peptide1.Fragment(FragmentTypes.b | FragmentTypes.y, 2))
            {
                WriteFragmentToConsole(fragment);
            }
        }
开发者ID:dbaileychess,项目名称:CSMSL,代码行数:36,代码来源:Examples.cs

示例5: IsotopologueExample

        private static void IsotopologueExample()
        {
            var iso1 = new Isotopologue("One", ModificationSites.K);
            iso1.AddModification(new ChemicalFormulaModification("C1", "Sample 1"));
            iso1.AddModification(new ChemicalFormulaModification("C2", "Sample 2"));

            var iso2 = new Isotopologue("Two", ModificationSites.R);
            iso2.AddModification(new ChemicalFormulaModification("C3", "Sample 3"));
            iso2.AddModification(Modification.Empty);

            Peptide peptide = new Peptide("DEREK");
            peptide.SetModification(iso1);
            peptide.SetModification(iso2);

            foreach (var iso in peptide.GenerateIsotopologues())
            {
                Console.WriteLine(iso + ", " + iso.MonoisotopicMass);
            }
        }
开发者ID:dbaileychess,项目名称:CSMSL,代码行数:19,代码来源:Examples.cs

示例6: GetUniquePeptides

        public static IEnumerable<Peptide> GetUniquePeptides(Peptide peptide)
        {
            QuantitationChannelSet quantSetMod;
            IMass mod;
            ModificationCollection modCol;
            HashSet<QuantitationChannelSet> sets = new HashSet<QuantitationChannelSet>();
            Dictionary<IQuantitationChannel, HashSet<int>> locations = new Dictionary<IQuantitationChannel, HashSet<int>>();
            HashSet<int> residues;

            IMass[] mods = peptide.Modifications;
            int modLength = mods.Length;

            for (int i = 0; i < modLength; i++)
            {
                if (mods[i] != null)
                {
                    mod = mods[i];

                    List<QuantitationChannelSet> channelsets = new List<QuantitationChannelSet>();

                    if ((modCol = mod as ModificationCollection) != null)
                    {
                        foreach (IMass mod2 in modCol)
                        {
                            if ((quantSetMod = mod2 as QuantitationChannelSet) != null)
                            {
                                channelsets.Add(quantSetMod);
                            }
                        }
                    }
                    else if ((quantSetMod = mod as QuantitationChannelSet) != null)
                    {
                        channelsets.Add(quantSetMod);
                    }

                    foreach (QuantitationChannelSet channelset in channelsets)
                    {
                        sets.Add(channelset);
                        foreach (IQuantitationChannel channel in channelset.GetChannels())
                        {
                            if (locations.TryGetValue(channel, out residues))
                            {
                                residues.Add(i);
                            }
                            else
                            {
                                residues = new HashSet<int>() { i };
                                locations.Add(channel, residues);
                            }
                        }
                    }
                }
            }

            if (sets.Count == 0)
            {
                yield return new Peptide(peptide, true);
            }
            else if (sets.Count == 1)
            {
                foreach (QuantitationChannelSet set in sets)
                {
                    foreach (IQuantitationChannel channel in set.GetChannels())
                    {
                        Peptide toReturn = new Peptide(peptide, true);
                        foreach (int residue in locations[channel])
                        {
                            toReturn.SetModification(channel, residue);
                        }
                        yield return toReturn;
                    }
                }
            }
            else
            {
                List<HashSet<IQuantitationChannel>> quantChannels = new List<HashSet<IQuantitationChannel>>();

                GetUniquePeptides_helper(sets.ToList(), 0, new HashSet<IQuantitationChannel>(), quantChannels);

                foreach (HashSet<IQuantitationChannel> channelset in quantChannels)
                {
                    Peptide toReturn = new Peptide(peptide, true);
                    Dictionary<int, IMass> modsToAdd = new Dictionary<int, IMass>();
                    IMass modToAdd;
                    foreach (IQuantitationChannel channel in channelset)
                    {
                        foreach (int residue in locations[channel])
                        {
                            if (modsToAdd.TryGetValue(residue, out modToAdd))
                            {
                                ModificationCollection col = new ModificationCollection(channel, modToAdd);
                                col.Add(channel);
                                col.Add(modToAdd);
                                modsToAdd[residue] = col;
                            }
                            else
                            {
                                modsToAdd.Add(residue, channel);
                            }
                        }
//.........这里部分代码省略.........
开发者ID:B-Rich,项目名称:CSMSL,代码行数:101,代码来源:QuantitationChannelSet.cs


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