com.compomics.util.experiment.identification
Class SpectrumAnnotator

java.lang.Object
  extended by com.compomics.util.experiment.identification.SpectrumAnnotator

public class SpectrumAnnotator
extends Object

The spectrum annotator annotates peaks in a spectrum.

Author:
Marc

Field Summary
static String SEPARATOR
          Separator for the theoretic fragment key components
 
Constructor Summary
SpectrumAnnotator()
          Constructor
 
Method Summary
 boolean chargeValidated(PeptideFragmentIon fragmentIon, int charge)
          Returns a boolean indicating whether the given charge can be found on the given fragment ion
 ArrayList<IonMatch> getCurrentAnnotation(ArrayList<PeptideFragmentIon.PeptideFragmentIonType> expectedFragmentIons, NeutralLossesMap neutralLosses, ArrayList<Integer> charges)
          Returns the currently matched ions with the given settings
 Peptide getCurrentlyLoadedPeptide()
          Returns the currently inspected peptide
 String getCurrentlyLoadedSpectrumKey()
          Returns the spectrum currently inspected
static NeutralLossesMap getDefaultLosses(Peptide peptide)
          Returns the possible neutral losses expected by default for a given peptide
 HashMap<Integer,ArrayList<PeptideFragmentIon>> getExpectedIons(ArrayList<PeptideFragmentIon.PeptideFragmentIonType> expectedFragmentIons, NeutralLossesMap neutralLosses, ArrayList<Integer> charges, Peptide peptide, int precursorCharge)
          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.
 double getMassShift()
          Returns the m/z shift applied to the fragment ions
static Vector<DefaultSpectrumAnnotation> getSpectrumAnnotation(ArrayList<IonMatch> ionMatches)
          Translates the list of ion matches into a vector of annotations which can be read by the SpectrumPAnel
 ArrayList<IonMatch> getSpectrumAnnotation(ArrayList<PeptideFragmentIon.PeptideFragmentIonType> expectedFragmentIons, NeutralLossesMap neutralLosses, ArrayList<Integer> charges, MSnSpectrum spectrum, Peptide peptide, double intensityLimit, double mzTolerance)
          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.
static String getTheoreticFragmentKey(PeptideFragmentIon fragmentIon, int charge)
          Returns the key of a theoretic fragment
 boolean isAccounted(NeutralLossesMap neutralLosses, NeutralLoss neutralLoss, PeptideFragmentIon fragmentIon, Peptide peptide)
          Returns a boolean indicating whether the neutral loss should be accounted for
 boolean lossesValidated(NeutralLossesMap neutralLosses, PeptideFragmentIon fragmentIon, Peptide peptide)
          Returns a boolean indicating whether the neutral losses of the given fragment ion are fit the requirement of the given neutral losses map
 ArrayList<IonMatch> matchPeak(Peptide peptide, ArrayList<PeptideFragmentIon.PeptideFragmentIonType> iontypes, ArrayList<Integer> charges, NeutralLossesMap neutralLosses, Peak peak, double massTolerance)
          This method matches the potential fragment ions of a given peptide with a given peak.
 void setMassShift(double massShift)
          Sets an m/z shift on all ions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEPARATOR

public static final String SEPARATOR
Separator for the theoretic fragment key components

See Also:
Constant Field Values
Constructor Detail

SpectrumAnnotator

public SpectrumAnnotator()
Constructor

Method Detail

matchPeak

public ArrayList<IonMatch> matchPeak(Peptide peptide,
                                     ArrayList<PeptideFragmentIon.PeptideFragmentIonType> iontypes,
                                     ArrayList<Integer> charges,
                                     NeutralLossesMap neutralLosses,
                                     Peak peak,
                                     double massTolerance)
This method matches the potential fragment ions of a given peptide with a given peak.

Parameters:
peptide - The peptide
iontypes - The fragment ions selected
charges - The charges of the fragment to search for
neutralLosses - Map of expected neutral losses: neutral loss -> maximal position in the sequence (first aa is 1). let null if neutral losses should not be considered.
peak - The peak to match
massTolerance - The mass tolerance to use (in Dalton)
Returns:
A list of potential ion matches

getSpectrumAnnotation

public static Vector<DefaultSpectrumAnnotation> getSpectrumAnnotation(ArrayList<IonMatch> ionMatches)
Translates the list of ion matches into a vector of annotations which can be read by the SpectrumPAnel

Parameters:
ionMatches - list of ion matches
Returns:
vector of default spectrum annotations

getDefaultLosses

public static NeutralLossesMap getDefaultLosses(Peptide peptide)
Returns the possible neutral losses expected by default for a given peptide. /!\ this method will work only if the ptm found in the peptide are in the PTMFactory

