com.compomics.util.experiment.identification
Class SpectrumAnnotator

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

public class SpectrumAnnotator
extends java.lang.Object

The spectrum annotator annotates peaks in a spectrum.

Author:
Marc

Field Summary
static java.lang.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
 java.util.ArrayList<IonMatch> getCurrentAnnotation(java.util.ArrayList<PeptideFragmentIon.PeptideFragmentIonType> expectedFragmentIons, java.util.HashMap<NeutralLoss,java.lang.Integer> neutralLosses, java.util.ArrayList<java.lang.Integer> charges)
          Returns the currently matched ions with the given settings
 Peptide getCurrentlyLoadedPeptide()
          Returns the currently inspected peptide
 java.lang.String getCurrentlyLoadedSpectrumKey()
          Returns the spectrum currently inspected
static java.util.HashMap<NeutralLoss,java.lang.Integer> getDefaultLosses(Peptide peptide)
          Returns the possible neutral losses expected by default for a given peptide.
static java.util.HashMap<NeutralLoss,java.lang.Integer> getDefaultLosses(Peptide peptide, java.util.ArrayList<NeutralLoss> imposedNeutralLosses)
          Returns the neutral losses map by default for a given peptide and a given list of neutral losses.
 java.util.HashMap<java.lang.Integer,java.util.ArrayList<PeptideFragmentIon>> getExpectedIons(java.util.ArrayList<PeptideFragmentIon.PeptideFragmentIonType> expectedFragmentIons, java.util.HashMap<NeutralLoss,java.lang.Integer> neutralLosses, java.util.ArrayList<java.lang.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.
static java.util.Vector<DefaultSpectrumAnnotation> getSpectrumAnnotation(java.util.ArrayList<IonMatch> ionMatches)
          Translates the list of ion matches into a vector of annotations which can be read by the SpectrumPAnel
 java.util.ArrayList<IonMatch> getSpectrumAnnotation(java.util.ArrayList<PeptideFragmentIon.PeptideFragmentIonType> expectedFragmentIons, java.util.HashMap<NeutralLoss,java.lang.Integer> neutralLosses, java.util.ArrayList<java.lang.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 java.lang.String getTheoreticFragmentKey(PeptideFragmentIon fragmentIon, int charge)
          Returns the key of a theoretic fragment
 boolean isAccounted(java.util.HashMap<NeutralLoss,java.lang.Integer> neutralLosses, NeutralLoss neutralLoss, PeptideFragmentIon fragmentIon, Peptide peptide)
          Returns a boolean indicating whether the neutral loss should be accounted for
 boolean lossesValidated(java.util.HashMap<NeutralLoss,java.lang.Integer> 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
 java.util.ArrayList<IonMatch> matchPeak(Peptide peptide, java.util.ArrayList<PeptideFragmentIon.PeptideFragmentIonType> iontypes, java.util.ArrayList<java.lang.Integer> charges, java.util.HashMap<NeutralLoss,java.lang.Integer> neutralLosses, Peak peak, double massTolerance)
          This method matches the potential fragment ions of a given peptide with a given peak.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEPARATOR

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

See Also:
Constant Field Values
Constructor Detail

SpectrumAnnotator

public SpectrumAnnotator()
Constructor

Method Detail

matchPeak

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

Parameters:
peptide - The peptide
fragmentTypes - The fragment ions selected
charge - 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 java.util.Vector<DefaultSpectrumAnnotation> getSpectrumAnnotation(java.util.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 java.util.HashMap<NeutralLoss,java.lang.Integer> getDefaultLosses(Peptide peptide,
                                                                                java.util.ArrayList<NeutralLoss> imposedNeutralLosses)
Returns the neutral losses map by default for a given peptide and a given list of neutral losses.

Parameters:
peptide - the peptide of interest
imposedNeutralLosses - a given list of neutral losses
Returns:
the expected possible neutral losses

getDefaultLosses

public static java.util.HashMap<NeutralLoss,java.lang.Integer> getDefaultLosses(Peptide peptide)
Returns the possible neutral losses expected by default for a given peptide.

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

isAccounted

public boolean isAccounted(java.util.HashMap<NeutralLoss,java.lang.Integer> 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: neutral loss -> first position in the sequence (first aa is 1). let null if neutral losses should not be considered.
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(java.util.HashMap<NeutralLoss,java.lang.Integer> 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 -> first position in the sequence (first aa is 1). let null if neutral losses should not be considered.
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 java.util.ArrayList<IonMatch> getSpectrumAnnotation(java.util.ArrayList<PeptideFragmentIon.PeptideFragmentIonType> expectedFragmentIons,
                                                           java.util.HashMap<NeutralLoss,java.lang.Integer> neutralLosses,
                                                           java.util.ArrayList<java.lang.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 java.util.HashMap<java.lang.Integer,java.util.ArrayList<PeptideFragmentIon>> getExpectedIons(java.util.ArrayList<PeptideFragmentIon.PeptideFragmentIonType> expectedFragmentIons,
                                                                                                    java.util.HashMap<NeutralLoss,java.lang.Integer> neutralLosses,
                                                                                                    java.util.ArrayList<java.lang.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
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

getCurrentAnnotation

public java.util.ArrayList<IonMatch> getCurrentAnnotation(java.util.ArrayList<PeptideFragmentIon.PeptideFragmentIonType> expectedFragmentIons,
                                                          java.util.HashMap<NeutralLoss,java.lang.Integer> neutralLosses,
                                                          java.util.ArrayList<java.lang.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 java.lang.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 java.lang.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


Copyright © 2011. All Rights Reserved.