Skip to content

[Enhancement] Isotope and adduct grouping for metabolites #4483

Description

@marcus-ludwig

I noticed that OpenMS misses to correctly group some isotpe and adduct peaks.
This is based on FeatureFindingMetabo and MetaboliteFeatureDeconvolution.

In my opinion, the computation of the overlap over retention time of 2 mass traces plays a major role in this. The problem occurs if the 2 mass traces to be grouped are very different in intensity and thus differ in length.

Isotope detection in FeatureFindingMetabo
Currently the shorter mass trace must have at least 70% the length of the longer one, else these cannot be grouped together.

double proportion(overlap / max_length);
if (proportion < 0.7)
{
  return 0.0;
}
return computeCosineSim_(x, y);

But isotope peaks, especially all >+1 peaks, are usually low in intensity and thus the detected mass traces will be much shorter.
Solution: Isn't it more reasonable to assume that the shorter mass trace must lie to at least 95% or 99% within the longer mass trace (note, that the monoisotopic mass trace usually is, but does not have to be the longer one)? Additionally, it should be checked if the maximum of the longer mass trace (the longer mass trace should be more intense than the shorter one) lies within the range of the shorter peak.

Adduct grouping in MetaboliteFeatureDeconvolution
Currently, the overlap is computed by intersect_length / union_length. Again adduct mass traces with huge intensity differences may not be grouped since union_length is mainly the length of the high intense adduct mass trace and intersect_length is mainly the length of the low intensity adduct mass trace.

if (!(f1.getConvexHull().getBoundingBox().isEmpty() || f2.getConvexHull().getBoundingBox().isEmpty()))
{
  double f_start1 = std::min(f1.getConvexHull().getBoundingBox().minX(), f2.getConvexHull().getBoundingBox().minX());
  double f_start2 = std::max(f1.getConvexHull().getBoundingBox().minX(), f2.getConvexHull().getBoundingBox().minX());
  double f_end1 = std::min(f1.getConvexHull().getBoundingBox().maxX(), f2.getConvexHull().getBoundingBox().maxX());
  double f_end2 = std::max(f1.getConvexHull().getBoundingBox().maxX(), f2.getConvexHull().getBoundingBox().maxX());

  double union_length = f_end2 - f_start1;
  double intersect_length = std::max(0., f_end1 - f_start2);

  if (intersect_length / union_length < rt_min_overlap)
    continue;
}

Suggestion: I my opinion it is not uncommon to see e.g. a high intense [M+H]+ and low intense [M+Na]+ and a modified rule such as _intersect_length / shorter_mass_trace_length < rt_min_overlap would still detect this. I just do not know if there are adducts which are expected to have different retention times and how these are influenced by this.

Activity

  1. changed the title [-][Improvement] Isotope and adduct grouping for metabolites[/-] [+][Enhancement] Isotope and adduct grouping for metabolites[/+] on Jan 16, 2020
  2. oliveralka commented on Jan 21, 2020

    @oliveralka
    Contributor

    I think we should implement your suggestions in both cases. I had to fight with the grouping as well and it makes a lot of sense for metabolites with elements such as Cl, F, Br.

    Isn't it more reasonable to assume that the shorter mass trace must lie to at least 95% or 99% within the longer mass trace (note, that the monoisotopic mass trace usually is, but does not have to be the longer one)?

    In my opinion, the optimal case would be an overlap of 99% - I guess it would be best to have some control over it - maybe it should be an advanced parameter which you can alternate between 95% and 99%.

    Additionally, it should be checked if the maximum of the longer mass trace (the longer mass trace should be more intense than the shorter one) lies within the range of the shorter peak.

    Do you mean that the max. intensity peak should be within the retention time of the potential isotopic peak? Should that not be covered by the overlap of 99% or is that a certain edge case? Shouldn't that be already handled in the hypothesis testing (@timosachsenberg)?

    @FabianAicheler Do you have time to take a look at the Adducts?

  3. marcus-ludwig commented on Jan 21, 2020

    @marcus-ludwig
    ContributorAuthor

    Additionally, it should be checked if the maximum of the longer mass trace (the longer mass trace should be more intense than the shorter one) lies within the range of the shorter peak.

    Do you mean that the max. intensity peak should be within the retention time of the potential isotopic peak? Should that not be covered by the overlap of 99% or is that a certain edge case?

    No, this is the other direction. Say, mass trace A is longer (over RT) and more intense than mass trace B. A is 5 sec, B is 2 sec. The usual scenario would be A is the monoisotopic and B the +1 isotope.
    Here, B should lie within A. But the apex of mass trace A (most intense peak) should lie in the 2 sec range of B as well. If you do not see an +1 isotope peak in the MS1 with the most intense monoisotopic peak, something is wrong.

    Of course there are scenarios in which the longer mass trace is not the monoisotopic but the other way around. That is why we define the rule based on "longer" and "shorter" mass trace and not lower and higher m/z.

  4. stale commented on Mar 30, 2022

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  5. github-actions commented on Jan 7, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  6. github-actions commented on Jul 7, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  7. added a commit that references this issue on Jul 8, 2026
    58c0794
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions