Class SpectrumMatch
java.lang.Object
com.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.identification.IdentificationMatch
com.compomics.util.experiment.identification.matches.SpectrumMatch
- All Implemented Interfaces:
Serializable
public class SpectrumMatch extends IdentificationMatch
This class models a spectrum match.
- Author:
- Marc Vaudel, Dominik Kopczynski, Harald Barsnes
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class com.compomics.util.experiment.identification.IdentificationMatch
IdentificationMatch.MatchType
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SpectrumMatch()
Constructor for the spectrum match.SpectrumMatch(String spectrumFile, String spectrumTitle)
Constructor for the spectrum match. -
Method Summary
Modifier and Type Method Description void
addPeptideAssumption(int advocateId, PeptideAssumption peptideAssumption)
Add a hit.void
addTagAssumption(int advocateId, TagAssumption tagAssumption)
Add a hit.HashSet<Integer>
getAdvocates()
Returns the advocates supporting hits for this spectrum.java.util.stream.Stream<PeptideAssumption>
getAllPeptideAssumptions()
Returns a stream of all peptide assumptionsTreeMap<Double,ArrayList<PeptideAssumption>>
getAllPeptideAssumptions(int advocateId)
Returns all peptide assumptions for the specified search engine indexed by their score.java.util.stream.Stream<TagAssumption>
getAllTagAssumptions()
Returns a stream of all tag assumptionsTreeMap<Double,ArrayList<TagAssumption>>
getAllTagAssumptions(int advocateId)
Returns all tag assumptions for the specified search engine indexed by their score.PeptideAssumption
getBestPeptideAssumption()
Getter for the best peptide assumption.TagAssumption
getBestTagAssumption()
Getter for the best tag assumption.long
getKey()
Returns the key of a match.static long
getKey(String spectrumFile, String spectrumTitle)
Returns a key to use for the spectrum match based on the file where the spectrum was found and its title.HashMap<Integer,TreeMap<Double,ArrayList<PeptideAssumption>>>
getPeptideAssumptionsMap()
Returns the peptide assumptions map: advocate id > score > list of assumptions.String
getSpectrumFile()
Returns the name of the file where this spectrum was found.String
getSpectrumTitle()
Returns the title of the spectrum.HashMap<Integer,TreeMap<Double,ArrayList<TagAssumption>>>
getTagAssumptionsMap()
Returns the tag assumptions map: advocate id > score > list of assumptions.IdentificationMatch.MatchType
getType()
Returns the type of match.boolean
hasPeptideAssumption()
Indicates whether the spectrum match contains a peptide assumption.boolean
hasPeptideAssumption(int advocateId)
Indicates whether the spectrum match contains a peptide assumption for the given advocate (see the Advocate class).boolean
hasTagAssumption()
Indicates whether the spectrum match contains a tag assumption.boolean
hasTagAssumption(int advocateId)
Indicates whether the spectrum match contains a tag assumption for the given advocate (see the Advocate class).void
removePeptideAssumption(PeptideAssumption peptideAssumption)
Removes an assumption from the mapping.void
removeTagAssumption(TagAssumption tagAssumption)
Removes an assumption from the mapping.void
setBestPeptideAssumption(PeptideAssumption bestPeptideAssumption)
Setter for the best peptide assumption.void
setBestTagAssumption(TagAssumption bestTagAssumption)
Setter for the best tag assumption.void
setPeptideAssumptionMap(HashMap<Integer,TreeMap<Double,ArrayList<PeptideAssumption>>> peptideAssumptionsMap)
Sets the peptide assumption map.void
setSpectrumFile(String spectrumFile)
Sets the spectrum file name.void
setSpectrumTitle(String spectrumTitle)
Sets the spectrum title.void
setTagAssumptionMap(HashMap<Integer,TreeMap<Double,ArrayList<TagAssumption>>> tagAssumptionsMap)
Sets the tag assumption map.Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, asLong, clearParametersMap, getId, getUrParam, getUrParams, removeUrParam, setId, setUrParams
-
Constructor Details
-
SpectrumMatch
public SpectrumMatch()Constructor for the spectrum match. -
SpectrumMatch
Constructor for the spectrum match.- Parameters:
spectrumFile
- The name of the file containing the spectrum.spectrumTitle
- The title of the spectrum.
-
-
Method Details
-
setPeptideAssumptionMap
public void setPeptideAssumptionMap(HashMap<Integer,TreeMap<Double,ArrayList<PeptideAssumption>>> peptideAssumptionsMap)Sets the peptide assumption map.- Parameters:
peptideAssumptionsMap
- the peptide assumption map
-
setTagAssumptionMap
public void setTagAssumptionMap(HashMap<Integer,TreeMap<Double,ArrayList<TagAssumption>>> tagAssumptionsMap)Sets the tag assumption map.- Parameters:
tagAssumptionsMap
- the tag assumption map
-
getKey
Returns a key to use for the spectrum match based on the file where the spectrum was found and its title.- Parameters:
spectrumFile
- The name of the file containing the spectrum.spectrumTitle
- The title of the spectrum.- Returns:
- The key as long.
-
getBestPeptideAssumption
Getter for the best peptide assumption.- Returns:
- the best peptide assumption for the spectrum
-
setBestPeptideAssumption
Setter for the best peptide assumption.- Parameters:
bestPeptideAssumption
- the best peptide assumption for the spectrum
-
getBestTagAssumption
Getter for the best tag assumption.- Returns:
- the best tag assumption for the spectrum
-
setBestTagAssumption
Setter for the best tag assumption.- Parameters:
bestTagAssumption
- the best tag assumption for the spectrum
-
getSpectrumFile
Returns the name of the file where this spectrum was found.- Returns:
- The name of the file where this spectrum was found.
-
setSpectrumFile
Sets the spectrum file name.- Parameters:
spectrumFile
- The spectrum file name.
-
getSpectrumTitle
Returns the title of the spectrum.- Returns:
- The title of the spectrum.
-
setSpectrumTitle
Sets the spectrum title.- Parameters:
spectrumTitle
- The spectrum title.
-
getKey
public long getKey()Description copied from class:IdentificationMatch
Returns the key of a match.- Specified by:
getKey
in classIdentificationMatch
- Returns:
- the key of a match
-
getAdvocates
Returns the advocates supporting hits for this spectrum.- Returns:
- The advocates supporting hits for this spectrum.
-
getAllPeptideAssumptions
Returns all peptide assumptions for the specified search engine indexed by their score. Null if none found.- Parameters:
advocateId
- the desired advocate ID- Returns:
- all assumptions
-
getAllTagAssumptions
Returns all tag assumptions for the specified search engine indexed by their score. Null if none found.- Parameters:
advocateId
- the desired advocate ID- Returns:
- all assumptions
-
getAllPeptideAssumptions
Returns a stream of all peptide assumptions- Returns:
- a stream of all peptide assumptions
-
getAllTagAssumptions
Returns a stream of all tag assumptions- Returns:
- a stream of all tag assumptions
-
getPeptideAssumptionsMap
Returns the peptide assumptions map: advocate id > score > list of assumptions.- Returns:
- the assumptions map
-
getTagAssumptionsMap
Returns the tag assumptions map: advocate id > score > list of assumptions.- Returns:
- the assumptions map
-
addPeptideAssumption
Add a hit.- Parameters:
advocateId
- the index of the advocate of the new hitpeptideAssumption
- the new identification assumption
-
addTagAssumption
Add a hit.- Parameters:
advocateId
- the index of the advocate of the new hittagAssumption
- the new identification assumption
-
getType
Description copied from class:IdentificationMatch
Returns the type of match.- Specified by:
getType
in classIdentificationMatch
- Returns:
- the type of match
-
removePeptideAssumption
Removes an assumption from the mapping.- Parameters:
peptideAssumption
- the peptide assumption to remove
-
removeTagAssumption
Removes an assumption from the mapping.- Parameters:
tagAssumption
- the tag assumption to remove
-
hasPeptideAssumption
public boolean hasPeptideAssumption()Indicates whether the spectrum match contains a peptide assumption.- Returns:
- a boolean indicating whether the spectrum match contains a peptide assumption
-
hasTagAssumption
public boolean hasTagAssumption()Indicates whether the spectrum match contains a tag assumption.- Returns:
- a boolean indicating whether the spectrum match contains a tag assumption
-
hasPeptideAssumption
public boolean hasPeptideAssumption(int advocateId)Indicates whether the spectrum match contains a peptide assumption for the given advocate (see the Advocate class).- Parameters:
advocateId
- The index of the advocate- Returns:
- a boolean indicating whether the spectrum match contains an assumption for the given advocate
-
hasTagAssumption
public boolean hasTagAssumption(int advocateId)Indicates whether the spectrum match contains a tag assumption for the given advocate (see the Advocate class).- Parameters:
advocateId
- The index of the advocate- Returns:
- a boolean indicating whether the spectrum match contains an assumption for the given advocate
-