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 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 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 SpecificAnnotationSettings |
specificAnnotationSettings
If provided, the annotator will only look for the ions included in the
specific annotation settings.
|
protected HashMap<String,IonMatch> |
spectrumAnnotation
The spectrum annotation as a map: theoretic fragment key > ionmatch.
|
protected static boolean |
subtractIsotope
Minimal isotopic correction when matching an ion.
|
protected HashMap<Integer,HashMap<Integer,ArrayList<Ion>>> |
theoreticalFragmentIons
The theoretic fragment ions.
|
protected HashSet<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,
AnnotationSettings annotationSettings,
SpecificAnnotationSettings specificAnnotationSettings)
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 boolean |
matchInSpectrum(Ion theoreticIon,
int 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,
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 static final Integer minIsotopicCorrection
protected static final Integer maxIsotopicCorrection
protected double massShift
protected double massShiftNTerm
protected double massShiftCTerm
protected boolean pickMostAccuratePeak
protected SpecificAnnotationSettings specificAnnotationSettings
protected IonMatchKeysCache ionMatchKeysCache
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 losstheoreticIon
- 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, AnnotationSettings annotationSettings, SpecificAnnotationSettings specificAnnotationSettings)
spectrum
- the spectrum of interestannotationSettings
- the annotation settingsspecificAnnotationSettings
- the specific annotation settingspublic 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)
theoreticIon
- the theoretic ion to look forcharge
- the charge of the ionspectrum
- the spectrummassTolerance
- the mass tolerance to useCopyright © 2016. All rights reserved.