Class Precursor
java.lang.Object
com.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.mass_spectrometry.spectra.Precursor
- All Implemented Interfaces:
Serializable
This class models a precursor.
- Author:
- Marc Vaudel, Harald Barsnes
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal doubleThe measured intensity of the precursor.final doubleThe measured m/z of the precursor.final int[]The charge of the precursor.final doubleThe retention time when the precursor was isolated.Fields inherited from class com.compomics.util.experiment.personalization.ExperimentObject
NO_KEY -
Constructor Summary
ConstructorsConstructorDescriptionEmpty default constructor.Precursor(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 TypeMethodDescriptiondoublegetMass(int chargeValue) Returns the mass of the precursor with the given charge.Returns the possible charges as a string.doubleReturns the retention time in minutes.booleanReturns 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.
-