Parameters:
peptide - the peptide of interest
Returns:
the expected possible neutral losses

isAccounted

public boolean isAccounted(NeutralLossesMap neutralLosses,
                           NeutralLoss neutralLoss,
                           PeptideFragmentIon fragmentIon,
                           Peptide peptide)
Returns a boolean indicating whether the neutral loss should be accounted for

Parameters:
neutralLosses - Map of expected neutral losses
neutralLoss - the neutral loss of interest
fragmentIon - the fragment ion of interest
peptide - the peptide of interest
Returns:
boolean indicating whether the neutral loss should be considered

lossesValidated

public boolean lossesValidated(NeutralLossesMap neutralLosses,
                               PeptideFragmentIon fragmentIon,
                               Peptide peptide)
Returns a boolean indicating whether the neutral losses of the given fragment ion are fit the requirement of the given neutral losses map

Parameters:
neutralLosses - Map of expected neutral losses: neutral loss.
fragmentIon - the fragment ion of interest
peptide - the inspected peptide
Returns:
a boolean indicating whether the neutral losses of the given fragment ion are fit the requirement of the given neutral losses map

chargeValidated

public boolean chargeValidated(PeptideFragmentIon fragmentIon,
                               int charge)
Returns a boolean indicating whether the given charge can be found on the given fragment ion

Parameters:
fragmentIon - the fragment ion of interest
charge - the candidate charge
Returns:
a boolean indicating whether the given charge can be found on the given fragment ion

getSpectrumAnnotation

public ArrayList<IonMatch> getSpectrumAnnotation(ArrayList<PeptideFragmentIon.PeptideFragmentIonType> expectedFragmentIons,
                                                 NeutralLossesMap neutralLosses,
                                                 ArrayList<Integer> charges,
                                                 MSnSpectrum spectrum,
                                                 Peptide peptide,
                                                 double intensityLimit,
                                                 double mzTolerance)
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:
expectedFragmentIons - The expected fragment ions to look for
neutralLosses - Map of expected neutral losses: neutral loss -> first position in the sequence (first aa is 1). let null if neutral losses should not be considered.
charges - List of expected charges
spectrum - The spectrum to match
peptide - The peptide of interest
intensityLimit - The intensity limit to use
mzTolerance - The m/z tolerance to use
Returns:
an ArrayList of IonMatch containing the ion matches with the given settings

getExpectedIons

public HashMap<Integer,ArrayList<PeptideFragmentIon>> getExpectedIons(ArrayList<PeptideFragmentIon.PeptideFragmentIonType> expectedFragmentIons,
                                                                      NeutralLossesMap neutralLosses,
                                                                      ArrayList<Integer> charges,
                                                                      Peptide peptide,
                                                                      int precursorCharge)
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:
expectedFragmentIons - The expected fragment ions to look for
neutralLosses - Map of expected neutral losses: neutral loss -> first position in the sequence (first aa is 1). let null if neutral losses should not be considered.
charges - List of expected charges
peptide - The peptide of interest
precursorCharge - The precursor charge
Returns:
an ArrayList of IonMatch containing the ion matches with the given settings

getCurrentAnnotation

public ArrayList<IonMatch> getCurrentAnnotation(ArrayList<PeptideFragmentIon.PeptideFragmentIonType> expectedFragmentIons,
                                                NeutralLossesMap neutralLosses,
                                                ArrayList<Integer> charges)
Returns the currently matched ions with the given settings

Parameters:
expectedFragmentIons - The expected fragment ions to look for
neutralLosses - Map of expected neutral losses: neutral loss -> first position in the sequence (first aa is 1). let null if neutral losses should not be considered.
charges - List of expected charges
Returns:
the currently matched ions with the given settings

getTheoreticFragmentKey

public static String getTheoreticFragmentKey(PeptideFragmentIon fragmentIon,
                                             int charge)
Returns the key of a theoretic fragment

Parameters:
fragmentIon - the theoretic fragment ion
charge - the charge of the theoretic fragment
Returns:
the key of a theoretic fragment

getCurrentlyLoadedSpectrumKey

public String getCurrentlyLoadedSpectrumKey()
Returns the spectrum currently inspected

Returns:
the spectrum currently inspected

getCurrentlyLoadedPeptide

public Peptide getCurrentlyLoadedPeptide()
Returns the currently inspected peptide

Returns:
the currently inspected peptide

getMassShift

public double getMassShift()
Returns the m/z shift applied to the fragment ions

Returns:
the m/z shift applied to the fragment ions

setMassShift

public void setMassShift(double massShift)
Sets an m/z shift on all ions. The previous mass shift will be removed

Parameters:
massShift - the m/z shift to apply


Copyright © 2011. All Rights Reserved.