java.lang.Object
com.compomics.util.experiment.identification.psm_scoring.psm_scores.HyperScore

public class HyperScore
extends Object
Hyperscore as variation of the score implemented in X!Tandem www.thegpm.org/tandem. The original X!Tandem score at the link above is governed by the Artistic license (https://opensource.org/licenses/artistic-license-1.0). X! tandem is a component of the X! proteomics software development project. Copyright Ronald C Beavis, all rights reserved. The code below does not use or reuse any of the X!Tandem code, but the scoring approach is in many points similar. No copyright infringement intended.
Author:
Marc Vaudel
  • Constructor Details

    • HyperScore

      public HyperScore​(PeptideFragmentationModel peptideFragmentationModel)
      Constructor.
      Parameters:
      peptideFragmentationModel - the peptide fragmentation model to use
    • HyperScore

      public HyperScore()
      Constructor using a uniform fragmentation.
  • Method Details

    • getScore

      public double getScore​(Peptide peptide, String spectrumFile, String spectrumTitle, Spectrum spectrum, AnnotationParameters annotationSettings, SpecificAnnotationParameters specificAnnotationSettings, PeptideSpectrumAnnotator peptideSpectrumAnnotator, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationSequenceMatchingParameters)
      Returns the hyperscore.
      Parameters:
      peptide - the peptide of interest
      spectrumFile - the file of the spectrum
      spectrumTitle - the title of the spectrum
      spectrum - the spectrum
      annotationSettings - the general spectrum annotation settings
      specificAnnotationSettings - the annotation settings specific to this PSM
      peptideSpectrumAnnotator - the spectrum annotator to use
      modificationParameters - the modification parameters
      sequenceProvider - a provider for the protein sequences
      modificationSequenceMatchingParameters - the sequence matching preferences for modification to peptide mapping
      Returns:
      the score of the match
    • getScore

      public double getScore​(Peptide peptide, int charge, Spectrum spectrum, ArrayList<IonMatch> ionMatches)
      Returns the hyperscore.
      Parameters:
      peptide - the peptide of interest
      charge - the charge
      spectrum - the spectrum of interest
      ionMatches - the ion matches obtained from spectrum annotation
      Returns:
      the score of the match
    • getEValueMap

      public HashMap<Double,​Double> getEValueMap​(ArrayList<Double> hyperScores)
      Returns the e-value corresponding to a list of scores in a map. If not enough scores are present or if they are not spread the method returns null.
      Parameters:
      hyperScores - the different scores
      Returns:
      the e-values corresponding to the given scores
    • getEValueMap

      public HashMap<Double,​Double> getEValueMap​(ArrayList<Double> hyperScores, boolean useCache)
      Returns the e-value corresponding to a list of scores in a map. If not enough scores are present or if they are not spread the method returns null.
      Parameters:
      hyperScores - the different scores
      useCache - if true the interpolation values will be stored in the histograms in cache
      Returns:
      the e-values corresponding to the given scores
    • getInterpolationValues

      public double[] getInterpolationValues​(int[] scores, boolean useCache)
      Returns the interpolation values for the given scores in the form {a, b}.
      Parameters:
      scores - the scores
      useCache - if true the interpolation values will be stored in the histograms in cache
      Returns:
      the interpolation values for the given scores
    • getInterpolationValues

      public double[] getInterpolationValues​(HashMap<Integer,​Integer> scoreHistogram, boolean useCache)
      Returns the interpolation values for the given score histogram in the form {a, b}.
      Parameters:
      scoreHistogram - the score histogram
      useCache - if true the interpolation values will be stored in the histograms in cache
      Returns:
      the interpolation values for the given score histogram
    • getInterpolation

      public HashMap<Double,​Double> getInterpolation​(ArrayList<Double> hyperScores, Double a, Double b)
      Returns the interpolation of a list of hyperscores using a linear interpolation of the form result = a * log(score) + b. If the score is null, returns the number of hyperscores. The value at every score is returned in a map.
      Parameters:
      hyperScores - a list of hyperscores
      a - the slope of the interpolation
      b - the offset of the interpolation
      Returns:
      the interpolation for every score in a map.
    • getInterpolation

      public static double getInterpolation​(double logScore, double a, double b)
      Returns the interpolated value for a given score in log. result = a * logScore + b.
      Parameters:
      logScore - the log of the score
      a - the slope of the interpolation
      b - the offset of the interpolation
      Returns:
      the interpolated value
    • getMendianA

      public Double getMendianA()
      Returns the rounded median of the as found in the previously interpolated scores. Null if none found.
      Returns:
      the rounded median of the as found in the previously interpolated scores
    • getMendianB

      public Double getMendianB()
      Returns the rounded median of the bs found in the previously interpolated scores. Null if none found.
      Returns:
      the rounded median of the bs found in the previously interpolated scores
    • getAs

      public HashMap<Double,​Integer> getAs()
      Returns a histogram of the as found in the previously interpolated scores.
      Returns:
      a histogram of the as found in the previously interpolated scores
    • getBs

      public HashMap<Double,​Integer> getBs()
      Returns a histogram of the bs found in the previously interpolated scores.
      Returns:
      a histogram of the bs found in the previously interpolated scores