com.compomics.util.experiment.identification.matches
Class SpectrumMatch

java.lang.Object
  extended by com.compomics.util.experiment.personalization.ExperimentObject
      extended by com.compomics.util.experiment.identification.IdentificationMatch
          extended by com.compomics.util.experiment.identification.matches.SpectrumMatch
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class SpectrumMatch
extends IdentificationMatch

This class models a spectrum match.

Author:
Marc Vaudel
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.compomics.util.experiment.identification.IdentificationMatch
IdentificationMatch.MatchType
 
Constructor Summary
SpectrumMatch()
          Constructor for the spectrum match.
SpectrumMatch(java.lang.String spectrumKey)
          Constructor for the spectrum match.
SpectrumMatch(java.lang.String spectrumKey, PeptideAssumption assumption)
          Constructor for the spectrum match.
 
Method Summary
 void addHit(int otherAdvocateId, PeptideAssumption otherAssumption)
          Add a first hit.
 java.util.ArrayList<java.lang.Integer> getAdvocates()
          Returns all advocates used referenced by their index.
 java.util.ArrayList<PeptideAssumption> getAllAssumptions()
          Return all assumptions for all search engines as a list.
 java.util.HashMap<java.lang.Double,java.util.ArrayList<PeptideAssumption>> getAllAssumptions(int advocateId)
          Return all assumptions for the specified search engine indexed by their e-value.
 PeptideAssumption getBestAssumption()
          Getter for the best assumption.
 PeptideAssumption getFirstHit(int advocateId)
          Returns the first hit obtained using the specified advocate.
 java.lang.String getKey()
          returns the key of a match.
 java.lang.Integer getSpectrumNumber()
          Returns the spectrum number in the spectrum file.
 IdentificationMatch.MatchType getType()
          Returns the type of match.
 boolean hasAssumption()
          Indicates whether the spectrum match contains a peptide assumption from a search engine.
 boolean hasAssumption(int advocateId)
          Indicates whether the spectrum match contains a peptide assumption for the given advocate (for example a search engine, see the Advocate class)
 void removeAssumption(PeptideAssumption peptideAssumption)
          Removes an assumption from the mapping
 void setBestAssumption(PeptideAssumption bestAssumption)
          Setter for the best assumption.
 void setFirstHit(int advocateId, PeptideAssumption peptideAssumption)
          Sets the best peptideAssumption according to the search engine.
 void setKey(java.lang.String newKey)
          Replaces the new key.
 void setSpectrumNumber(java.lang.Integer spectrumNumber)
          Sets the spectrum number in the spectrum file
 
Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, getParameterKey, getUrParam
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpectrumMatch

public SpectrumMatch()
Constructor for the spectrum match.


SpectrumMatch

public SpectrumMatch(java.lang.String spectrumKey,
                     PeptideAssumption assumption)
Constructor for the spectrum match.

Parameters:
spectrumKey - The matched spectrumKey
assumption - The matching peptide assumption

SpectrumMatch

public SpectrumMatch(java.lang.String spectrumKey)
Constructor for the spectrum match.

Parameters:
spectrumKey - The matched spectrum key
Method Detail

getBestAssumption

public PeptideAssumption getBestAssumption()
Getter for the best assumption.

Returns:
the best assumption for the spectrum

setBestAssumption

public void setBestAssumption(PeptideAssumption bestAssumption)
Setter for the best assumption.

Parameters:
bestAssumption - the best assumption for the spectrum

getKey

public java.lang.String getKey()
Description copied from class: IdentificationMatch
returns the key of a match.

Specified by:
getKey in class IdentificationMatch
Returns:
the key of a match

getAllAssumptions

public java.util.HashMap<java.lang.Double,java.util.ArrayList<PeptideAssumption>> getAllAssumptions(int advocateId)
Return all assumptions for the specified search engine indexed by their e-value.

Parameters:
advocateId - the desired advocate ID
Returns:
all assumptions

getAllAssumptions

public java.util.ArrayList<PeptideAssumption> getAllAssumptions()
Return all assumptions for all search engines as a list.

Returns:
all assumptions

addHit

public void addHit(int otherAdvocateId,
                   PeptideAssumption otherAssumption)
Add a first hit.

Parameters:
otherAdvocateId - The index of the new advocate
otherAssumption - The new peptide assumption

getFirstHit

public PeptideAssumption getFirstHit(int advocateId)
Returns the first hit obtained using the specified advocate.

Parameters:
advocateId - the specified advocate index
Returns:
the first hit

setFirstHit

public void setFirstHit(int advocateId,
                        PeptideAssumption peptideAssumption)
Sets the best peptideAssumption according to the search engine.

Parameters:
advocateId - the search engine index
peptideAssumption - the best assumption

getAdvocates

public java.util.ArrayList<java.lang.Integer> getAdvocates()
Returns all advocates used referenced by their index.

Returns:
all advocates used

getType

public IdentificationMatch.MatchType getType()
Description copied from class: IdentificationMatch
Returns the type of match.

Specified by:
getType in class IdentificationMatch
Returns:
the type of match

setKey

public void setKey(java.lang.String newKey)
Replaces the new key. The key of the PSM should always be the same as the spectrum key it links to.

Parameters:
newKey - the new key

getSpectrumNumber

public java.lang.Integer getSpectrumNumber()
Returns the spectrum number in the spectrum file. Returns null if not implemented (for versions older than 3.4.17 for instance)

Returns:
the spectrum number in the spectrum file

setSpectrumNumber

public void setSpectrumNumber(java.lang.Integer spectrumNumber)
Sets the spectrum number in the spectrum file

Parameters:
spectrumNumber - the spectrum number in the spectrum file

removeAssumption

public void removeAssumption(PeptideAssumption peptideAssumption)
Removes an assumption from the mapping

Parameters:
peptideAssumption - the peptide assumption to remove

hasAssumption

public boolean hasAssumption()
Indicates whether the spectrum match contains a peptide assumption from a search engine.

Returns:
a boolean indicating whether the spectrum match contains an assumption

hasAssumption

public boolean hasAssumption(int advocateId)
Indicates whether the spectrum match contains a peptide assumption for the given advocate (for example a search engine, see the Advocate class)

Parameters:
advocateId - The index of the advocate
Returns:
a boolean indicating whether the spectrum match contains a peptide assumption for the given advocate


Copyright © 2013. All Rights Reserved.