Class IonMatch
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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IonMatch.MzErrorType
Enum of the supported error types. -
Field Summary
Fields Modifier and Type Field Description int
charge
The inferred charge of the ion.Ion
ion
The matching ion.double
peakIntensity
The matched peak intensity.double
peakMz
The matched peak m/z. -
Constructor Summary
-
Method Summary
Modifier and Type Method Description double
getAbsoluteError()
Get the absolute matching error in Da.double
getAbsoluteError(int minIsotope, int maxIsotope)
Get the absolute matching error in Da after isotope removal.CvTerm
getChargePrideCvTerm()
Returns the pride CV term for the ion match charge.double
getError(boolean isPpm)
Returns the error.double
getError(boolean isPpm, int minIsotope, int maxIsotope)
Returns the error.CvTerm
getIntensityPrideCvTerm()
Returns the pride CV term for the ion match intensity.CvTerm
getIonMassErrorPrideCvTerm(int minIsotope, int maxIsotope)
Returns the pride CV term for the ion match error.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.static String
getMatchKey(int ionTypeIndex, int ionSubType, int fragmentIonNumber, String neutralLossesAsString, int charge)
Returns the key based on the different attributes of a match.static String
getMatchKey(Ion ion, int charge)
Returns the key for the ion match uniquely representing a peak annotation.static String
getMatchKey(Ion ion, int charge, IonMatchKeysCache ionMatchKeysCache)
Returns the key for the ion match uniquely representing a peak annotation.CvTerm
getMZPrideCvTerm()
Returns the pride CV term for the ion match m/z.String
getPeakAnnotation()
Returns the annotation to use for the ion match as a String.String
getPeakAnnotation(boolean html)
Returns the annotation to use for the given ion match as a String.static String
getPeakAnnotation(boolean html, Ion ion, int charge)
Returns the annotation to use for a given ion and charge as a String.static String
getPeakAnnotation(Ion ion, int charge)
Returns the annotation to use for a given ion and charge as a String.double
getRelativeError()
Get the relative m/z matching error in ppm.double
getRelativeError(int minIsotope, int maxIsotope)
Get the relative m/z matching error in ppm after isotope removal.Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, asLong, clearParametersMap, getId, getUrParam, getUrParams, removeUrParam, setId, setUrParams
-
Field Details
-
peakMz
public double peakMzThe matched peak m/z. -
peakIntensity
public double peakIntensityThe matched peak intensity. -
ion
The matching ion. -
charge
public int chargeThe inferred charge of the ion.
-
-
Constructor Details
-
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 isotopemaxIsotope
- 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 isotopemaxIsotope
- 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 isotopemaxIsotope
- 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 isotopemaxIsotope
- 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
Returns the annotation to use for the ion match as a String.- Returns:
- the annotation to use for the given ion match
-
getPeakAnnotation
Returns the annotation to use for a given ion and charge as a String.- Parameters:
ion
- the given ioncharge
- the given charge- Returns:
- the annotation to use for the given ion match
-
getMatchKey
Returns the key for the ion match uniquely representing a peak annotation.- Parameters:
ion
- the ion matchedcharge
- the charge- Returns:
- the key for the ion match
-
getMatchKey
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 matchedcharge
- the chargeionMatchKeysCache
- 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 typeionSubType
- the index of the ion subtypefragmentIonNumber
- the number of the ion, 0 if noneneutralLossesAsString
- the neutral losses as a stringcharge
- the charge- Returns:
- the key for the ion match
-
getPeakAnnotation
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 tagsion
- the given ioncharge
- the given charge- Returns:
- the annotation to use for the given ion match
-
getPeakAnnotation
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
Returns the pride CV term for the ion match m/z.- Returns:
- the pride CV term for the ion match m/z
-
getIntensityPrideCvTerm
Returns the pride CV term for the ion match intensity.- Returns:
- the pride CV term for the ion match intensity
-
getIonMassErrorPrideCvTerm
Returns the pride CV term for the ion match error.- Parameters:
minIsotope
- the minimal isotopemaxIsotope
- the maximal isotope- Returns:
- the pride CV term for the ion match error
-
getChargePrideCvTerm
Returns the pride CV term for the ion match charge.- Returns:
- the pride CV term for the ion match charge
-