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 HashSet<Integer> |
defaultPrecursorCharges
The precursor charges to inspect by default.
|
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 |
MAX_ISOTOPIC_CORRRECTION
The maximal isotope correction.
|
protected static Integer |
MIN_ISOTOPIC_CORRRECTION
The minimum 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 SpecificAnnotationParameters |
specificAnnotationSettings
If provided, the annotator will only look for the ions included in the
specific annotation settings.
|
protected String |
spectrumFile
The file of the currently loaded spectrum.
|
protected String |
spectrumTitle
The title of the currently loaded spectrum.
|
protected static boolean |
SUBTRACT_ISOTOPE
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()
Empty default constructor
|
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.
|
IonMatch[] |
getCurrentAnnotation(String spectrumFile,
String spectrumTitle,
Spectrum spectrum,
AnnotationParameters annotationSettings,
SpecificAnnotationParameters specificAnnotationSettings,
ModificationParameters modificationParameters,
SequenceProvider sequenceProvider,
SequenceMatchingParameters modificationsSequenceMatchingParameters)
Returns the currently matched ions with the given settings using the
intensity filter.
|
abstract IonMatch[] |
getCurrentAnnotation(String spectrumFile,
String spectrumTitle,
Spectrum spectrum,
AnnotationParameters annotationSettings,
SpecificAnnotationParameters specificAnnotationSettings,
ModificationParameters modificationParameters,
SequenceProvider sequenceProvider,
SequenceMatchingParameters modificationsSequenceMatchingParameters,
boolean useIntensityFilter)
Returns the currently matched ions with the given settings.
|
String |
getCurrentlyLoadedSpectrumFile()
Returns the file of the spectrum currently inspected.
|
String |
getCurrentlyLoadedSpectrumTitle()
Returns the title of the spectrum currently inspected.
|
static NeutralLossesMap |
getDefaultLosses(SpectrumIdentificationAssumption spectrumIdentificationAssumption,
ModificationParameters modificationParameters,
SequenceProvider sequenceProvider,
SequenceMatchingParameters modificationsSequenceMatchingParameters,
SpectrumAnnotator spectrumAnnotator)
Returns the possible neutral losses expected by default for a given
peptide.
|
protected HashMap<Integer,ArrayList<Ion>> |
getExpectedIons(SpecificAnnotationParameters 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(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(double[] spectrumMz,
double[] spectrumIntensity,
Ion theoreticIon,
Integer inspectedCharge)
Matches a theoretic ion in the spectrum.
|
protected ArrayList<IonMatch> |
matchPeak(SpecificAnnotationParameters specificAnnotationSettings,
double peakMz,
double peakIntensity)
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.
|
protected IonMatch |
setBestPeak(double[] spectrumMz,
double[] spectrumIntensity,
int[] matchedPeaksIndexes,
IonMatch ionMatch)
Returns the peak to retain of the matched peaks according to the ties
resolution setting.
|
void |
setMassShift(double massShift)
Sets an m/z shift on all ions.
|
void |
setMassShifts(double massShift,
double massShiftNTerm,
double massShiftCTerm)
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(String spectrumFile,
String spectrumTitle,
Spectrum spectrum,
double intensityLimit)
Sets a new spectrum to annotate.
|
void |
setTerminalMassShifts(double massShiftNTerm,
double massShiftCTerm)
Sets the terminal m/z shifts.
|
protected void |
updateMassShifts()
Updates the mass shifts.
|
protected int precursorCharge
protected HashSet<Integer> defaultPrecursorCharges
protected HashMap<Integer,HashMap<Integer,ArrayList<Ion>>> theoreticalFragmentIons
protected IonFactory fragmentFactory
protected String spectrumFile
protected String spectrumTitle
protected double intensityLimit
protected double mzTolerance
protected boolean isPpm
protected static final boolean SUBTRACT_ISOTOPE
protected static final Integer MIN_ISOTOPIC_CORRRECTION
protected static final Integer MAX_ISOTOPIC_CORRRECTION
protected double massShift
protected double massShiftNTerm
protected double massShiftCTerm
protected SpectrumAnnotator.TiesResolution tiesResolution
protected SpecificAnnotationParameters specificAnnotationSettings
protected IonMatchKeysCache ionMatchKeysCache
public static Vector<SpectrumAnnotation> getSpectrumAnnotation(IonMatch[] ionMatches)
ionMatches
- list of ion matchesprotected IonMatch matchInSpectrum(double[] spectrumMz, double[] spectrumIntensity, Ion theoreticIon, Integer inspectedCharge)
spectrumMz
- the m/z array of the spectrumspectrumIntensity
- the intensity array of the spectrumtheoreticIon
- the theoretic ioninspectedCharge
- the expected chargeprotected IonMatch setBestPeak(double[] spectrumMz, double[] spectrumIntensity, int[] matchedPeaksIndexes, IonMatch ionMatch)
spectrumMz
- The m/z array of the spectrum.spectrumIntensity
- The intensity array of the spectrum.matchedPeaksIndexes
- The indexes of the peaks matched.ionMatch
- The ion match with the ion to be matched.protected void setSpectrum(String spectrumFile, String spectrumTitle, Spectrum spectrum, double intensityLimit)
spectrumFile
- the file of the spectrum to annotate.spectrumTitle
- the title of the spectrum to annotate.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 IonMatch[] getCurrentAnnotation(String spectrumFile, String spectrumTitle, Spectrum spectrum, AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters)
spectrumFile
- the file of the spectrum to annotatespectrumTitle
- the title of the spectrum to annotatespectrum
- the spectrum of interestannotationSettings
- the annotation settingsspecificAnnotationSettings
- the specific annotation settingsmodificationParameters
- the modification parameters the
modification parameterssequenceProvider
- a protein sequence providermodificationsSequenceMatchingParameters
- the sequence matching
parameters to use for modificationspublic abstract IonMatch[] getCurrentAnnotation(String spectrumFile, String spectrumTitle, Spectrum spectrum, AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, boolean useIntensityFilter)
spectrumFile
- the file of the spectrum to annotatespectrumTitle
- the title of the spectrum to annotatespectrum
- the spectrum to annotateannotationSettings
- the annotation settingsspecificAnnotationSettings
- the specific annotation settingsmodificationParameters
- the modification parameters the
modification parameterssequenceProvider
- a protein sequence providermodificationsSequenceMatchingParameters
- the sequence matching
parameters to use for modificationsuseIntensityFilter
- boolean indicating whether intensity filters
should be usedpublic String getCurrentlyLoadedSpectrumFile()
public String getCurrentlyLoadedSpectrumTitle()
public double getMassShift()
public double getMassShiftNTerm()
public double getMassShiftCTerm()
public void setMassShift(double massShift)
massShift
- the m/z shift to applypublic void setMassShifts(double massShift, double massShiftNTerm, double massShiftCTerm)
massShift
- the m/z shift to applymassShiftNTerm
- the n-terminal mass shift to apply to all forward
ionsmassShiftCTerm
- the c-terminal mass shift to apply to all reverse
ionspublic void setTerminalMassShifts(double massShiftNTerm, double massShiftCTerm)
massShiftNTerm
- the n-terminal mass shift to apply to all forward
ionsmassShiftCTerm
- the c-terminal mass shift to apply to all reverse
ionsprotected void updateMassShifts()
public static NeutralLossesMap getDefaultLosses(SpectrumIdentificationAssumption spectrumIdentificationAssumption, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, SpectrumAnnotator spectrumAnnotator)
spectrumIdentificationAssumption
- the
spectrumIdentificationAssumption of interestmodificationParameters
- the modification parameters the
modification parameterssequenceProvider
- a protein sequence providermodificationsSequenceMatchingParameters
- the sequence matching
parameters to use for modificationsspectrumAnnotator
- the spectrum annotatorprotected ArrayList<IonMatch> matchPeak(SpecificAnnotationParameters specificAnnotationSettings, double peakMz, double peakIntensity)
specificAnnotationSettings
- The specific annotation settings.peakMz
- The m/z of the peak to match.peakIntensity
- The intensity of the peak to match.protected HashMap<Integer,ArrayList<Ion>> getExpectedIons(SpecificAnnotationParameters specificAnnotationSettings)
specificAnnotationSettings
- the specific annotation settingspublic 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 © 2021. All rights reserved.