Class PeptideSpectrumAnnotator
java.lang.Object
com.compomics.util.experiment.identification.spectrum_annotation.SpectrumAnnotator
com.compomics.util.experiment.identification.spectrum_annotation.spectrum_annotators.PeptideSpectrumAnnotator
public class PeptideSpectrumAnnotator extends SpectrumAnnotator
Annotates a spectrum with peptide fragments. Warning: operations are not
synchronized use one annotator per thread.
- Author:
- Marc Vaudel
-
Nested Class Summary
Nested classes/interfaces inherited from class com.compomics.util.experiment.identification.spectrum_annotation.SpectrumAnnotator
SpectrumAnnotator.TiesResolution
-
Field Summary
Fields inherited from class com.compomics.util.experiment.identification.spectrum_annotation.SpectrumAnnotator
defaultPrecursorCharges, fragmentFactory, intensityLimit, ionMatchKeysCache, isPpm, massShift, massShiftCTerm, massShiftNTerm, MAX_ISOTOPIC_CORRRECTION, MIN_ISOTOPIC_CORRRECTION, mzTolerance, precursorCharge, specificAnnotationSettings, spectrumFile, spectrumTitle, SUBTRACT_ISOTOPE, theoreticalFragmentIons, tiesResolution
-
Constructor Summary
Constructors Constructor Description PeptideSpectrumAnnotator()
Constructor. -
Method Summary
Modifier and Type Method Description Map<Integer,ArrayList<IonMatch>>
getCoveredAminoAcids(AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, String spectrumFile, String spectrumTitle, Spectrum spectrum, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, boolean useIntensityFilter)
Returns the ion matches corresponding to fragment ions indexed by amino acid number in the sequence.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.Peptide
getCurrentlyLoadedPeptide()
Returns the currently inspected peptide.static NeutralLossesMap
getDefaultLosses(Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters)
Returns the possible neutral losses expected by default for a given peptide.HashMap<Integer,ArrayList<Ion>>
getExpectedIons(SpecificAnnotationParameters specificAnnotationSettings, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters)
Returns the expected ions in a map indexed by the possible charges.HashMap<Integer,ArrayList<Ion>>
getExpectedIons(SpecificAnnotationParameters specificAnnotationSettings, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, HashMap<Integer,HashMap<Integer,ArrayList<Ion>>> possibleFragmentIons)
Returns the expected ions in a map indexed by the possible charges.IonMatch[]
getSpectrumAnnotation(AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, String spectrumFile, String spectrumTitle, Spectrum spectrum, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters)
Returns the spectrum annotations of a spectrum in a list of IonMatches using the intensity filter.IonMatch[]
getSpectrumAnnotation(AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, String spectrumFile, String spectrumTitle, Spectrum spectrum, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, boolean useIntensityFilter)
Returns the spectrum annotations of a spectrum in a list of IonMatches.IonMatch[]
getSpectrumAnnotation(AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, String spectrumFile, String spectrumTitle, Spectrum spectrum, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, HashMap<Integer,HashMap<Integer,ArrayList<Ion>>> possiblePeptideFragments, boolean useIntensityFilter)
Returns the spectrum annotations of a spectrum in an array of IonMatches.java.util.stream.Stream<IonMatch>
getSpectrumAnnotationStream(AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, String spectrumFile, String spectrumTitle, Spectrum spectrum, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters)
Returns the spectrum annotations of a spectrum in a list of IonMatches using the intensity filter.java.util.stream.Stream<IonMatch>
getSpectrumAnnotationStream(AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, String spectrumFile, String spectrumTitle, Spectrum spectrum, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, boolean useIntensityFilter)
Returns the spectrum annotations of a spectrum in a list of IonMatches.java.util.stream.Stream<IonMatch>
getSpectrumAnnotationStream(AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, String spectrumFile, String spectrumTitle, Spectrum spectrum, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, HashMap<Integer,HashMap<Integer,ArrayList<Ion>>> possiblePeptideFragments, boolean useIntensityFilter)
Returns the spectrum annotations of a spectrum in a stream of IonMatches.ArrayList<IonMatch>
matchPeak(Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, SpecificAnnotationParameters specificAnnotationSettings, double peakMz, double peakIntensity)
This method matches the potential fragment ions of a given peptide with a given peak according to the annotation settings.void
setPeptide(Peptide peptide, int precursorCharge, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, SpecificAnnotationParameters specificAnnotationSettings)
Sets a new peptide to annotate.void
setPeptide(Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, HashMap<Integer,HashMap<Integer,ArrayList<Ion>>> possibleFragmentIons, int precursorCharge, SpecificAnnotationParameters specificAnnotationSettings)
Sets a new peptide to annotate.Methods inherited from class com.compomics.util.experiment.identification.spectrum_annotation.SpectrumAnnotator
chargeValidated, getCurrentAnnotation, getCurrentlyLoadedSpectrumFile, getCurrentlyLoadedSpectrumTitle, getDefaultLosses, getExpectedIons, getMassShift, getMassShiftCTerm, getMassShiftNTerm, getSpectrumAnnotation, isAccounted, lossesValidated, matchInSpectrum, matchPeak, matchReporterIon, setBestPeak, setMassShift, setMassShifts, setMassTolerance, setSpectrum, setTerminalMassShifts, updateMassShifts
-
Constructor Details
-
PeptideSpectrumAnnotator
public PeptideSpectrumAnnotator()Constructor.
-
-
Method Details
-
setPeptide
public void setPeptide(Peptide peptide, int precursorCharge, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, SpecificAnnotationParameters specificAnnotationSettings)Sets a new peptide to annotate.- Parameters:
peptide
- the new peptideprecursorCharge
- the new precursor chargemodificationParameters
- the modification parameters the modification parameterssequenceProvider
- a protein sequence providermodificationsSequenceMatchingParameters
- the sequence matching parameters to use for modificationsspecificAnnotationSettings
- if provided, only the ions detectable using these settings will be selected
-
setPeptide
public void setPeptide(Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, HashMap<Integer,HashMap<Integer,ArrayList<Ion>>> possibleFragmentIons, int precursorCharge, SpecificAnnotationParameters specificAnnotationSettings)Sets a new peptide to annotate.- Parameters:
peptide
- the new peptidemodificationParameters
- the modification parameters the modification parameterssequenceProvider
- a protein sequence providermodificationsSequenceMatchingParameters
- the sequence matching parameters to use for modificationspossibleFragmentIons
- the possible fragment ions of the peptideprecursorCharge
- the new precursor chargespecificAnnotationSettings
- if provided, only the ions detectable using these settings will be selected
-
matchPeak
public ArrayList<IonMatch> matchPeak(Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, SpecificAnnotationParameters specificAnnotationSettings, double peakMz, double peakIntensity)This method matches the potential fragment ions of a given peptide with a given peak according to the annotation settings.- Parameters:
peptide
- the peptidemodificationParameters
- the modification parameters the modification parameterssequenceProvider
- a protein sequence providermodificationsSequenceMatchingParameters
- the sequence matching parameters to use for modificationsspecificAnnotationSettings
- the specific annotation settingspeakMz
- the m/z of the peak to matchpeakIntensity
- the intensity of the peak to match- Returns:
- a list of potential ion matches
-
getSpectrumAnnotation
public IonMatch[] getSpectrumAnnotation(AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, String spectrumFile, String spectrumTitle, Spectrum spectrum, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters)Returns the spectrum annotations of a spectrum in a list of IonMatches using the intensity filter. Note that, except for +1 precursors, fragments ions will be expected to have a charge strictly smaller than the precursor ion charge.- Parameters:
annotationSettings
- the annotation settingsspecificAnnotationSettings
- the specific annotation settingsspectrumFile
- the file of the spectrum to annotatespectrumTitle
- the title of the spectrum to annotatespectrum
- the spectrum to annotatepeptide
- the peptide of interestmodificationParameters
- the modification parameters the modification parameterssequenceProvider
- a protein sequence providermodificationsSequenceMatchingParameters
- the sequence matching parameters to use for modifications- Returns:
- an ArrayList of IonMatch containing the ion matches with the given settings
-
getSpectrumAnnotationStream
public java.util.stream.Stream<IonMatch> getSpectrumAnnotationStream(AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, String spectrumFile, String spectrumTitle, Spectrum spectrum, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters)Returns the spectrum annotations of a spectrum in a list of IonMatches using the intensity filter. Note that, except for +1 precursors, fragments ions will be expected to have a charge strictly smaller than the precursor ion charge.- Parameters:
annotationSettings
- the annotation settingsspecificAnnotationSettings
- the specific annotation settingsspectrumFile
- the file of the spectrum to annotatespectrumTitle
- the title of the spectrum to annotatespectrum
- the spectrum to annotatepeptide
- the peptide of interestmodificationParameters
- the modification parameters the modification parameterssequenceProvider
- a protein sequence providermodificationsSequenceMatchingParameters
- the sequence matching parameters to use for modifications- Returns:
- an ArrayList of IonMatch containing the ion matches with the given settings
-
getSpectrumAnnotationStream
public java.util.stream.Stream<IonMatch> getSpectrumAnnotationStream(AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, String spectrumFile, String spectrumTitle, Spectrum spectrum, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, boolean useIntensityFilter)Returns the spectrum annotations of a spectrum in a list of IonMatches. Note that, except for +1 precursors, fragments ions will be expected to have a charge strictly smaller than the precursor ion charge.- Parameters:
annotationSettings
- the annotation settingsspecificAnnotationSettings
- the specific annotation settingsspectrumFile
- the file of the spectrum to annotatespectrumTitle
- the title of the spectrum to annotatespectrum
- the spectrum to annotatepeptide
- the peptide of interestmodificationParameters
- 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 used- Returns:
- an ArrayList of IonMatch containing the ion matches with the given settings
-
getSpectrumAnnotation
public IonMatch[] getSpectrumAnnotation(AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, String spectrumFile, String spectrumTitle, Spectrum spectrum, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, boolean useIntensityFilter)Returns the spectrum annotations of a spectrum in a list of IonMatches. Note that, except for +1 precursors, fragments ions will be expected to have a charge strictly smaller than the precursor ion charge.- Parameters:
annotationSettings
- the annotation settingsspecificAnnotationSettings
- the specific annotation settingsspectrumFile
- the file of the spectrum to annotatespectrumTitle
- the title of the spectrum to annotatespectrum
- the spectrum to annotatepeptide
- the peptide of interestmodificationParameters
- 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 used- Returns:
- an ArrayList of IonMatch containing the ion matches with the given settings
-
getSpectrumAnnotation
public IonMatch[] getSpectrumAnnotation(AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, String spectrumFile, String spectrumTitle, Spectrum spectrum, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, HashMap<Integer,HashMap<Integer,ArrayList<Ion>>> possiblePeptideFragments, boolean useIntensityFilter)Returns the spectrum annotations of a spectrum in an array of IonMatches. Note that, except for +1 precursors, fragments ions will be expected to have a charge strictly smaller than the precursor ion charge.- Parameters:
annotationSettings
- the annotation settingsspecificAnnotationSettings
- the specific annotation settingsspectrumFile
- the file of the spectrum to annotatespectrumTitle
- the title of the spectrum to annotatespectrum
- the spectrum to annotatepeptide
- the peptide of interestmodificationParameters
- the modification parameters the modification parameterssequenceProvider
- a protein sequence providermodificationsSequenceMatchingParameters
- the sequence matching parameters to use for modificationspossiblePeptideFragments
- the possible peptide fragments for this peptideuseIntensityFilter
- boolean indicating whether intensity filters should be used- Returns:
- an ArrayList of IonMatch containing the ion matches with the given settings
-
getSpectrumAnnotationStream
public java.util.stream.Stream<IonMatch> getSpectrumAnnotationStream(AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, String spectrumFile, String spectrumTitle, Spectrum spectrum, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, HashMap<Integer,HashMap<Integer,ArrayList<Ion>>> possiblePeptideFragments, boolean useIntensityFilter)Returns the spectrum annotations of a spectrum in a stream of IonMatches. Note that, except for +1 precursors, fragments ions will be expected to have a charge strictly smaller than the precursor ion charge.- Parameters:
annotationSettings
- the annotation settingsspecificAnnotationSettings
- the specific annotation settingsspectrumFile
- the file of the spectrum to annotatespectrumTitle
- the title of the spectrum to annotatespectrum
- the spectrum to annotatepeptide
- the peptide of interestmodificationParameters
- the modification parameters the modification parameterssequenceProvider
- a protein sequence providermodificationsSequenceMatchingParameters
- the sequence matching parameters to use for modificationspossiblePeptideFragments
- the possible peptide fragments for this peptideuseIntensityFilter
- boolean indicating whether intensity filters should be used- Returns:
- an ArrayList of IonMatch containing the ion matches with the given settings
-
getCoveredAminoAcids
public Map<Integer,ArrayList<IonMatch>> getCoveredAminoAcids(AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, String spectrumFile, String spectrumTitle, Spectrum spectrum, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, boolean useIntensityFilter)Returns the ion matches corresponding to fragment ions indexed by amino acid number in the sequence. 1 is first amino acid.- Parameters:
annotationSettings
- the annotation settingsspecificAnnotationSettings
- the specific annotation settingsspectrumFile
- the file of the spectrum to annotatespectrumTitle
- the title of the spectrum to annotatespectrum
- The spectrum to matchpeptide
- The peptide of interestmodificationParameters
- 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 used- Returns:
- the ion matches corresponding to fragment ions indexed by amino acid number in the sequence
-
getExpectedIons
public HashMap<Integer,ArrayList<Ion>> getExpectedIons(SpecificAnnotationParameters specificAnnotationSettings, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters)Returns the expected ions in a map indexed by the possible charges. Note that, except for +1 precursors, fragments ions will be expected to have a charge strictly smaller than the precursor ion charge.- Parameters:
specificAnnotationSettings
- the specific annotation settingspeptide
- The peptide of interestmodificationParameters
- the modification parameters the modification parameterssequenceProvider
- a protein sequence providermodificationsSequenceMatchingParameters
- the sequence matching parameters to use for modifications- Returns:
- an ArrayList of IonMatch containing the ion matches with the given settings
-
getExpectedIons
public HashMap<Integer,ArrayList<Ion>> getExpectedIons(SpecificAnnotationParameters specificAnnotationSettings, Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, HashMap<Integer,HashMap<Integer,ArrayList<Ion>>> possibleFragmentIons)Returns the expected ions in a map indexed by the possible charges. Note that, except for +1 precursors, fragments ions will be expected to have a charge strictly smaller than the precursor ion charge.- Parameters:
specificAnnotationSettings
- the specific annotation settingspeptide
- The peptide of interestmodificationParameters
- the modification parameters the modification parameterssequenceProvider
- a protein sequence providermodificationsSequenceMatchingParameters
- the sequence matching parameters to use for modificationspossibleFragmentIons
- the possible fragment ions for the given peptide- Returns:
- an ArrayList of IonMatch containing the ion matches with the given settings
-
getCurrentAnnotation
public IonMatch[] getCurrentAnnotation(String spectrumFile, String spectrumTitle, Spectrum spectrum, AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters, boolean useIntensityFilter)Description copied from class:SpectrumAnnotator
Returns the currently matched ions with the given settings.- Specified by:
getCurrentAnnotation
in classSpectrumAnnotator
- Parameters:
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 used- Returns:
- the currently matched ions with the given settings
-
getDefaultLosses
public static NeutralLossesMap getDefaultLosses(Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters)Returns the possible neutral losses expected by default for a given peptide.- Parameters:
peptide
- the peptide of interestmodificationParameters
- the modification parameters the modification parameterssequenceProvider
- a protein sequence providermodificationsSequenceMatchingParameters
- the sequence matching parameters to use for modifications- Returns:
- the expected possible neutral losses
-
getCurrentlyLoadedPeptide
Returns the currently inspected peptide.- Returns:
- the currently inspected peptide
-