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
  • Constructor Details

  • 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 peptide
      precursorCharge - the new precursor charge
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - the sequence matching parameters to use for modifications
      specificAnnotationSettings - 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 peptide
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - the sequence matching parameters to use for modifications
      possibleFragmentIons - the possible fragment ions of the peptide
      precursorCharge - the new precursor charge
      specificAnnotationSettings - 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 peptide
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - the sequence matching parameters to use for modifications
      specificAnnotationSettings - the specific annotation settings
      peakMz - the m/z of the peak to match
      peakIntensity - 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 settings
      specificAnnotationSettings - the specific annotation settings
      spectrumFile - the file of the spectrum to annotate
      spectrumTitle - the title of the spectrum to annotate
      spectrum - the spectrum to annotate
      peptide - the peptide of interest
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - 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 settings
      specificAnnotationSettings - the specific annotation settings
      spectrumFile - the file of the spectrum to annotate
      spectrumTitle - the title of the spectrum to annotate
      spectrum - the spectrum to annotate
      peptide - the peptide of interest
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - 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 settings
      specificAnnotationSettings - the specific annotation settings
      spectrumFile - the file of the spectrum to annotate
      spectrumTitle - the title of the spectrum to annotate
      spectrum - the spectrum to annotate
      peptide - the peptide of interest
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - the sequence matching parameters to use for modifications
      useIntensityFilter - 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 settings
      specificAnnotationSettings - the specific annotation settings
      spectrumFile - the file of the spectrum to annotate
      spectrumTitle - the title of the spectrum to annotate
      spectrum - the spectrum to annotate
      peptide - the peptide of interest
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - the sequence matching parameters to use for modifications
      useIntensityFilter - 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 settings
      specificAnnotationSettings - the specific annotation settings
      spectrumFile - the file of the spectrum to annotate
      spectrumTitle - the title of the spectrum to annotate
      spectrum - the spectrum to annotate
      peptide - the peptide of interest
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - the sequence matching parameters to use for modifications
      possiblePeptideFragments - the possible peptide fragments for this peptide
      useIntensityFilter - 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 settings
      specificAnnotationSettings - the specific annotation settings
      spectrumFile - the file of the spectrum to annotate
      spectrumTitle - the title of the spectrum to annotate
      spectrum - the spectrum to annotate
      peptide - the peptide of interest
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - the sequence matching parameters to use for modifications
      possiblePeptideFragments - the possible peptide fragments for this peptide
      useIntensityFilter - 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 settings
      specificAnnotationSettings - the specific annotation settings
      spectrumFile - the file of the spectrum to annotate
      spectrumTitle - the title of the spectrum to annotate
      spectrum - The spectrum to match
      peptide - The peptide of interest
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - the sequence matching parameters to use for modifications
      useIntensityFilter - 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 settings
      peptide - The peptide of interest
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - 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 settings
      peptide - The peptide of interest
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - the sequence matching parameters to use for modifications
      possibleFragmentIons - 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 class SpectrumAnnotator
      Parameters:
      spectrumFile - the file of the spectrum to annotate
      spectrumTitle - the title of the spectrum to annotate
      spectrum - the spectrum to annotate
      annotationSettings - the annotation settings
      specificAnnotationSettings - the specific annotation settings
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - the sequence matching parameters to use for modifications
      useIntensityFilter - 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 interest
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - the sequence matching parameters to use for modifications
      Returns:
      the expected possible neutral losses
    • getCurrentlyLoadedPeptide

      public Peptide getCurrentlyLoadedPeptide()
      Returns the currently inspected peptide.
      Returns:
      the currently inspected peptide