Class Precursor
java.lang.Object
com.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.mass_spectrometry.spectra.Precursor
- All Implemented Interfaces:
Serializable
public class Precursor extends ExperimentObject
This class models a precursor.
- Author:
- Marc Vaudel, Harald Barsnes
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description double
intensity
The measured intensity of the precursor.double
mz
The measured m/z of the precursor.int[]
possibleCharges
The charge of the precursor.double
rt
The retention time when the precursor was isolated. -
Constructor Summary
Constructors Constructor Description Precursor()
Empty default constructorPrecursor(double rt, double mz, double intensity, int[] possibleCharges)
Constructor with retention time window.Precursor(double rt, double mz, int[] possibleCharges)
Constructor for the precursor.Precursor(double mz, double intensity, int[] possibleCharges, double rtMin, double rtMax)
Constructor with retention time window and no reference retention time. -
Method Summary
Modifier and Type Method Description double
getMass(int chargeValue)
Returns the mass of the precursor with the given charge.String
getPossibleChargesAsString()
Returns the possible charges as a string.double
getRtInMinutes()
Returns the retention time in minutes.boolean
isSameAs(Precursor otherPrecursor)
Returns a boolean indicating whether the precursor is identical to the other precursor.Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, asLong, clearParametersMap, getId, getUrParam, getUrParams, removeUrParam, setId, setUrParams
-
Field Details
-
rt
public final double rtThe retention time when the precursor was isolated. -
mz
public final double mzThe measured m/z of the precursor. -
intensity
public final double intensityThe measured intensity of the precursor. -
possibleCharges
public final int[] possibleChargesThe charge of the precursor.
-
-
Constructor Details
-
Precursor
public Precursor()Empty default constructor -
Precursor
public Precursor(double rt, double mz, int[] possibleCharges)Constructor for the precursor.- Parameters:
rt
- the retention timemz
- the m/zpossibleCharges
- the possible charges
-
Precursor
public Precursor(double rt, double mz, double intensity, int[] possibleCharges)Constructor with retention time window.- Parameters:
rt
- the retention timemz
- the m/zintensity
- the intensitypossibleCharges
- the possible charges
-
Precursor
public Precursor(double mz, double intensity, int[] possibleCharges, double rtMin, double rtMax)Constructor with retention time window and no reference retention time.- Parameters:
mz
- the m/zintensity
- the intensitypossibleCharges
- the possible chargesrtMin
- the minimum of the RT window in secondsrtMax
- the maximum of the RT window in seconds
-
-
Method Details
-
getRtInMinutes
public double getRtInMinutes()Returns the retention time in minutes.- Returns:
- the retention time in minutes
-
getPossibleChargesAsString
Returns the possible charges as a string.- Returns:
- the possible charges as a string
-
getMass
public double getMass(int chargeValue)Returns the mass of the precursor with the given charge.- Parameters:
chargeValue
- the value of the charge- Returns:
- the mass of the precursor with the given charge
-
isSameAs
Returns a boolean indicating whether the precursor is identical to the other precursor. m/z, rt, and intensities values must have exact same double values. Charges must be identical and in the same order.- Parameters:
otherPrecursor
- The other precursor.- Returns:
- A boolean indicating whether the precursor is identical to the other precursor.
-