public abstract class SpectrumAnnotator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SpectrumAnnotator.TiesResolution
Enum of the possibilities for ties resolution when multiple peaks can be
annotated.
|
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 IonMatchKeysCache |
ionMatchKeysCache
The cache to use for the ion match keys.
|
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 static Integer |
maxIsotopicCorrection
The maximal isotope correction.
|
protected static Integer |
minIsotopicCorrection
The minimal isotope correction.
|
protected double |
mzTolerance
The m/z tolerance for peak matching.
|
protected int |
precursorCharge
The precursor charge as deduced by the search engine.
|
protected SpecificAnnotationSettings |
specificAnnotationSettings
If provided, the annotator will only look for the ions included in the
specific annotation settings.
|
protected static boolean |
subtractIsotope
Minimal isotopic correction when matching an ion.
|
protected HashMap<Integer,HashMap<Integer,ArrayList<Ion>>> |
theoreticalFragmentIons
The theoretic fragment ions.
|
protected SpectrumAnnotator.TiesResolution |
tiesResolution
The methods to use to select the best peak when multiple are possible.
|
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.
|
protected Peak |
getBestPeak(ArrayList<Peak> matchedPeaks,
IonMatch ionMatch)
Returns the peak to retain of the matched peaks according to the ties
resolution setting.
|
ArrayList<IonMatch> |
getCurrentAnnotation(MSnSpectrum spectrum,
AnnotationSettings annotationSettings,
SpecificAnnotationSettings specificAnnotationSettings)
Returns the currently matched ions with the given settings using the intensity filter.
|
abstract ArrayList<IonMatch> |
getCurrentAnnotation(MSnSpectrum spectrum,
AnnotationSettings annotationSettings,
SpecificAnnotationSettings specificAnnotationSettings,
boolean useIntensityFilter)
Returns the currently matched ions with the given settings.
|
String |
getCurrentlyLoadedSpectrumKey()
Returns the spectrum currently inspected.
|
static NeutralLossesMap |
getDefaultLosses(SpectrumIdentificationAssumption spectrumIdentificationAssumption,
SequenceMatchingPreferences sequenceMatchingPreferences,
SequenceMatchingPreferences ptmSequenceMatchingPreferences)
Returns the possible neutral losses expected by default for a given
peptide.
|
protected HashMap<Integer,ArrayList<Ion>> |
getExpectedIons(SpecificAnnotationSettings specificAnnotationSettings)
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 IonMatch |
matchInSpectrum(Ion theoreticIon,
Integer inspectedCharge)
Matches a theoretic ion in the spectrum.
|
protected ArrayList<IonMatch> |
matchPeak(SpecificAnnotationSettings specificAnnotationSettings,
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,
SpectrumAnnotator.TiesResolution tiesResolution)
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 double mzTolerance
protected boolean isPpm
protected static final boolean subtractIsotope
protected static final Integer minIsotopicCorrection
protected static final Integer maxIsotopicCorrection
protected double massShift
protected double massShiftNTerm
protected double massShiftCTerm
protected SpectrumAnnotator.TiesResolution tiesResolution
protected SpecificAnnotationSettings specificAnnotationSettings
protected IonMatchKeysCache ionMatchKeysCache
public static Vector<SpectrumAnnotation> getSpectrumAnnotation(ArrayList<IonMatch> ionMatches)
ionMatches
- list of ion matchesprotected IonMatch matchInSpectrum(Ion theoreticIon, Integer inspectedCharge)
theoreticIon
- the theoretic ioninspectedCharge
- the expected chargeprotected Peak getBestPeak(ArrayList<Peak> matchedPeaks, IonMatch ionMatch)
matchedPeaks
- the peaks matchedionMatch
- an ion match with the ion to be matchedprotected void setSpectrum(MSnSpectrum spectrum, double intensityLimit)
spectrum
- the spectrum to inspectintensityLimit
- the minimal intensity to account forprotected void setMassTolerance(double mzTolerance, boolean isPpm, SpectrumAnnotator.TiesResolution tiesResolution)
mzTolerance
- the new m/z tolerance (in m/z, Th)isPpm
- a boolean indicating whether the mass tolerance is in ppm or
in DatiesResolution
- the method used to resolve tiespublic 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 losstheoreticIon
- the ion of interestpublic boolean chargeValidated(Ion theoreticIon, int charge, int precursorCharge)
theoreticIon
- the ion of interestcharge
- the candidate chargeprecursorCharge
- the precursor chargepublic ArrayList<IonMatch> getCurrentAnnotation(MSnSpectrum spectrum, AnnotationSettings annotationSettings, SpecificAnnotationSettings specificAnnotationSettings) throws InterruptedException, org.apache.commons.math.MathException
spectrum
- the spectrum of interestannotationSettings
- the annotation settingsspecificAnnotationSettings
- the specific annotation settingsInterruptedException
- exception thrown if a threading
error occurred when estimating the noise levelorg.apache.commons.math.MathException
- exception thrown if a math
exception occurred when estimating the noise levelpublic abstract ArrayList<IonMatch> getCurrentAnnotation(MSnSpectrum spectrum, AnnotationSettings annotationSettings, SpecificAnnotationSettings specificAnnotationSettings, boolean useIntensityFilter) throws InterruptedException, org.apache.commons.math.MathException
spectrum
- the spectrum of interestannotationSettings
- the annotation settingsspecificAnnotationSettings
- the specific annotation settingsuseIntensityFilter
- boolean indicating whether intensity filters should be usedInterruptedException
- exception thrown if a threading
error occurred when estimating the noise levelorg.apache.commons.math.MathException
- exception thrown if a math
exception occurred when estimating the noise levelpublic 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, SequenceMatchingPreferences ptmSequenceMatchingPreferences) throws IOException, InterruptedException, ClassNotFoundException, SQLException
spectrumIdentificationAssumption
- the
spectrumIdentificationAssumption of interestsequenceMatchingPreferences
- the sequence matching settings for
peptide to protein mappingptmSequenceMatchingPreferences
- the sequence matching settings for
PTM to peptide mappingIOException
- exception thrown whenever an error occurred while
interacting with a file while mapping potential modification sitesInterruptedException
- exception thrown whenever a threading issue
occurred while mapping potential modification sitesClassNotFoundException
- exception thrown whenever an error
occurred while deserializing an object from the ProteinTreeSQLException
- exception thrown whenever an error occurred while
interacting with the ProteinTreeprotected ArrayList<IonMatch> matchPeak(SpecificAnnotationSettings specificAnnotationSettings, Peak peak)
specificAnnotationSettings
- the specific annotation settingspeak
- The peak to matchprotected HashMap<Integer,ArrayList<Ion>> getExpectedIons(SpecificAnnotationSettings specificAnnotationSettings)
specificAnnotationSettings
- the specific annotation settingspublic static ArrayList<IonMatch> matchReporterIon(Ion theoreticIon, int charge, Spectrum spectrum, double massTolerance) throws InterruptedException
theoreticIon
- the theoretic ion to look forcharge
- the charge of the ionspectrum
- the spectrummassTolerance
- the mass tolerance to useInterruptedException
- exception thrown if the thread is
interruptedCopyright © 2019. All rights reserved.