java.lang.Object
com.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.identification.matches.IonMatch
All Implemented Interfaces:
Serializable

public class IonMatch
extends ExperimentObject
This class represents the assignment of a peak to a theoretical ion.
Author:
Marc Vaudel
See Also:
Serialized Form
  • Field Details

    • peakMz

      public double peakMz
      The matched peak m/z.
    • peakIntensity

      public double peakIntensity
      The matched peak intensity.
    • ion

      public Ion ion
      The matching ion.
    • charge

      public int charge
      The inferred charge of the ion.
  • Constructor Details

    • IonMatch

      public IonMatch()
      Empty default constructor
    • IonMatch

      public IonMatch​(double peakMz, double peakIntensity, Ion ion, int charge)
      Constructor for an ion match.
      Parameters:
      peakMz - The matched peak m/z.
      peakIntensity - The matched peak intensity.
      ion - The theoretic ion.
      charge - The inferred charge of the ion.
  • Method Details

    • getAbsoluteError

      public double getAbsoluteError()
      Get the absolute matching error in Da.
      Returns:
      the absolute matching error
    • getAbsoluteError

      public double getAbsoluteError​(int minIsotope, int maxIsotope)
      Get the absolute matching error in Da after isotope removal.
      Parameters:
      minIsotope - the minimal isotope
      maxIsotope - the maximal isotope
      Returns:
      the absolute matching error
    • getRelativeError

      public double getRelativeError()
      Get the relative m/z matching error in ppm.
      Returns:
      the relative matching error
    • getRelativeError

      public double getRelativeError​(int minIsotope, int maxIsotope)
      Get the relative m/z matching error in ppm after isotope removal.
      Parameters:
      minIsotope - the minimal isotope
      maxIsotope - the maximal isotope
      Returns:
      the relative matching error
    • getIsotopeNumber

      public int getIsotopeNumber​(int minIsotope, int maxIsotope)
      Returns the distance in number of neutrons between the experimental mass and theoretic mass, image of the isotope number: 1 typically indicates C13 isotope.
      Parameters:
      minIsotope - the minimal isotope
      maxIsotope - the maximal isotope
      Returns:
      the distance in number of neutrons between the experimental mass and theoretic mass
    • getError

      public double getError​(boolean isPpm, int minIsotope, int maxIsotope)
      Returns the error.
      Parameters:
      isPpm - a boolean indicating whether the error should be retrieved in ppm (true) or in Dalton (false)
      minIsotope - the minimal isotope
      maxIsotope - the maximal isotope
      Returns:
      the match m/z error
    • getError

      public double getError​(boolean isPpm)
      Returns the error.
      Parameters:
      isPpm - a boolean indicating whether the error should be retrieved in ppm (true) or in Dalton (false)
      Returns:
      the match m/z error
    • getPeakAnnotation

      public String getPeakAnnotation()
      Returns the annotation to use for the ion match as a String.
      Returns:
      the annotation to use for the given ion match
    • getPeakAnnotation

      public static String getPeakAnnotation​(Ion ion, int charge)
      Returns the annotation to use for a given ion and charge as a String.
      Parameters:
      ion - the given ion
      charge - the given charge
      Returns:
      the annotation to use for the given ion match
    • getMatchKey

      public static String getMatchKey​(Ion ion, int charge)
      Returns the key for the ion match uniquely representing a peak annotation.
      Parameters:
      ion - the ion matched
      charge - the charge
      Returns:
      the key for the ion match
    • getMatchKey

      public static String getMatchKey​(Ion ion, int charge, IonMatchKeysCache ionMatchKeysCache)
      Returns the key for the ion match uniquely representing a peak annotation. If a cache is given it will be used to store keys, ignored if null.
      Parameters:
      ion - the ion matched
      charge - the charge
      ionMatchKeysCache - a cache for the ion match keys
      Returns:
      the key for the ion match
    • getMatchKey

      public static String getMatchKey​(int ionTypeIndex, int ionSubType, int fragmentIonNumber, String neutralLossesAsString, int charge)
      Returns the key based on the different attributes of a match.
      Parameters:
      ionTypeIndex - the index of the ion type
      ionSubType - the index of the ion subtype
      fragmentIonNumber - the number of the ion, 0 if none
      neutralLossesAsString - the neutral losses as a string
      charge - the charge
      Returns:
      the key for the ion match
    • getPeakAnnotation

      public static String getPeakAnnotation​(boolean html, Ion ion, int charge)
      Returns the annotation to use for a given ion and charge as a String.
      Parameters:
      html - if true, returns the annotation as HTML with subscripts tags
      ion - the given ion
      charge - the given charge
      Returns:
      the annotation to use for the given ion match
    • getPeakAnnotation

      public String getPeakAnnotation​(boolean html)
      Returns the annotation to use for the given ion match as a String.
      Parameters:
      html - if true, returns the annotation as HTML with subscripts tags
      Returns:
      the annotation to use for the given ion match
    • getMZPrideCvTerm

      public CvTerm getMZPrideCvTerm()
      Returns the pride CV term for the ion match m/z.
      Returns:
      the pride CV term for the ion match m/z
    • getIntensityPrideCvTerm

      public CvTerm getIntensityPrideCvTerm()
      Returns the pride CV term for the ion match intensity.
      Returns:
      the pride CV term for the ion match intensity
    • getIonMassErrorPrideCvTerm

      public CvTerm getIonMassErrorPrideCvTerm​(int minIsotope, int maxIsotope)
      Returns the pride CV term for the ion match error.
      Parameters:
      minIsotope - the minimal isotope
      maxIsotope - the maximal isotope
      Returns:
      the pride CV term for the ion match error
    • getChargePrideCvTerm

      public CvTerm getChargePrideCvTerm()
      Returns the pride CV term for the ion match charge.
      Returns:
      the pride CV term for the ion match charge