public abstract class SpectrumAnnotator extends Object
Modifier and Type | Field and Description |
---|---|
protected IonFactory |
fragmentFactory
The Fragment factory which will generate the fragment ions.
|
protected double |
intensityLimit
The intensity limit to use.
|
protected boolean |
isPpm
Boolean indicating whether the tolerance is in ppm (true) or in Dalton
(false).
|
protected double |
massShift
m/z shift applied to all theoretic peaks.
|
protected double |
massShiftCTerm
C-terminal m/z shift applied to all reverse ions.
|
protected double |
massShiftNTerm
N-terminal m/z shift applied to all forward ions.
|
protected double |
mzTolerance
The m/z tolerance for peak matching.
|
protected int |
precursorCharge
The precursor charge as deduced by the search engine.
|
protected HashMap<String,IonMatch> |
spectrumAnnotation
The spectrum annotation as a map: theoretic fragment key -> ionmatch.
|
protected static boolean |
subtractIsotope
Boolean indicating whether the isotopic number shall be removed from the
theoretic mass when matching an ion.
|
protected ArrayList<Ion> |
theoreticalFragmentIons
The theoretic fragment ions.
|
protected ArrayList<String> |
unmatchedIons
List of unmatched ions.
|
Constructor and Description |
---|
SpectrumAnnotator() |
Modifier and Type | Method and Description |
---|---|
boolean |
chargeValidated(Ion theoreticIon,
int charge,
int precursorCharge)
Returns a boolean indicating whether the given charge can be found on the
given fragment ion.
|
abstract ArrayList<IonMatch> |
getCurrentAnnotation(MSnSpectrum spectrum,
HashMap<Ion.IonType,ArrayList<Integer>> iontypes,
NeutralLossesMap neutralLosses,
ArrayList<Integer> charges)
Returns the currently matched ions with the given settings.
|
String |
getCurrentlyLoadedSpectrumKey()
Returns the spectrum currently inspected.
|
static NeutralLossesMap |
getDefaultLosses(SpectrumIdentificationAssumption spectrumIdentificationAssumption,
AminoAcidPattern.MatchingType matchingType,
double mzTolerance)
Returns the possible neutral losses expected by default for a given
peptide.
|
protected HashMap<Integer,ArrayList<Ion>> |
getExpectedIons(HashMap<Ion.IonType,ArrayList<Integer>> iontypes,
NeutralLossesMap neutralLosses,
ArrayList<Integer> charges,
int precursorCharge)
Returns the expected ions in a map indexed by the possible charges.
|
double |
getMassShift()
Returns the m/z shift applied to the fragment ions.
|
double |
getMassShiftCTerm()
Returns the C-terminal m/z shift applied to all reverse ions.
|
double |
getMassShiftNTerm()
Returns the N-terminal m/z shift applied to all forward ions.
|
static Vector<DefaultSpectrumAnnotation> |
getSpectrumAnnotation(ArrayList<IonMatch> ionMatches)
Translates the list of ion matches into a vector of annotations which can
be read by the SpectrumPanel.
|
boolean |
isAccounted(NeutralLossesMap neutralLosses,
NeutralLoss neutralLoss,
Ion ion)
Returns a boolean indicating whether the neutral loss should be accounted
for.
|
boolean |
lossesValidated(NeutralLossesMap neutralLosses,
Ion theoreticIon)
Returns a boolean indicating whether the neutral losses of the given
fragment ion are fit the requirement of the given neutral losses map.
|
protected void |
matchInSpectrum(Ion theoreticIon,
int inspectedCharge)
Matches a theoretic ion in the spectrum.
|
protected ArrayList<IonMatch> |
matchPeak(HashMap<Ion.IonType,ArrayList<Integer>> iontypes,
ArrayList<Integer> charges,
int precursorCharge,
NeutralLossesMap neutralLosses,
Peak peak)
This method matches the potential fragment ions of a given peptide with a
given peak.
|
static ArrayList<IonMatch> |
matchReporterIon(Ion theoreticIon,
Spectrum spectrum,
double massTolerance)
Convenience method to match a reporter ion in a spectrum.
|
void |
setMassShift(double aMassShift)
Sets an m/z shift on all ions.
|
void |
setMassShifts(double aMassShift,
double aMassShiftNTerm,
double aMassShiftCTerm)
Sets the m/z shifts.
|
protected void |
setMassTolerance(double mzTolerance,
boolean isPpm)
Sets a new m/z tolerance for peak matching.
|
protected void |
setSpectrum(MSnSpectrum spectrum,
double intensityLimit)
Sets a new spectrum to annotate.
|
void |
setTerminalMassShifts(double aMassShiftNTerm,
double aMassShiftCTerm)
Sets the terminal m/z shifts.
|
protected int precursorCharge
protected ArrayList<Ion> theoreticalFragmentIons
protected IonFactory fragmentFactory
protected double intensityLimit
protected HashMap<String,IonMatch> spectrumAnnotation
protected double mzTolerance
protected boolean isPpm
protected static final boolean subtractIsotope
protected double massShift
protected double massShiftNTerm
protected double massShiftCTerm
public static Vector<DefaultSpectrumAnnotation> getSpectrumAnnotation(ArrayList<IonMatch> ionMatches)
ionMatches
- list of ion matchesprotected void matchInSpectrum(Ion theoreticIon, int inspectedCharge)
theoreticIon
- the theoretic ioninspectedCharge
- the expected chargeprotected void setSpectrum(MSnSpectrum spectrum, double intensityLimit)
spectrum
- The spectrum to inspectintensityLimit
- the minimal intensity to account forprotected void setMassTolerance(double mzTolerance, boolean isPpm)
mzTolerance
- the new m/z tolerance (in m/z, Th)isPpm
- a boolean indicating whether the mass tolerance is in ppm or
in Dapublic boolean isAccounted(NeutralLossesMap neutralLosses, NeutralLoss neutralLoss, Ion ion)
neutralLosses
- Map of expected neutral lossesneutralLoss
- the neutral loss of interestion
- the fragment ion of interestpublic boolean lossesValidated(NeutralLossesMap neutralLosses, Ion theoreticIon)
neutralLosses
- Map of expected neutral losses: neutral loss.theoreticIon
- the ion of interestpublic boolean chargeValidated(Ion theoreticIon, int charge, int precursorCharge)
theoreticIon
- the ion of interestcharge
- the candidate chargeprecursorCharge
- the precursor chargepublic abstract ArrayList<IonMatch> getCurrentAnnotation(MSnSpectrum spectrum, HashMap<Ion.IonType,ArrayList<Integer>> iontypes, NeutralLossesMap neutralLosses, ArrayList<Integer> charges)
spectrum
- the spectrum of interestiontypes
- The expected fragment ions to look forneutralLosses
- Map of expected neutral losses: neutral loss ->
first position in the sequence (first aa is 1). let null if neutral
losses should not be considered.charges
- List of expected chargespublic String getCurrentlyLoadedSpectrumKey()
public double getMassShift()
public double getMassShiftNTerm()
public double getMassShiftCTerm()
public void setMassShift(double aMassShift)
aMassShift
- the m/z shift to applypublic void setMassShifts(double aMassShift, double aMassShiftNTerm, double aMassShiftCTerm)
aMassShift
- the m/z shift to applyaMassShiftNTerm
- the n-terminal mass shift to apply to all forward
ionsaMassShiftCTerm
- the c-terminal mass shift to apply to all reverse
ionspublic void setTerminalMassShifts(double aMassShiftNTerm, double aMassShiftCTerm)
aMassShiftNTerm
- the n-terminal mass shift to apply to all forward
ionsaMassShiftCTerm
- the c-terminal mass shift to apply to all reverse
ionspublic static NeutralLossesMap getDefaultLosses(SpectrumIdentificationAssumption spectrumIdentificationAssumption, AminoAcidPattern.MatchingType matchingType, double mzTolerance) throws IOException, IllegalArgumentException, InterruptedException, FileNotFoundException, ClassNotFoundException, SQLException
spectrumIdentificationAssumption
- the
spectrumIdentificationAssumption of interestmatchingType
- the matching type to map ptms on the peptide sequencemzTolerance
- the ms2 m/z tolerance to useIOException
IllegalArgumentException
InterruptedException
FileNotFoundException
ClassNotFoundException
SQLException
protected ArrayList<IonMatch> matchPeak(HashMap<Ion.IonType,ArrayList<Integer>> iontypes, ArrayList<Integer> charges, int precursorCharge, NeutralLossesMap neutralLosses, Peak peak)
iontypes
- The fragment ions selectedcharges
- The charges of the fragment to search forprecursorCharge
- The precursor charge as deduced by the search
engineneutralLosses
- Map of expected neutral losses: neutral loss ->
maximal position in the sequence (first aa is 1). let null if neutral
losses should not be considered.peak
- The peak to matchprotected HashMap<Integer,ArrayList<Ion>> getExpectedIons(HashMap<Ion.IonType,ArrayList<Integer>> iontypes, NeutralLossesMap neutralLosses, ArrayList<Integer> charges, int precursorCharge)
iontypes
- The expected ions to look forneutralLosses
- Map of expected neutral losses: neutral loss ->
first position in the sequence (first aa is 1). let null if neutral
losses should not be considered.charges
- List of expected chargesprecursorCharge
- The precursor chargepublic static ArrayList<IonMatch> matchReporterIon(Ion theoreticIon, Spectrum spectrum, double massTolerance)
theoreticIon
- the theoretic ion to look forspectrum
- the spectrummassTolerance
- the mass tolerance to useCopyright © 2014. All Rights Reserved.