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

    • SpectrumMatch

      public SpectrumMatch()
      Constructor for the spectrum match.
    • SpectrumMatch

      public SpectrumMatch​(String spectrumFile, String spectrumTitle)
      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

      public 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.
      Parameters:
      spectrumFile - The name of the file containing the spectrum.
      spectrumTitle - The title of the spectrum.
      Returns:
      The key as long.
    • getBestPeptideAssumption

      public PeptideAssumption getBestPeptideAssumption()
      Getter for the best peptide assumption.
      Returns:
      the best peptide assumption for the spectrum
    • setBestPeptideAssumption

      public void setBestPeptideAssumption​(PeptideAssumption bestPeptideAssumption)
      Setter for the best peptide assumption.
      Parameters:
      bestPeptideAssumption - the best peptide assumption for the spectrum
    • getBestTagAssumption

      public TagAssumption getBestTagAssumption()
      Getter for the best tag assumption.
      Returns:
      the best tag assumption for the spectrum
    • setBestTagAssumption

      public void setBestTagAssumption​(TagAssumption bestTagAssumption)
      Setter for the best tag assumption.
      Parameters:
      bestTagAssumption - the best tag assumption for the spectrum
    • getSpectrumFile

      public String getSpectrumFile()
      Returns the name of the file where this spectrum was found.
      Returns:
      The name of the file where this spectrum was found.
    • setSpectrumFile

      public void setSpectrumFile​(String spectrumFile)
      Sets the spectrum file name.
      Parameters:
      spectrumFile - The spectrum file name.
    • getSpectrumTitle

      public String getSpectrumTitle()
      Returns the title of the spectrum.
      Returns:
      The title of the spectrum.
    • setSpectrumTitle

      public void setSpectrumTitle​(String spectrumTitle)
      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 class IdentificationMatch
      Returns:
      the key of a match
    • getAdvocates

      public HashSet<Integer> getAdvocates()
      Returns the advocates supporting hits for this spectrum.
      Returns:
      The advocates supporting hits for this spectrum.
    • getAllPeptideAssumptions

      public TreeMap<Double,​ArrayList<PeptideAssumption>> getAllPeptideAssumptions​(int advocateId)
      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

      public TreeMap<Double,​ArrayList<TagAssumption>> getAllTagAssumptions​(int advocateId)
      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

      public java.util.stream.Stream<PeptideAssumption> getAllPeptideAssumptions()
      Returns a stream of all peptide assumptions
      Returns:
      a stream of all peptide assumptions
    • getAllTagAssumptions

      public java.util.stream.Stream<TagAssumption> getAllTagAssumptions()
      Returns a stream of all tag assumptions
      Returns:
      a stream of all tag assumptions
    • getPeptideAssumptionsMap

      public HashMap<Integer,​TreeMap<Double,​ArrayList<PeptideAssumption>>> getPeptideAssumptionsMap()
      Returns the peptide assumptions map: advocate id > score > list of assumptions.
      Returns:
      the assumptions map
    • getTagAssumptionsMap

      public HashMap<Integer,​TreeMap<Double,​ArrayList<TagAssumption>>> getTagAssumptionsMap()
      Returns the tag assumptions map: advocate id > score > list of assumptions.
      Returns:
      the assumptions map
    • addPeptideAssumption

      public void addPeptideAssumption​(int advocateId, PeptideAssumption peptideAssumption)
      Add a hit.
      Parameters:
      advocateId - the index of the advocate of the new hit
      peptideAssumption - the new identification assumption
    • addTagAssumption

      public void addTagAssumption​(int advocateId, TagAssumption tagAssumption)
      Add a hit.
      Parameters:
      advocateId - the index of the advocate of the new hit
      tagAssumption - the new identification assumption
    • getType

      Description copied from class: IdentificationMatch
      Returns the type of match.
      Specified by:
      getType in class IdentificationMatch
      Returns:
      the type of match
    • removePeptideAssumption

      public void removePeptideAssumption​(PeptideAssumption peptideAssumption)
      Removes an assumption from the mapping.
      Parameters:
      peptideAssumption - the peptide assumption to remove
    • removeTagAssumption

      public void removeTagAssumption​(TagAssumption tagAssumption)
      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