Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encyclopedia formated peptide full sequence including mass shift in brackets #726

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a6b1639
correct Within calculation
Nov 18, 2021
fa4da8b
update unit tests
Nov 18, 2021
3246567
conflicts resolved back to upstream
Feb 4, 2022
a018d4d
Merge remote-tracking branch 'upstream/master'
Feb 15, 2022
15a37d0
Merge remote-tracking branch 'upstream/master'
Feb 17, 2022
892fa45
this is the spot
Feb 18, 2022
211013c
Merge remote-tracking branch 'upstream/master'
Feb 25, 2022
68104ee
Merge branch 'master' of https://github.com/trishorts/mzLib
trishorts Mar 9, 2022
d715a08
Merge remote-tracking branch 'upstream/master'
Mar 16, 2022
3565522
Merge remote-tracking branch 'upstream/master'
Mar 23, 2022
72e7b53
Merge remote-tracking branch 'upstream/master'
Mar 29, 2022
593872a
Merge remote-tracking branch 'upstream/master'
trishorts Apr 13, 2022
42dd034
Merge branch 'master' of https://github.com/trishorts/mzLib
trishorts Apr 13, 2022
fbeaec0
Merge remote-tracking branch 'upstream/master'
trishorts Jun 1, 2022
614ded7
Merge remote-tracking branch 'upstream/master'
Jun 14, 2022
47307c8
Merge branch 'master' of https://github.com/trishorts/mzLib
Jun 14, 2022
28e05ae
Merge remote-tracking branch 'upstream/master'
Jul 6, 2022
0a7c609
Merge remote-tracking branch 'upstream/master'
Jul 26, 2022
630d8c7
Merge remote-tracking branch 'upstream/master'
trishorts Jul 27, 2022
f6a386b
Merge branch 'master' of https://github.com/trishorts/mzLib
trishorts Jul 27, 2022
d673800
Merge remote-tracking branch 'upstream/master'
Sep 11, 2022
675a0ae
Merge branch 'master' of https://github.com/trishorts/mzLib
Sep 11, 2022
15d4baf
Merge remote-tracking branch 'upstream/master'
Sep 27, 2022
03ca9f7
Merge remote-tracking branch 'upstream/master'
Oct 4, 2022
d0a4c79
Merge remote-tracking branch 'upstream/master'
Jan 30, 2023
894b998
Merge remote-tracking branch 'upstream/master'
Mar 15, 2023
88269a1
Merge remote-tracking branch 'upstream/master'
trishorts Apr 24, 2023
9a9b24a
Merge remote-tracking branch 'upstream/master'
trishorts Jun 29, 2023
b4ad231
add space
trishorts Jun 29, 2023
ad40705
New peptideWithSetMods output with mass shift in brackets
trishorts Aug 14, 2023
9134d17
afds
trishorts Aug 14, 2023
0919bc0
Merge remote-tracking branch 'upstream/master' into encyclopediaDIAmo…
trishorts Aug 14, 2023
3342b31
nuthin
trishorts Aug 15, 2023
b3a780b
deleted path to hd
trishorts Aug 15, 2023
ac7e447
f
trishorts Aug 15, 2023
c7508b9
test essential sequence in peptideWithSetMods
trishorts Aug 15, 2023
b62ce79
fixed mod sig figs to six
trishorts Aug 15, 2023
c009476
Merge branch 'master' into encyclopediaDIAmodifiedPeptidesFormatMassS…
trishorts Aug 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,11 @@ public override string ToString()
return FullSequence + string.Join("\t", AllModsOneIsNterminus.Select(m => m.ToString()));
}

public string FullSequenceWithMassShift()
{
return DetermineFullSequenceWithMassShifts();
}

public override bool Equals(object obj)
{
var q = obj as PeptideWithSetModifications;
Expand Down Expand Up @@ -1035,7 +1040,6 @@ private void GetProteinAfterDeserialization(Dictionary<string, Protein> idToProt
{
throw new MzLibUtil.MzLibException("Could not find protein accession after deserialization! " + ProteinAccession);
}

Protein = protein;
}

Expand Down Expand Up @@ -1090,6 +1094,55 @@ private void DetermineFullSequence()

FullSequence = subsequence.ToString();
}
/// <summary>
/// This method returns the full sequence with mass shifts INSTEAD OF PTMs in brackets []
/// Some external tools cannot parse PTMs, instead requiring a numerical input indicating the mass of a PTM in brackets
/// after the position of that modification
/// N-terminal mas shifts are in brackets prior to the first amino acid and apparently missing the + sign
/// </summary>
/// <returns></returns>
private string DetermineFullSequenceWithMassShifts()
{
var subsequence = new StringBuilder();

// modification on peptide N-terminus
if (AllModsOneIsNterminus.TryGetValue(1, out Modification mod))
{
subsequence.Append('[' + mod.MonoisotopicMass.RoundedDouble(6).ToString() + ']');
}

for (int r = 0; r < Length; r++)
{
subsequence.Append(this[r]);

// modification on this residue
if (AllModsOneIsNterminus.TryGetValue(r + 2, out mod))
{
if (mod.MonoisotopicMass > 0)
{
subsequence.Append("[+" + mod.MonoisotopicMass.RoundedDouble(6).ToString() + ']');
}
else
{
subsequence.Append("[" + mod.MonoisotopicMass.RoundedDouble(6).ToString() + ']');
}
}
}

// modification on peptide C-terminus
if (AllModsOneIsNterminus.TryGetValue(Length + 2, out mod))
{
if (mod.MonoisotopicMass > 0)
{
subsequence.Append("[+" + mod.MonoisotopicMass.RoundedDouble(6).ToString() + ']');
}
else
{
subsequence.Append("[" + mod.MonoisotopicMass.RoundedDouble(6).ToString() + ']');
}
}
return subsequence.ToString();
}

private void UpdateCleavageSpecificity()
{
Expand Down
134 changes: 134 additions & 0 deletions mzLib/Test/DatabaseTests/essentialSequences.txt

Large diffs are not rendered by default.

134 changes: 134 additions & 0 deletions mzLib/Test/DatabaseTests/fullSequences.txt

Large diffs are not rendered by default.

134 changes: 134 additions & 0 deletions mzLib/Test/DatabaseTests/fullSequencesWithMassShift.txt

Large diffs are not rendered by default.

Loading
Loading