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 boolean |
pickMostAccuratePeak
If there are more than one matching peak for a given annotation setting
this value to true results in the most accurate peak being annotated,
while setting this to false annotates the most intense peak.
|
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 HashMap<Integer,HashMap<Integer,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,HashSet<Integer>> iontypes,
NeutralLossesMap neutralLosses,
ArrayList<Integer> charges,
boolean pickMostAccuratePeak)
Returns the currently matched ions with the given settings.
|
String |
getCurrentlyLoadedSpectrumKey()
Returns the spectrum currently inspected.
|
static NeutralLossesMap |
getDefaultLosses(SpectrumIdentificationAssumption spectrumIdentificationAssumption,
SequenceMatchingPreferences sequenceMatchingPreferences)
Returns the possible neutral losses expected by default for a given
peptide.
|
protected HashMap<Integer,ArrayList<Ion>> |
getExpectedIons(HashMap<Ion.IonType,HashSet<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<SpectrumAnnotation> |
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 fit the requirement of the given neutral losses map.
|
protected boolean |
matchInSpectrum(Ion theoreticIon,
int inspectedCharge)
Matches a theoretic ion in the spectrum.
|
protected ArrayList<IonMatch> |
matchPeak(HashMap<Ion.IonType,HashSet<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,
int charge,
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,
boolean pickMostAccuratePeak)
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 void |
updateMassShifts()
Updates the mass shifts.
|
protected int precursorCharge
protected HashMap<Integer,HashMap<Integer,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
protected boolean pickMostAccuratePeak
public static Vector<SpectrumAnnotation> getSpectrumAnnotation(ArrayList<IonMatch> ionMatches)
ionMatches
- list of ion matchesprotected boolean 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, boolean pickMostAccuratePeak)
mzTolerance
- the new m/z tolerance (in m/z, Th)isPpm
- a boolean indicating whether the mass tolerance is in ppm or
in DapickMostAccuratePeak
- if there are more than one matching peak for
a given annotation setting this value to true results in the most
accurate peak being annotated, while setting this to false annotates the
most intense peakpublic 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,HashSet<Integer>> iontypes, NeutralLossesMap neutralLosses, ArrayList<Integer> charges, boolean pickMostAccuratePeak)
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 chargespickMostAccuratePeak
- if there are more than one matching peak for
a given annotation setting this value to true results in the most
accurate peak being annotated, while setting this to false annotates the
most intense peakpublic 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
ionsprotected void updateMassShifts()
public static NeutralLossesMap getDefaultLosses(SpectrumIdentificationAssumption spectrumIdentificationAssumption, SequenceMatchingPreferences sequenceMatchingPreferences) throws IOException, IllegalArgumentException, InterruptedException, FileNotFoundException, ClassNotFoundException, SQLException
spectrumIdentificationAssumption
- the
spectrumIdentificationAssumption of interestsequenceMatchingPreferences
- the sequence matching preferencesIOException
- if an IOException occursIllegalArgumentException
- if an IllegalArgumentException occursInterruptedException
- if an InterruptedException occursFileNotFoundException
- if a FileNotFoundException occursClassNotFoundException
- if a ClassNotFoundException occursSQLException
- if an SQLException occursprotected ArrayList<IonMatch> matchPeak(HashMap<Ion.IonType,HashSet<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,HashSet<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, int charge, Spectrum spectrum, double massTolerance)
theoreticIon
- the theoretic ion to look forcharge
- the charge of the ionspectrum
- the spectrummassTolerance
- the mass tolerance to useCopyright © 2015. All rights reserved.