public class MassCalc extends Object
MassCalc
calculates the mass of peptides which for our
purposes are SymbolList
s which contain
Symbol
sfrom the protein Alphabet
. It uses
the mono-isotopic and average-isotopic masses identical to those
specified at www.micromass.co.uk
Note: This class does not handle selenocysteine and pyrrolysine.Modifier and Type | Field and Description |
---|---|
static double |
Cavg
Constant value of Carbon average mass
|
static double |
Cmono
Constant value of Carbon monoisotopic mass
|
static double |
Havg
Constant value of Hydrogen average mass
|
static double |
Hmono
Constant value of Hydrogen monoisotopic mass
|
static double |
Navg
Constant value of Nitrogen average mass
|
static double |
Nmono
Constant value of Nitrogen monoisotopic mass
|
static double |
Oavg
Constant value of Oxygen average mass
|
static double |
Omono
Constant value of Oxygen monoisotopic mass
|
Constructor and Description |
---|
MassCalc(String isotopicType,
boolean MH_PLUS)
Creates a new
MassCalc . |
Modifier and Type | Method and Description |
---|---|
void |
addVariableModification(char residue,
double[] masses)
Add Variable modifications.
|
void |
addVariableModification(Symbol residue,
double[] masses)
Add Variable modifications.
|
double |
getMass(SymbolList proteinSeq)
Get the Mass of this peptide.
|
static double |
getMass(SymbolList proteinSeq,
String isotopicType,
boolean MH_PLUS)
getMass calculates the mass of this peptide. |
static double |
getMolecularWeight(SymbolList proteinSeq)
Calculate the molecular weight of a protein, making estimates whenever it is
possible like averaging mass values for ambiguity symbols or counting
zero when gaps are encountered.
|
double |
getTermMass()
getTermMass returns the terminal mass being used
by the instance methods. |
double[] |
getVariableMasses(SymbolList peptide)
Get all masses including the variable mass.
|
boolean |
removeVariableModifications(char residue)
Remove all variable modifications assocaited with this residue.
|
boolean |
removeVariableModifications(Symbol residue)
Remove all variable modifications assocaited with this residue.
|
void |
setSymbolModification(char symbolToken,
double mass)
Use this to set a post translational modification for the
Symbol represented by this character. |
public static final double Cmono
public static final double Hmono
public static final double Nmono
public static final double Omono
public static final double Cavg
public static final double Havg
public static final double Navg
public static final double Oavg
public MassCalc(String isotopicType, boolean MH_PLUS)
MassCalc
.isotopicType
- a String
. The type of isotopes
to calculate. Either mono isotopic or average
isotopic. Acceptable values are
SymbolPropertyTable.AVG_MASS
or
SymbolPropertyTable.MONO_MASS
.MH_PLUS
- a boolean
.public void setSymbolModification(char symbolToken, double mass) throws IllegalSymbolException
Symbol
represented by this character. It will only
affect the current MassCalc
instance and will not
affect the static method.symbolToken
- a char
representing a
Symbol
.mass
- a double
to be the new mass of the
residue.IllegalSymbolException
- if the Symbol
is
not recognised.public void addVariableModification(char residue, double[] masses) throws IllegalSymbolException
residue
- The one char id for this residuemasses
- IllegalSymbolException
getVariableMasses(SymbolList peptide)
,
addVariableModification(Symbol residue,double[] masses)
public void addVariableModification(Symbol residue, double[] masses) throws IllegalSymbolException
IllegalSymbolException
public boolean removeVariableModifications(char residue) throws IllegalSymbolException
IllegalSymbolException
public boolean removeVariableModifications(Symbol residue)
public static final double getMolecularWeight(SymbolList proteinSeq) throws IllegalSymbolException
IllegalSymbolException
public static final double getMass(SymbolList proteinSeq, String isotopicType, boolean MH_PLUS) throws IllegalSymbolException
getMass
calculates the mass of this peptide. This
only works for the values in the ResidueProperties.xml
configuration file. It is probably slightly faster than the
instance method, but it does not handle post-translational
modifications.proteinSeq
- a SymbolList
whose mass is to be
calculated. This should use the protein alphabet.isotopicType
- a String
The type of isotopes
to calculate. Either mono isotopic or average
isotopic. Acceptable values are
SymbolPropertyTable.AVG_MASS
or
SymbolPropertyTable.MONO_MASS
.MH_PLUS
- a boolean
true if the value needed
is the MH+ mass.double
mass of the peptide.IllegalSymbolException
- if the
SymbolList
contains illegal
Symbol
s.public double getMass(SymbolList proteinSeq) throws IllegalSymbolException
proteinSeq
- The sequence for mass calculationIllegalSymbolException
public double[] getVariableMasses(SymbolList peptide) throws IllegalSymbolException
IllegalSymbolException
addVariableModification(char, double[])
public double getTermMass()
getTermMass
returns the terminal mass being used
by the instance methods.double
mass.Copyright © 2014 BioJava. All rights reserved.