本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
//.........这里部分代码省略.........