OpenMS  2.4.0
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
AScore Class Reference

Implementation of the Ascore For a given peptide sequence and its MS/MS spectrum it identifies the most probable phosphorylation-site(s). For each phosphorylation site a probability score is calculated. The algorithm is implemented according to Beausoleil et al. (Nat. Biotechnol. 2006). More...

#include <OpenMS/ANALYSIS/ID/AScore.h>

Inheritance diagram for AScore:
DefaultParamHandler

Public Member Functions

 AScore ()
 Default constructor. More...
 
 ~AScore () override
 Destructor. More...
 
PeptideHit compute (const PeptideHit &hit, PeakSpectrum &real_spectrum)
 Computes the AScore and returns all computed phospho-sites. The saved sequences contain only phospho information. All other modifications are dropped due to simplicity. More...
 
- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
virtual DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 

Protected Member Functions

int compareMZ_ (double mz1, double mz2) const
 
template<class InputIterator1 , class InputIterator2 , class OutputIterator >
OutputIterator getSpectrumDifference_ (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result) const
 
void computeSiteDeterminingIons_ (const std::vector< PeakSpectrum > &th_spectra, const ProbablePhosphoSites &candidates, std::vector< PeakSpectrum > &site_determining_ions) const
 Computes the site determining_ions for the given AS and sequences in candidates. More...
 
std::vector< SizegetSites_ (const AASequence &without_phospho) const
 return all phospho sites More...
 
std::vector< std::vector< Size > > computePermutations_ (const std::vector< Size > &sites, Int n_phosphorylation_events) const
 calculate all n_phosphorylation_events sized sets of phospho sites (all versions of the peptides with exactly n_phosphorylation_events) More...
 
Size numberOfMatchedIons_ (const PeakSpectrum &th, const PeakSpectrum &windows, Size depth) const
 Computes number of matched ions between windows and the given spectrum. All spectra have to be sorted by position! More...
 
double peptideScore_ (const std::vector< double > &scores) const
 Computes the peptide score according to Beausoleil et al. page 1291. More...
 
void determineHighestScoringPermutations_ (const std::vector< std::vector< double >> &peptide_site_scores, std::vector< ProbablePhosphoSites > &sites, const std::vector< std::vector< Size >> &permutations, std::multimap< double, Size > &ranking) const
 Finds the peptides with the highest PeptideScores and outputs all information for computing the AScore. More...
 
double computeCumulativeScore_ (Size N, Size n, double p) const
 Computes the cumulative binomial probabilities. More...
 
Size numberOfPhosphoEvents_ (const String sequence) const
 Computes number of phospho events in a sequence. More...
 
AASequence removePhosphositesFromSequence_ (const String sequence) const
 Create variant of the peptide with all phosphorylations removed. More...
 
std::vector< PeakSpectrumcreateTheoreticalSpectra_ (const std::vector< std::vector< Size >> &permutations, const AASequence &seq_without_phospho) const
 Create theoretical spectra with all combinations with the number of phosphorylation events. More...
 
std::vector< PeakSpectrumpeakPickingPerWindowsInSpectrum_ (PeakSpectrum &real_spectrum) const
 Pick top 10 intensity peaks for each 100 Da windows. More...
 
std::vector< std::vector< double > > calculatePermutationPeptideScores_ (std::vector< PeakSpectrum > &th_spectra, const std::vector< PeakSpectrum > &windows_top10) const
 Create 10 scores for each theoretical spectrum (permutation), according to Beausoleil et al. Figure 3 b. More...
 
std::multimap< double, SizerankWeightedPermutationPeptideScores_ (const std::vector< std::vector< double >> &peptide_site_scores) const
 Rank weighted permutation scores ascending. More...
 
void updateMembers_ () override
 Reimplemented from DefaultParamHandler. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Protected Attributes

double fragment_mass_tolerance_
 Fragment mass tolerance for spectrum comparisons. More...
 
bool fragment_tolerance_ppm_
 Is fragment mass tolerance given in ppm (or Da)? More...
 
Size max_peptide_length_
 Limit for peptide lengths that can be analyzed. More...
 
Size max_permutations_
 Limit for number of sequence permutations that can be handled. More...
 
double unambiguous_score_
 Score for unambiguous assignments (all sites phosphorylated) More...
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 

Friends

struct PScore
 

Detailed Description

Implementation of the Ascore For a given peptide sequence and its MS/MS spectrum it identifies the most probable phosphorylation-site(s). For each phosphorylation site a probability score is calculated. The algorithm is implemented according to Beausoleil et al. (Nat. Biotechnol. 2006).

Parameters of this class are:

NameTypeDefaultRestrictionsDescription
fragment_mass_tolerance float0.05 min: 0Fragment mass tolerance for spectrum comparisons
fragment_mass_unit stringDa Da, ppmUnit of fragment mass tolerance
max_peptide_length int40 min: 0Restrict scoring to peptides with a length no greater than this value ('0' for 'no restriction')
max_num_perm int16384 min: 0Maximum number of permutations a sequence can have to be processed ('0' for 'no restriction')
unambiguous_score int1000  Score to use for unambiguous assignments, where all sites on a peptide are phosphorylated. (Note: If a peptide is not phosphorylated at all, its score is set to '-1'.)

Note:

Constructor & Destructor Documentation

◆ AScore()

AScore ( )

Default constructor.

◆ ~AScore()

~AScore ( )
override

Destructor.

Member Function Documentation

