Class ElementaryIon
java.lang.Object
com.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.biology.ions.Ion
com.compomics.util.experiment.biology.ions.impl.ElementaryIon
- All Implemented Interfaces:
Serializable
public class ElementaryIon extends Ion
This class represents an elementary ion.
- Author:
- Marc Vaudel
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class com.compomics.util.experiment.biology.ions.Ion
Ion.IonType
-
Field Summary
Fields Modifier and Type Field Description static ElementaryIon
proton
A proton.static int
PROTON
Subtype int for a proton.static double[]
protonMassMultiples
Cache for the multiples of the proton mass.Fields inherited from class com.compomics.util.experiment.biology.ions.Ion
atomChain, theoreticMass, theoreticMass1, type
-
Constructor Summary
Constructors Constructor Description ElementaryIon()
Empty default constructorElementaryIon(String name, double theoreticMass, int subType)
Constructor. -
Method Summary
Modifier and Type Method Description String
getName()
Returns the name of the ion.NeutralLoss[]
getNeutralLosses()
Returns the possible neutral losses of this ion type.static int[]
getPossibleSubtypes()
Returns the possible subtypes.CvTerm
getPrideCvTerm()
Returns the CV term adapted to the fragment ion.static double
getProtonMassMultiple(int i)
Returns the mass of the proton multiplied by i.CvTerm
getPsiMsCvTerm()
Returns the CV term adapted to the fragment ion.int
getSubType()
Returns the ion subtype.String
getSubTypeAsString()
Returns the subtype as string.boolean
isSameAs(Ion anotherIon)
Returns a boolean indicating whether the ion is the same as another ion.Methods inherited from class com.compomics.util.experiment.biology.ions.Ion
getAtomicComposition, getGenericIon, getGenericIon, getImplementedIonTypes, getNeutralLossesAsString, getNeutralLossesAsString, getPossibleSubtypes, getPossibleSubtypesAsSet, getTheoreticMass, getTheoreticMz, getType, getTypeAsString, getTypeAsString, hasNeutralLosses, setAtomicComposition, setTheoreticMass
Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, asLong, clearParametersMap, getId, getUrParam, getUrParams, removeUrParam, setId, setUrParams
-
Field Details
-
PROTON
public static final int PROTONSubtype int for a proton.- See Also:
- Constant Field Values
-
proton
A proton. -
protonMassMultiples
public static double[] protonMassMultiplesCache for the multiples of the proton mass.
-
-
Constructor Details
-
ElementaryIon
public ElementaryIon()Empty default constructor -
ElementaryIon
Constructor.- Parameters:
name
- the name of the iontheoreticMass
- the theoretic mass of the ionsubType
- the subtype index
-
-
Method Details
-
getProtonMassMultiple
public static double getProtonMassMultiple(int i)Returns the mass of the proton multiplied by i. if i is smaller or equal to ten a value in cache is used. It is calculated otherwise. Throws an exception for negative i without sanity check.- Parameters:
i
- i- Returns:
- the mass of the proton multiplied by i
-
getName
Description copied from class:Ion
Returns the name of the ion. The name should be short enough to be displayed on a spectrum. -
getPrideCvTerm
Description copied from class:Ion
Returns the CV term adapted to the fragment ion. Null if none corresponding.- Specified by:
getPrideCvTerm
in classIon
- Returns:
- the CV term adapted to the fragment ion. Null if none corresponding
-
getPsiMsCvTerm
Description copied from class:Ion
Returns the CV term adapted to the fragment ion. Null if none corresponding.- Specified by:
getPsiMsCvTerm
in classIon
- Returns:
- the CV term adapted to the fragment ion. Null if none corresponding
-
getSubType
public int getSubType()Description copied from class:Ion
Returns the ion subtype.- Specified by:
getSubType
in classIon
- Returns:
- the ion subtype as integer
-
getSubTypeAsString
Description copied from class:Ion
Returns the subtype as string.- Specified by:
getSubTypeAsString
in classIon
- Returns:
- the subtype as string
-
getPossibleSubtypes
public static int[] getPossibleSubtypes()Returns the possible subtypes.- Returns:
- the possible subtypes
-
getNeutralLosses
Description copied from class:Ion
Returns the possible neutral losses of this ion type. An empty list if none.- Specified by:
getNeutralLosses
in classIon
- Returns:
- the possible neutral losses of this ion type
-
isSameAs
Description copied from class:Ion
Returns a boolean indicating whether the ion is the same as another ion.
-