com.compomics.util.experiment.biology
Class Ion

java.lang.Object
  extended by com.compomics.util.experiment.personalization.ExperimentObject
      extended by com.compomics.util.experiment.biology.Ion
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
ElementaryIon, Glycon, ImmoniumIon, PeptideFragmentIon, PrecursorIon, ReporterIon

public abstract class Ion
extends ExperimentObject

This class models an ion. Created by IntelliJ IDEA. User: Marc Date: Jun 18, 2010 Time: 8:57:33 AM

See Also:
Serialized Form

Nested Class Summary
static class Ion.IonType
          An enumerator of the supported ion types.
 
Field Summary
protected  double theoreticMass
           
protected  Ion.IonType type
          Type of ion.
 
Constructor Summary
Ion()
           
 
Method Summary
static Ion getGenericIon(Ion.IonType ionType, int subType)
          Convenience method returning a generic ion based on the given ion type without neutral losses.
static Ion getGenericIon(Ion.IonType ionType, int subType, ArrayList<NeutralLoss> neutralLosses)
          Convenience method returning a generic ion based on the given ion type.
static ArrayList<Ion.IonType> getImplementedIonTypes()
          Returns the implemented ion types.
abstract  String getName()
          Returns the name of the ion.
abstract  ArrayList<NeutralLoss> getNeutralLosses()
          Returns the possible neutral losses of this ion type.
 String getNeutralLossesAsString()
          Returns the neutral loss (if any), the empty string if no loss.
static String getNeutralLossesAsString(ArrayList<NeutralLoss> neutralLosses)
          Returns the neutral loss (if any), the empty string if no loss.
static ArrayList<Integer> getPossibleSubtypes(Ion.IonType ionType)
          Returns an arraylist of possible subtypes.
abstract  CvTerm getPrideCvTerm()
          Returns the pride cv term adapted to the fragment ion.
abstract  int getSubType()
          Returns the ion subtype.
abstract  String getSubTypeAsString()
          Returns the subtype as string.
 double getTheoreticMass()
          Returns the theoretic mass.
 Ion.IonType getType()
          Returns the ion type.
 String getTypeAsString()
          Returns the type of ion as string.
static String getTypeAsString(Ion.IonType type)
          Returns the type of ion as string.
abstract  boolean isSameAs(Ion anotherIon)
          Returns a boolean indicating whether the ion is the same as another ion.
 void setTheoreticMass(double theoreticMass)
          Sets a new theoretic mass.
 
Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, getParameterKey, getUrParam
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

protected Ion.IonType type
Type of ion.


theoreticMass

protected double theoreticMass
Constructor Detail

Ion

public Ion()
Method Detail

getName

public abstract String getName()
Returns the name of the ion. The name should be short enough to be displayed on a spectrum.

Returns:
the name of the ion

getPrideCvTerm

public abstract CvTerm getPrideCvTerm()
Returns the pride cv term adapted to the fragment ion. null if none corresponding.

Returns:
the pride cv term adapted to the fragment ion. null if none corresponding

getSubType

public abstract int getSubType()
Returns the ion subtype.

Returns:
the ion subtype as integer

getSubTypeAsString

public abstract String getSubTypeAsString()
Returns the subtype as string.

Returns:
the subtype as string

getPossibleSubtypes

public static ArrayList<Integer> getPossibleSubtypes(Ion.IonType ionType)
Returns an arraylist of possible subtypes.

Parameters:
ionType - an arraylist of possible subtypes
Returns:
an arraylist of possible subtypes

getNeutralLosses

public abstract ArrayList<NeutralLoss> getNeutralLosses()
Returns the possible neutral losses of this ion type. An empty list if none.

Returns:
the possible neutral losses of this ion type

isSameAs

public abstract boolean isSameAs(Ion anotherIon)
Returns a boolean indicating whether the ion is the same as another ion.

Parameters:
anotherIon - the other ion
Returns:
a boolean indicating whether the ion is the same as another ion

getNeutralLossesAsString

public String getNeutralLossesAsString()
Returns the neutral loss (if any), the empty string if no loss.

Returns:
the neutral loss

getNeutralLossesAsString

public static String getNeutralLossesAsString(ArrayList<NeutralLoss> neutralLosses)
Returns the neutral loss (if any), the empty string if no loss.

Parameters:
neutralLosses - the neutral loss (if any)
Returns:
the neutral loss

getTheoreticMass

public double getTheoreticMass()
Returns the theoretic mass.

Returns:
the theoretic mass

setTheoreticMass

public void setTheoreticMass(double theoreticMass)
Sets a new theoretic mass.

Parameters:
theoreticMass - a new theoretic mass

getType

public Ion.IonType getType()
Returns the ion type.

Returns:
the ion type

getImplementedIonTypes

public static ArrayList<Ion.IonType> getImplementedIonTypes()
Returns the implemented ion types.

Returns:
the implemented ion types

getTypeAsString

public String getTypeAsString()
Returns the type of ion as string.

Returns:
the type of ion as string

getTypeAsString

public static String getTypeAsString(Ion.IonType type)
Returns the type of ion as string.

Parameters:
type - the type of ion as string
Returns:
the type of ion as string

getGenericIon

public static Ion getGenericIon(Ion.IonType ionType,
                                int subType,
                                ArrayList<NeutralLoss> neutralLosses)
Convenience method returning a generic ion based on the given ion type.

Parameters:
ionType - the ion type
subType - the ion subtype
neutralLosses - the neutral losses. An empty or null list if none.
Returns:
a generic ion

getGenericIon

public static Ion getGenericIon(Ion.IonType ionType,
                                int subType)
Convenience method returning a generic ion based on the given ion type without neutral losses.

Parameters:
ionType - the ion type
subType - the ion subtype
Returns:
a generic ion


Copyright © 2013. All Rights Reserved.