◆ calculatePermutationPeptideScores_()

std::vector<std::vector<double> > calculatePermutationPeptideScores_ ( std::vector< PeakSpectrum > &  th_spectra,
const std::vector< PeakSpectrum > &  windows_top10 
) const
protected

Create 10 scores for each theoretical spectrum (permutation), according to Beausoleil et al. Figure 3 b.

◆ compareMZ_()

int compareMZ_ ( double  mz1,
double  mz2 
) const
protected

◆ compute()

PeptideHit compute ( const PeptideHit hit,
PeakSpectrum real_spectrum 
)

Computes the AScore and returns all computed phospho-sites. The saved sequences contain only phospho information. All other modifications are dropped due to simplicity.

Parameters
hita PeptideHit
real_spectrumspectrum mapped to hit
fmtfragment_mass_tolerance, when comparing real_spectrum to a theoretical spectrum of the amino acid sequence of hit.
number_of_phospho_siteswhich directs the method to search for this number of phosphorylated sites.
Note
the original sequence is saved in the PeptideHits as MetaValue Search_engine_sequence.

◆ computeCumulativeScore_()

double computeCumulativeScore_ ( Size  N,
Size  n,
double  p 
) const
protected

Computes the cumulative binomial probabilities.

◆ computePermutations_()

std::vector<std::vector<Size> > computePermutations_ ( const std::vector< Size > &  sites,
Int  n_phosphorylation_events 
) const
protected

calculate all n_phosphorylation_events sized sets of phospho sites (all versions of the peptides with exactly n_phosphorylation_events)

◆ computeSiteDeterminingIons_()

void computeSiteDeterminingIons_ ( const std::vector< PeakSpectrum > &  th_spectra,
const ProbablePhosphoSites candidates,
std::vector< PeakSpectrum > &  site_determining_ions 
) const
protected

Computes the site determining_ions for the given AS and sequences in candidates.

◆ createTheoreticalSpectra_()

std::vector<PeakSpectrum> createTheoreticalSpectra_ ( const std::vector< std::vector< Size >> &  permutations,
const AASequence seq_without_phospho 
) const
protected

Create theoretical spectra with all combinations with the number of phosphorylation events.

◆ determineHighestScoringPermutations_()

void determineHighestScoringPermutations_ ( const std::vector< std::vector< double >> &  peptide_site_scores,
std::vector< ProbablePhosphoSites > &  sites,
const std::vector< std::vector< Size >> &  permutations,
std::multimap< double, Size > &  ranking 
) const
protected

Finds the peptides with the highest PeptideScores and outputs all information for computing the AScore.

Note
This function assumes that there are more permutations than the assumed number of phosphorylations!

◆ getSites_()

std::vector<Size> getSites_ ( const AASequence without_phospho) const
protected

return all phospho sites

◆ getSpectrumDifference_()

OutputIterator getSpectrumDifference_ ( InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2,
InputIterator2  last2,
OutputIterator  result 
) const
inlineprotected

getSpectrumDifference_ works similar as the method std::set_difference (http://en.cppreference.com/w/cpp/algorithm/set_difference). set_difference was reimplemented, because it was necessary to overwrite the compare operator to be able to compare the m/z values. not implemented as "operator<", because using tolerances for comparison does not imply total ordering

◆ numberOfMatchedIons_()

Size numberOfMatchedIons_ ( const PeakSpectrum th,
const PeakSpectrum windows,
Size  depth 
) const
protected

Computes number of matched ions between windows and the given spectrum. All spectra have to be sorted by position!

◆ numberOfPhosphoEvents_()

Size numberOfPhosphoEvents_ ( const String  sequence) const
protected

Computes number of phospho events in a sequence.

◆ peakPickingPerWindowsInSpectrum_()

std::vector<PeakSpectrum> peakPickingPerWindowsInSpectrum_ ( PeakSpectrum real_spectrum) const
protected

Pick top 10 intensity peaks for each 100 Da windows.

◆ peptideScore_()

double peptideScore_ ( const std::vector< double > &  scores) const
protected

Computes the peptide score according to Beausoleil et al. page 1291.

◆ rankWeightedPermutationPeptideScores_()

std::multimap<double, Size> rankWeightedPermutationPeptideScores_ ( const std::vector< std::vector< double >> &  peptide_site_scores) const
protected

Rank weighted permutation scores ascending.

◆ removePhosphositesFromSequence_()

AASequence removePhosphositesFromSequence_ ( const String  sequence) const
protected

Create variant of the peptide with all phosphorylations removed.

◆ updateMembers_()

void updateMembers_ ( )
overrideprotectedvirtual

Reimplemented from DefaultParamHandler.

Reimplemented from DefaultParamHandler.

Friends And Related Function Documentation

◆ PScore

friend struct PScore
friend

Member Data Documentation

◆ fragment_mass_tolerance_

double fragment_mass_tolerance_
protected

Fragment mass tolerance for spectrum comparisons.

◆ fragment_tolerance_ppm_

bool fragment_tolerance_ppm_
protected

Is fragment mass tolerance given in ppm (or Da)?

◆ max_peptide_length_

Size max_peptide_length_
protected

Limit for peptide lengths that can be analyzed.

◆ max_permutations_

Size max_permutations_
protected

Limit for number of sequence permutations that can be handled.

◆ unambiguous_score_

double unambiguous_score_
protected

Score for unambiguous assignments (all sites phosphorylated)