Skip to content

Conversation

RayMSMS
Copy link
Contributor

@RayMSMS RayMSMS commented Apr 28, 2025

The origin searching target is "the peptide with same base seq and same mass"
But the definition of an Isobaric peptide is "whatever peptide with the same mass"
So in this PR, we change the search target. The following are the changes I made:

(1) new class IsobaricPeptide that is used for store the isobaric peptide id and the mass range
(2) new tester to evaluate IsoTracker's ability to sort the peptide id into isobaricPeptide
(3) remove the redundant tester
(4) revised the peptideID merging function

RayMSMS added 3 commits April 28, 2025 13:00
Change the searching target from "same base seq and same mass" to "whatever but same seq"
We should choice the most ID, then use orderby.Last()
Copy link

codecov bot commented Apr 28, 2025

Codecov Report

Attention: Patch coverage is 85.13514% with 11 lines in your changes missing coverage. Please review.

Project coverage is 78.32%. Comparing base (d37f510) to head (7b0b110).

Files with missing lines Patch % Lines
mzLib/FlashLFQ/FlashLFQResults.cs 71.42% 7 Missing and 1 partial ⚠️
mzLib/FlashLFQ/IsoTracker/PeptideMassBin.cs 76.92% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #873      +/-   ##
==========================================
+ Coverage   78.28%   78.32%   +0.03%     
==========================================
  Files         244      245       +1     
  Lines       35726    35770      +44     
  Branches     3761     3763       +2     
==========================================
+ Hits        27969    28017      +48     
+ Misses       7123     7120       -3     
+ Partials      634      633       -1     
Files with missing lines Coverage Δ
mzLib/FlashLFQ/FlashLfqEngine.cs 93.33% <100.00%> (+0.42%) ⬆️
mzLib/FlashLFQ/IsoTracker/PeptideMassBin.cs 76.92% <76.92%> (ø)
mzLib/FlashLFQ/FlashLFQResults.cs 91.11% <71.42%> (+0.46%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Alexander-Sol
Copy link
Contributor

A few comments:

  • Can you change IsobaricPeptide to inherit from Peptide? Then you can move the PeakOrder and IsoGroupIndex properties to IsobaricPeptide
  • If you make that change, I don't like having the ppm argument in the constructor. That property feels unneccessary, and it means we're creating and disposing a Tolerance object every time an IsobaricPeptide is created
  • If you use any object as a key in a dictionary, you have to make sure that class overrides Equals and GetHashCode

RayMSMS added 2 commits April 29, 2025 15:37
(1) add some tester for sorting function
(2) revise the sorting function
public readonly Dictionary<SpectraFileInfo, List<ChromatographicPeak>> Peaks;
private readonly HashSet<string> _peptideModifiedSequencesToQuantify;
public IDictionary<string, Dictionary<PeakRegion, List<ChromatographicPeak>>> IsobaricPeptideDict = null;
public IDictionary<PeptideMassBin, Dictionary<PeakRegion, List<ChromatographicPeak>>> IsobaricPeptideDict = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be PeptideMzBin unless it is deconvoluted neutral mass. In that case, Mass is fine.

internal List<PeptideMassBin> SortIsobaricPeptide(List<Identification> _allIdentifications, Tolerance massTolerance)
{
List<PeptideMassBin> isobaricPeptides = new List<PeptideMassBin>();
var ids = _allIdentifications.Where(p => p.BaseSequence != p.ModifiedSequence).OrderBy(p => p.PeakfindingMass).ToList();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a comment explaining this restriction

public double MaxMass { get; private set; } // The mass of the isobaric peptide
public List<Identification> Ids { get; set; } // The identification of the isobaric peptide

public PeptideMassBin(Identification id, Tolerance tolerance)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you should specify the kind of tolerance (ppm or mass)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants