You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simplify ParseModifications to either keep or ignore terminal mods. Currently does not addequately identify N-Terminus Mods. Make sure UtilProtein.SetProteinModsFromPeptides correctly adds terminal protein mods. Saving but needs more rigorous testing once ParseModifications updated (in separate PR) to correctly parse N-Terminus mods. WIP
Copy file name to clipboardExpand all lines: mzLib/MzLibUtil/ClassExtensions.cs
+7-13Lines changed: 7 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -28,13 +28,12 @@ public static class ClassExtensions
28
28
/// <summary>
29
29
/// Parses the full sequence to identify mods.
30
30
/// </summary>
31
-
/// <param name="fullSequence"> Full sequence of the peptide in question</param>
32
-
/// <param name="modOnNTerminus"> If true, the index of modifications at the N-terminus will be 0 (zero-based indexing). Otherwise, it is the index of the first amino acid (one-based indexing).</param>
33
-
/// <param name="modOnCTerminus"> If true, the index of modifications at the C-terminus will be one more than the index of the last amino acid. Otherwise, it is the index of the last amino acid.</param>
31
+
/// <param name="fullSequence"> Full sequence of the peptide in question.</param>
32
+
/// <param name="ignoreTerminusMod"> If true, terminal modifications will be ignored.</param>
34
33
/// <returns> Dictionary with the key being the amino acid position of the mod and the value being the string representing the mod</returns>
if(Sequence.IsNotNullOrEmpty())// if the protein sequence is known, ignore terminal modifications that are not protein terminal modifications
88
+
{
89
+
if((modPositionInProtein!=0&&modpos.Key==0)// if the mod is at the N-terminus of the peptide, but not the protein
90
+
||(modPositionInProtein!=Sequence.Length+1&&modpos.Key==peptide.BaseSequence.Length+1))// if the mod is at the C-terminus of the peptide, but not the protein
91
+
{
92
+
continue;
93
+
}
94
+
}
95
+
else// if the protein sequence is not known, ignore peptide terminal modifications
ModifiedAminoAcidPositionsInProtein[modpos.Key][mod.IdWithMotif].Intensity+=mod.Intensity;// might need to add some magic later to keep stored the mod intensity and the peptide intensity for MM output
@@ -167,13 +162,12 @@ public class PositionFrequencyAnalysis
167
162
/// Calculates the occupancy of post-translational modifications at the peptide level.
168
163
/// </summary>
169
164
/// <param name="peptides"> A List of Tuples whose entries are ordered as (string FullSequence, string BaseSequence, List<string> ProteinGroups, Intensity) for each peptide.</param>
170
-
/// <param name="modOnNTerminus"> If true, the index of modifications at the N-terminus will be 0 (zero-based indexing). Otherwise, it is the index of the first amino acid (one-based indexing).</param>
171
-
/// <param name="modOnCTerminus"> If true, the index of modifications at the C-terminus will be one more than the index of the last amino acid. Otherwise, it is the index of the last amino acid.</param>
165
+
/// <param name="ignoreTerminusMod"> If true, terminal modifications will be ignored.</param>
172
166
/// <returns> A nested dictionary whose key mappings are as follows: string ProteinGroup-> string Protein-> string BaseSequence-> int ModifiedAminoAcidIndex-> string ModificationName-> double Intensity
173
167
/// Note: Each BaseSequence dictionary contains a ModifiedAminoAcidIndex key of -1 that then contains a ModificationName key called "Total" that is used to track the total intensity observed for
174
168
/// all of the amino acids in that peptide.</returns>
Copy file name to clipboardExpand all lines: mzLib/Omics/SpectrumMatch/SpectrumMatchFromTsv.cs
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -96,12 +96,10 @@ public static string RemoveParentheses(string baseSequence)
96
96
/// Parses the full sequence to identify mods.
97
97
/// </summary>
98
98
/// <param name="fullSeq"> Full sequence of the peptide in question</param>
99
-
/// <param name="modOnNTerminus"> If true, the index of modifications at the N-terminus will be 0 (zero-based indexing). Otherwise, it is the index of the first amino acid (one-based indexing).</param>
100
-
/// <param name="modOnCTerminus"> If true, the index of modifications at the C-terminus will be one more than the index of the last amino acid. Otherwise, it is the index of the last amino acid.</param>
101
99
/// <returns> Dictionary with the key being the amino acid position of the mod and the value being the string representing the mod</returns>
0 commit comments