NCBI C++ ToolKit
|
Search Toolkit Book for CMSSpectrumMatch
container for match between a spectrum and a mass ladder More...
#include "msscore.hpp"
(Private to src/algo/ms/omssa
.)
Public Member Functions | |
CMSSpectrumMatch (void) | |
c'tor More... | |
virtual | ~CMSSpectrumMatch () |
d'tor More... | |
const TMSMZ | GetExpMass (void) const |
Get the experimental m/z of the spectrum. More... | |
TMSMZ & | SetExpMass (void) |
Set the experimental mass of the spectrum. More... | |
const TMSMZ | GetTheoreticalMass (void) const |
return theoretical mass of the hit More... | |
TMSMZ & | SetTheoreticalMass (void) |
set the theoretical mass of the hit More... | |
const TMSCharge | GetCharge (void) const |
get the charge More... | |
TMSCharge & | SetCharge () |
set the charge More... | |
const int | GetSum (void) const |
Get the sum of ranks. More... | |
int & | SetSum (void) |
Set the sum of ranks. More... | |
const int | GetM (void) const |
Get the number of matched peaks. More... | |
int & | SetM (void) |
Set the number of matched peaks. More... | |
const int | GetN (void) const |
Get the number of experimental peaks. More... | |
int & | SetN (void) |
Set the number of experimental peaks. More... | |
const int | GetHits (void) const |
return the size of the HitInfo array More... | |
int & | SetHits (void) |
set the size of the HitInfo array More... | |
const CMSBasicMatchedPeak & | GetHitInfo (int n) const |
Get the hit info at array position n. More... | |
CMSBasicMatchedPeak & | SetHitInfo (int n) |
Set the hit info at array position n. More... | |
void | CreateHitInfo (void) |
initialize the HitInfo array delete any existing array size is determined by GetHits() More... | |
CMSBasicMatchedPeak * | Find (TMSNumber Number, TMSCharge ChargeIn, TMSIonSeries Series) |
find a peak within HitInfo More... | |
const CMSMatchedPeakSetMap & | GetIonSeriesMatchMap (void) const |
get map from ion series to CMSMatchedPeakSet * More... | |
CMSMatchedPeakSetMap & | SetIonSeriesMatchMap (void) |
Set map from ion series to CMSMatchedPeakSet *. More... | |
void | FillMatchedPeaks (TMSCharge ChargeIn, TMSIonSeries Series, unsigned Size, TMSIntensity MinIntensity, bool Skipb1, EMSTerminalBias TerminalIon, int Maxproductions, string &Sequence, bool NoProline) |
copies hit array into match array fills in missing peaks does not fill in exp peak values. More... | |
const double | CalcPoissonMean (double ProbTerminal=0.0L, int NumTerminalMasses=2, double ProbDependent=0.0L, int NumUniqueMasses=19, double ToleranceAdjust=1.0L) const |
calculate the mean value of the poisson distribution for this match More... | |
const double | CalcPoisson (double Mean, int i) const |
calulate the poisson distribution More... | |
const double | CalcPoissonTopHit (double Mean, int i, double TopHitProb) const |
calculates the poisson times the top n hit probability More... | |
const double | CalcPvalue (double Mean, int HitsIn) const |
calculate the p-value using poisson distribution More... | |
const double | CalcNormalTopHit (double Mean, double TopHitProb) const |
integrate CalcPoissonTopHit over all i More... | |
const double | CalcPvalueTopHit (double Mean, int HitsIn, double Normal, double TopHitProb) const |
calculate the p-value using poisson distribution and the top hit prob More... | |
const double | CalcRankProb (void) const |
calculate the rank score More... | |
const TMSMZ | GetMeanDelta (void) const |
Calc mean delta. More... | |
const TMSMZ | GetStdDevDelta (void) const |
Calc std dev of delta. More... | |
const TMSMZ | GetMaxDelta (void) const |
calc max abs difference between experimental and theoretical mass values More... | |
Private Member Functions | |
CMSSpectrumMatch (const CMSSpectrumMatch &in) | |
Private Attributes | |
CMSBasicMatchedPeak * | HitInfo |
list of matched peaks ideally, this would be an array of pointers to allow each element to be virtual, but efficiency requires that it be an array. More... | |
int | Hits |
size of HitInfo array More... | |
TMSMZ | ExpMass |
the experimental mass More... | |
TMSMZ | TheoreticalMass |
theoretical mass More... | |
TMSCharge | Charge |
the charge of the hit More... | |
int | Sum |
Sum of Ranks. More... | |
int | M |
Number of matched peaks. More... | |
int | N |
Number of exp peaks. More... | |
CMSMatchedPeakSetMap | IonSeriesMatchMap |
map from ion series to matched peak sets More... | |
container for match between a spectrum and a mass ladder
base class for omssa CMSHit
Definition at line 562 of file msscore.hpp.
CMSSpectrumMatch::CMSSpectrumMatch | ( | void | ) |
c'tor
Definition at line 247 of file msscore.cpp.
|
virtual |
|
inlineprivate |
Definition at line 786 of file msscore.hpp.
const double CMSSpectrumMatch::CalcNormalTopHit | ( | double | Mean, |
double | TopHitProb | ||
) | const |
integrate CalcPoissonTopHit over all i
Mean | mean value of poisson |
TopHitProb | probability for top n hits |
Definition at line 509 of file msscore.cpp.
References CalcPoissonTopHit(), and i.
Referenced by CSearch< LEGACY, NHITS >::CalcNSort().
calulate the poisson distribution
Mean | mean value of poisson |
i | counts |
Definition at line 496 of file msscore.cpp.
Referenced by CalcPvalue().
const double CMSSpectrumMatch::CalcPoissonMean | ( | double | ProbTerminal = 0.0L , |
int | NumTerminalMasses = 2 , |
||
double | ProbDependent = 0.0L , |
||
int | NumUniqueMasses = 19 , |
||
double | ToleranceAdjust = 1.0L |
||
) | const |
calculate the mean value of the poisson distribution for this match
ProbTerminal | the probability of a terminal peak |
NumTerminalMasses | the number of terminal masses searched (2 for trypsin) |
ProbDependent | the probability of a peak following a peak |
NumUniqueMasses | the number of unique masses searched (19 with no modifications) |
ToleranceAdjust | the fraction to adjust mass tolerance > 0 and <=1 |
Definition at line 452 of file msscore.cpp.
References _TRACE, eMSMatchTypeDependent, eMSMatchTypeNoSearch, eMSMatchTypeTerminus, CMSMatchedPeak::GetExpIons(), GetIonSeriesMatchMap(), CMSMatchedPeak::GetMassTolerance(), CMSMatchedPeakSet::GetMatchedPeakSet(), CMSMatchedPeakSetMap::GetMatchMap(), CMSMatchedPeak::GetMatchType(), and i.
Referenced by CSearch< LEGACY, NHITS >::CalcNSort().
calculates the poisson times the top n hit probability
Mean | mean value of poisson |
i | counts |
TopHitProb | probability for top n hits |
Definition at line 501 of file msscore.cpp.
Referenced by CalcNormalTopHit(), and CalcPvalueTopHit().
calculate the p-value using poisson distribution
Mean | mean value of poisson |
HitsIn | number of hits |
Definition at line 526 of file msscore.cpp.
References CalcPoisson(), epsilon, i, and MSDOUBLELIMIT.
Referenced by CSearch< LEGACY, NHITS >::CalcNSort().
const double CMSSpectrumMatch::CalcPvalueTopHit | ( | double | Mean, |
int | HitsIn, | ||
double | Normal, | ||
double | TopHitProb | ||
) | const |
calculate the p-value using poisson distribution and the top hit prob
Mean | mean value of poisson |
HitsIn | number of hits |
Normal | the integral of the distribution, used to normalize |
TopHitProb | the probability of a top n hit. |
Definition at line 554 of file msscore.cpp.
References CalcPoissonTopHit(), epsilon, i, and MSDOUBLELIMIT.
Referenced by CSearch< LEGACY, NHITS >::CalcNSort().
const double CMSSpectrumMatch::CalcRankProb | ( | void | ) | const |
calculate the rank score
Definition at line 585 of file msscore.cpp.
References GetM(), GetN(), GetSum(), and MSERF.
Referenced by CSearch< LEGACY, NHITS >::CalcNSort().
void CMSSpectrumMatch::CreateHitInfo | ( | void | ) |
initialize the HitInfo array delete any existing array size is determined by GetHits()
Definition at line 263 of file msscore.cpp.
References GetHits(), and HitInfo.
Referenced by CMSHit::RecordMatches().
void CMSSpectrumMatch::FillMatchedPeaks | ( | TMSCharge | ChargeIn, |
TMSIonSeries | Series, | ||
unsigned | Size, | ||
TMSIntensity | MinIntensity, | ||
bool | Skipb1, | ||
EMSTerminalBias | TerminalIon, | ||
int | Maxproductions, | ||
string & | Sequence, | ||
bool | NoProline | ||
) |
copies hit array into match array fills in missing peaks does not fill in exp peak values.
This has to be done by the calling algorithm.
ChargeIn | charge of the ion series to fill |
Series | ion series |
size | length of the ion series |
MinIntensity | the minimum intensity of the peak to consider it as a match |
Skipb1 | should the first forward going ion be ignored? |
TerminalIon | is either of the terminal ions statistically biased, e.g. only K or R at Cterm? |
Maxproductions | the number of ions in the ions series actually calculated |
Sequence | the sequence (used for proline rule) |
NoProline | no n term proline cleavage |
Definition at line 287 of file msscore.cpp.
References CMSMatchedPeakSetMap::CreateSeries(), eMSBothTerminalBias, eMSCTerminalBias, eMSMatchTypeDependent, eMSMatchTypeIndependent, eMSMatchTypeNoSearch, eMSMatchTypeNotTyped, eMSMatchTypeSemiIndependent, eMSMatchTypeTerminus, eMSMatchTypeUnknown, eMSNTerminalBias, Find(), GetExpMass(), CMSBasicPeak::GetIntensity(), CMSMatchedPeakSet::GetMatchedPeakSet(), i, CMSBasicMatchedPeak::IsForwardSeries(), SetIonSeriesMatchMap(), CMSMatchedPeakSet::SetMatchedPeakSet(), and ncbi::grid::netcache::search::fields::size.
Referenced by CSearch< LEGACY, NHITS >::PepCharge().
CMSBasicMatchedPeak * CMSSpectrumMatch::Find | ( | TMSNumber | Number, |
TMSCharge | ChargeIn, | ||
TMSIonSeries | Series | ||
) |
find a peak within HitInfo
Number | number of the peak, starting with 0 |
ChargeIn | charge of peak |
Series | the series to search |
Definition at line 271 of file msscore.cpp.
References CMSBasicMatchedPeak::GetCharge(), GetHitInfo(), GetHits(), CMSBasicMatchedPeak::GetIonSeries(), CMSBasicMatchedPeak::GetNumber(), i, and SetHitInfo().
Referenced by FillMatchedPeaks().
get the charge
Definition at line 846 of file msscore.hpp.
References Charge.
Referenced by CSearch< LEGACY, NHITS >::CalcNSort(), CMSHit::RecordMatches(), and CSearch< LEGACY, NHITS >::SetResult().
Get the experimental m/z of the spectrum.
Definition at line 822 of file msscore.hpp.
References ExpMass.
Referenced by CSearch< LEGACY, NHITS >::CalcNSort(), FillMatchedPeaks(), CSearch< LEGACY, NHITS >::PepCharge(), and CSearch< LEGACY, NHITS >::SetResult().
|
inline |
Get the hit info at array position n.
n | array position |
Definition at line 906 of file msscore.hpp.
Referenced by CSearch< LEGACY, NHITS >::AddIonsToHit(), CMSHit::CountHitsByType(), Find(), GetMaxDelta(), GetMeanDelta(), and GetStdDevDelta().
return the size of the HitInfo array
Definition at line 894 of file msscore.hpp.
References Hits.
Referenced by CMSPeak::AddHit(), CSearch< LEGACY, NHITS >::AddIonsToHit(), CMSHit::CountHits(), CMSHit::CountHitsByType(), CreateHitInfo(), Find(), GetMaxDelta(), GetMeanDelta(), and GetStdDevDelta().
|
inline |
get map from ion series to CMSMatchedPeakSet *
Definition at line 918 of file msscore.hpp.
References IonSeriesMatchMap.
Referenced by CalcPoissonMean().
Get the number of matched peaks.
Definition at line 870 of file msscore.hpp.
References M.
Referenced by CalcRankProb().
calc max abs difference between experimental and theoretical mass values
Definition at line 629 of file msscore.cpp.
References abs, CMSBasicMatchedPeak::GetDelta(), GetHitInfo(), GetHits(), and i.
Referenced by CSearch< LEGACY, NHITS >::CalcNSort().
Calc mean delta.
Definition at line 599 of file msscore.cpp.
References CMSBasicMatchedPeak::GetDelta(), GetHitInfo(), GetHits(), and i.
Referenced by GetStdDevDelta().
Get the number of experimental peaks.
Definition at line 882 of file msscore.hpp.
References N.
Referenced by CalcRankProb().
Calc std dev of delta.
Definition at line 612 of file msscore.cpp.
References GetHitInfo(), GetHits(), GetMeanDelta(), and i.
Get the sum of ranks.
Definition at line 858 of file msscore.hpp.
References Sum.
Referenced by CalcRankProb().
return theoretical mass of the hit
Definition at line 834 of file msscore.hpp.
References TheoreticalMass.
Referenced by CSearch< LEGACY, NHITS >::SetResult().
|
inline |
set the charge
Definition at line 852 of file msscore.hpp.
References Charge.
Referenced by CMSHit::CMSHit(), and CSearch< LEGACY, NHITS >::Search().
|
inline |
Set the experimental mass of the spectrum.
Definition at line 828 of file msscore.hpp.
References ExpMass.
Referenced by CMSHit::CMSHit(), and CSearch< LEGACY, NHITS >::Search().
|
inline |
Set the hit info at array position n.
note: there is an implicit assumption in the scoring code that ions of the same species are grouped together and that the ions within the species are in order
n | array position |
Definition at line 912 of file msscore.hpp.
Referenced by CMSHit::CountHits(), Find(), and CMSHit::RecordMatchesScan().
|
inline |
set the size of the HitInfo array
Definition at line 900 of file msscore.hpp.
References Hits.
Referenced by CMSHit::CMSHit(), and CSearch< LEGACY, NHITS >::Search().
|
inline |
Set map from ion series to CMSMatchedPeakSet *.
Definition at line 924 of file msscore.hpp.
References IonSeriesMatchMap.
Referenced by FillMatchedPeaks(), and CSearch< LEGACY, NHITS >::PepCharge().
|
inline |
Set the number of matched peaks.
Definition at line 876 of file msscore.hpp.
References M.
Referenced by CMSHit::RecordMatches(), and CMSHit::RecordMatchesScan().
|
inline |
Set the number of experimental peaks.
Definition at line 888 of file msscore.hpp.
References N.
Referenced by CMSHit::RecordMatches().
|
inline |
Set the sum of ranks.
Definition at line 864 of file msscore.hpp.
References Sum.
Referenced by CMSHit::RecordMatches(), and CMSHit::RecordMatchesScan().
|
inline |
set the theoretical mass of the hit
Definition at line 840 of file msscore.hpp.
References TheoreticalMass.
Referenced by CMSHit::RecordMatches().
|
private |
the charge of the hit
Definition at line 806 of file msscore.hpp.
Referenced by GetCharge(), and SetCharge().
|
private |
the experimental mass
Definition at line 800 of file msscore.hpp.
Referenced by GetExpMass(), and SetExpMass().
|
private |
list of matched peaks ideally, this would be an array of pointers to allow each element to be virtual, but efficiency requires that it be an array.
this assertion should be tested.
Definition at line 794 of file msscore.hpp.
Referenced by CreateHitInfo(), GetHitInfo(), SetHitInfo(), and ~CMSSpectrumMatch().
|
private |
size of HitInfo array
Definition at line 797 of file msscore.hpp.
|
private |
map from ion series to matched peak sets
Definition at line 818 of file msscore.hpp.
Referenced by GetIonSeriesMatchMap(), and SetIonSeriesMatchMap().
|
private |
Number of matched peaks.
Definition at line 812 of file msscore.hpp.
|
private |
|
private |
|
private |
theoretical mass
Definition at line 803 of file msscore.hpp.
Referenced by GetTheoreticalMass(), and SetTheoreticalMass().