All Implemented Interfaces:
Serializable

public class ReporterIon
extends Ion
This class models a reporter ion and is its own factory.
Author:
Marc Vaudel, Harald Barsnes
See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • ReporterIon

      public ReporterIon()
      Empty default constructor
    • ReporterIon

      public ReporterIon​(String name, double mass)
      Constructor for a user-defined reporter ion. The reporter ion is saved in a static map by default and can be retrieved using the static methods. See getReporterIon(String name).
      Parameters:
      name - name of the reporter ion. Should be unique to the ion.
      mass - theoretic mass of the reporter ion
    • ReporterIon

      public ReporterIon​(String name, double mass, boolean save)
      Constructor for a user-defined reporter ion.
      Parameters:
      name - name of the reporter ion. Should be unique to the ion.
      mass - theoretic mass of the reporter ion
      save - if true the reporter ion will be saved in the static map for later reuse
    • ReporterIon

      public ReporterIon​(String name, AtomChain atomChain)
      Constructor for a user-defined reporter ion. The reporter ion is saved in a static map by default and can be retrieved using the static methods. See getReporterIon(String name).
      Parameters:
      name - name of the reporter ion. Should be unique to the ion
      atomChain - the atomic composition of this ion
    • ReporterIon

      public ReporterIon​(String name, AtomChain atomChain, boolean save)
      Constructor for a user-defined reporter ion.
      Parameters:
      name - name of the reporter ion. Should be unique to the ion.
      atomChain - the atomic composition of this ion
      save - if true the reporter ion will be saved in the static map for later reuse
  • Method Details

    • addReporterIon

      public static void addReporterIon​(ReporterIon reporterIon)
      Adds a reporter ion to the class static map. Reporter ions with the same name will be overwritten.
      Parameters:
      reporterIon - the reporter ion to add
    • getName

      public String getName()
      This method returns the name of the reporter ion.
      Specified by:
      getName in class Ion
      Returns:
      name of the reporter ion
    • setName

      public void setName​(String name)
      Setter for the ion name.
      Parameters:
      name - the new ion name
    • setMass

      public void setMass​(double referenceMass)
      Method to set the mass of the reporter ion.
      Parameters:
      referenceMass - the mass where the reporter ions should be found
    • getPrideCvTerm

      public CvTerm getPrideCvTerm()
      Description copied from class: Ion
      Returns the CV term adapted to the fragment ion. Null if none corresponding.
      Specified by:
      getPrideCvTerm in class Ion
      Returns:
      the CV term adapted to the fragment ion. Null if none corresponding
    • getPsiMsCvTerm

      public CvTerm getPsiMsCvTerm()
      Description copied from class: Ion
      Returns the CV term adapted to the fragment ion. Null if none corresponding.
      Specified by:
      getPsiMsCvTerm in class Ion
      Returns:
      the CV term adapted to the fragment ion. Null if none corresponding
    • isSameAs

      public boolean isSameAs​(ReporterIon anotherReporterIon)
      Compares the current reporter ion with another one based on their masses.
      Parameters:
      anotherReporterIon - the other reporter ion
      Returns:
      a boolean indicating whether masses are equal
    • getIndex

      public int getIndex()
      Returns the index of a reporter ion. (i.e. its rounded m/z: 114 for iTRAQ 114).
      Returns:
      the index of a reporter ion.
    • getSubType

      public int getSubType()
      Description copied from class: Ion
      Returns the ion subtype.
      Specified by:
      getSubType in class Ion
      Returns:
      the ion subtype as integer
    • getSubTypeAsString

      public String getSubTypeAsString()
      Description copied from class: Ion
      Returns the subtype as string.
      Specified by:
      getSubTypeAsString in class Ion
      Returns:
      the subtype as string
    • getReporterIon

      public static ReporterIon getReporterIon​(int subType)
      Returns the reporter ion indexed by the given index.
      Parameters:
      subType - the index of interest
      Returns:
      the corresponding reporter ion
    • getReporterIon

      public static ReporterIon getReporterIon​(String name)
      Returns the reporter ion corresponding to the given name.
      Parameters:
      name - the name of the reporter ion
      Returns:
      the corresponding reporter ion
    • getImplementedIons

      public static Set<String> getImplementedIons()
      Returns a set of possible subtypes.
      Returns:
      a set of possible subtypes
    • getSortedImplementedIons

      public static ArrayList<String> getSortedImplementedIons()
      Returns an ordered list of possible subtypes.
      Returns:
      an ordered list of possible subtypes
    • getPossibleSubtypes

      public static int[] getPossibleSubtypes()
      Returns the possible subtypes.
      Returns:
      the possible subtypes
    • getNeutralLosses

      public NeutralLoss[] getNeutralLosses()
      Description copied from class: Ion
      Returns the possible neutral losses of this ion type. An empty list if none.
      Specified by:
      getNeutralLosses in class Ion
      Returns:
      the possible neutral losses of this ion type
    • isSameAs

      public boolean isSameAs​(Ion anotherIon)
      Description copied from class: Ion
      Returns a boolean indicating whether the ion is the same as another ion.
      Specified by:
      isSameAs in class Ion
      Parameters:
      anotherIon - the other ion
      Returns:
      a boolean indicating whether the ion is the same as another ion
    • clone

      public ReporterIon clone()
      Overrides:
      clone in class Object