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 Details

    • rt

      public final double rt
      The retention time when the precursor was isolated.
    • mz

      public final double mz
      The measured m/z of the precursor.
    • intensity

      public final double intensity
      The measured intensity of the precursor.
    • possibleCharges

      public final int[] possibleCharges
      The 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 time
      mz - the m/z
      possibleCharges - the possible charges
    • Precursor

      public Precursor​(double rt, double mz, double intensity, int[] possibleCharges)
      Constructor with retention time window.
      Parameters:
      rt - the retention time
      mz - the m/z
      intensity - the intensity
      possibleCharges - 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/z
      intensity - the intensity
      possibleCharges - the possible charges
      rtMin - the minimum of the RT window in seconds
      rtMax - 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

      public String 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

      public boolean isSameAs​(Precursor otherPrecursor)
      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.