Class HyperScore
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 Summary
Constructors Constructor Description HyperScore()
Constructor using a uniform fragmentation.HyperScore(PeptideFragmentationModel peptideFragmentationModel)
Constructor. -
Method Summary
Modifier and Type Method Description HashMap<Double,Integer>
getAs()
Returns a histogram of the as found in the previously interpolated scores.HashMap<Double,Integer>
getBs()
Returns a histogram of the bs found in the previously interpolated scores.HashMap<Double,Double>
getEValueMap(ArrayList<Double> hyperScores)
Returns the e-value corresponding to a list of scores in a map.HashMap<Double,Double>
getEValueMap(ArrayList<Double> hyperScores, boolean useCache)
Returns the e-value corresponding to a list of scores in a map.static double
getInterpolation(double logScore, double a, double b)
Returns the interpolated value for a given score in log.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.double[]
getInterpolationValues(int[] scores, boolean useCache)
Returns the interpolation values for the given scores in the form {a, b}.double[]
getInterpolationValues(HashMap<Integer,Integer> scoreHistogram, boolean useCache)
Returns the interpolation values for the given score histogram in the form {a, b}.Double
getMendianA()
Returns the rounded median of the as found in the previously interpolated scores.Double
getMendianB()
Returns the rounded median of the bs found in the previously interpolated scores.double
getScore(Peptide peptide, int charge, Spectrum spectrum, ArrayList<IonMatch> ionMatches)
Returns the hyperscore.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.
-
Constructor Details
-
HyperScore
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 interestspectrumFile
- the file of the spectrumspectrumTitle
- the title of the spectrumspectrum
- the spectrumannotationSettings
- the general spectrum annotation settingsspecificAnnotationSettings
- the annotation settings specific to this PSMpeptideSpectrumAnnotator
- the spectrum annotator to usemodificationParameters
- the modification parameterssequenceProvider
- a provider for the protein sequencesmodificationSequenceMatchingParameters
- 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 interestcharge
- the chargespectrum
- the spectrum of interestionMatches
- the ion matches obtained from spectrum annotation- Returns:
- the score of the match
-
getEValueMap
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
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 scoresuseCache
- 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 scoresuseCache
- if true the interpolation values will be stored in the histograms in cache- Returns:
- the interpolation values for the given scores
-
getInterpolationValues
Returns the interpolation values for the given score histogram in the form {a, b}.- Parameters:
scoreHistogram
- the score histogramuseCache
- if true the interpolation values will be stored in the histograms in cache- Returns:
- the interpolation values for the given score histogram
-
getInterpolation
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 hyperscoresa
- the slope of the interpolationb
- 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 scorea
- the slope of the interpolationb
- the offset of the interpolation- Returns:
- the interpolated value
-
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
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
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
Returns a histogram of the bs found in the previously interpolated scores.- Returns:
- a histogram of the bs found in the previously interpolated scores
-