NCBI C++ ToolKit
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CMSSpectrumMatch Class Reference

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.)

+ Inheritance diagram for CMSSpectrumMatch:
+ Collaboration diagram for CMSSpectrumMatch:

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...
 
TMSMZSetExpMass (void)
 Set the experimental mass of the spectrum. More...
 
const TMSMZ GetTheoreticalMass (void) const
 return theoretical mass of the hit More...
 
TMSMZSetTheoreticalMass (void)
 set the theoretical mass of the hit More...
 
const TMSCharge GetCharge (void) const
 get the charge More...
 
TMSChargeSetCharge ()
 set the charge More...
 
const int GetSum (void) const
 Get the sum of ranks. More...
 
intSetSum (void)
 Set the sum of ranks. More...
 
const int GetM (void) const
 Get the number of matched peaks. More...
 
intSetM (void)
 Set the number of matched peaks. More...
 
const int GetN (void) const
 Get the number of experimental peaks. More...
 
intSetN (void)
 Set the number of experimental peaks. More...
 
const int GetHits (void) const
 return the size of the HitInfo array More...
 
intSetHits (void)
 set the size of the HitInfo array More...
 
const CMSBasicMatchedPeakGetHitInfo (int n) const
 Get the hit info at array position n. More...
 
CMSBasicMatchedPeakSetHitInfo (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...
 
CMSBasicMatchedPeakFind (TMSNumber Number, TMSCharge ChargeIn, TMSIonSeries Series)
 find a peak within HitInfo More...
 
const CMSMatchedPeakSetMapGetIonSeriesMatchMap (void) const
 get map from ion series to CMSMatchedPeakSet * More...
 
CMSMatchedPeakSetMapSetIonSeriesMatchMap (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

CMSBasicMatchedPeakHitInfo
 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...
 

Detailed Description

container for match between a spectrum and a mass ladder

base class for omssa CMSHit

Definition at line 562 of file msscore.hpp.

Constructor & Destructor Documentation

◆ CMSSpectrumMatch() [1/2]

CMSSpectrumMatch::CMSSpectrumMatch ( void  )

c'tor

Definition at line 247 of file msscore.cpp.

◆ ~CMSSpectrumMatch()

CMSSpectrumMatch::~CMSSpectrumMatch ( )
virtual

d'tor

deletes the HitInfo Array

Definition at line 258 of file msscore.cpp.

References HitInfo.

◆ CMSSpectrumMatch() [2/2]

CMSSpectrumMatch::CMSSpectrumMatch ( const CMSSpectrumMatch in)
inlineprivate

Definition at line 786 of file msscore.hpp.

Member Function Documentation

◆ CalcNormalTopHit()

const double CMSSpectrumMatch::CalcNormalTopHit ( double  Mean,
double  TopHitProb 
) const

integrate CalcPoissonTopHit over all i

Parameters
Meanmean value of poisson
TopHitProbprobability for top n hits
Returns
integral

Definition at line 509 of file msscore.cpp.

References CalcPoissonTopHit(), and i.

Referenced by CSearch< LEGACY, NHITS >::CalcNSort().

◆ CalcPoisson()

const double CMSSpectrumMatch::CalcPoisson ( double  Mean,
int  i 
) const

calulate the poisson distribution

Parameters
Meanmean value of poisson
icounts
Returns
value of poisson at i

Definition at line 496 of file msscore.cpp.

References i, and MSLNGAMMA.

Referenced by CalcPvalue().

◆ CalcPoissonMean()

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

Parameters
ProbTerminalthe probability of a terminal peak
NumTerminalMassesthe number of terminal masses searched (2 for trypsin)
ProbDependentthe probability of a peak following a peak
NumUniqueMassesthe number of unique masses searched (19 with no modifications)
ToleranceAdjustthe fraction to adjust mass tolerance > 0 and <=1
Returns
mean of poisson

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().

◆ CalcPoissonTopHit()

const double CMSSpectrumMatch::CalcPoissonTopHit ( double  Mean,
int  i,
double  TopHitProb 
) const

calculates the poisson times the top n hit probability

Parameters
Meanmean value of poisson
icounts
TopHitProbprobability for top n hits
Returns
value of poisson times top hit prob at i

Definition at line 501 of file msscore.cpp.

References i, and MSLNGAMMA.

Referenced by CalcNormalTopHit(), and CalcPvalueTopHit().

◆ CalcPvalue()

const double CMSSpectrumMatch::CalcPvalue ( double  Mean,
int  HitsIn 
) const

calculate the p-value using poisson distribution

Parameters
Meanmean value of poisson
HitsInnumber of hits
Returns
p-value

Definition at line 526 of file msscore.cpp.

References CalcPoisson(), epsilon, i, and MSDOUBLELIMIT.

Referenced by CSearch< LEGACY, NHITS >::CalcNSort().

◆ CalcPvalueTopHit()

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

Parameters
Meanmean value of poisson
HitsInnumber of hits
Normalthe integral of the distribution, used to normalize
TopHitProbthe probability of a top n hit.
Returns
p-value

Definition at line 554 of file msscore.cpp.

References CalcPoissonTopHit(), epsilon, i, and MSDOUBLELIMIT.

Referenced by CSearch< LEGACY, NHITS >::CalcNSort().

◆ CalcRankProb()

const double CMSSpectrumMatch::CalcRankProb ( void  ) const

calculate the rank score

Returns
probability of given ranks

Definition at line 585 of file msscore.cpp.

References GetM(), GetN(), GetSum(), and MSERF.

Referenced by CSearch< LEGACY, NHITS >::CalcNSort().

◆ CreateHitInfo()

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().

◆ FillMatchedPeaks()

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.

Parameters
ChargeIncharge of the ion series to fill
Seriesion series
sizelength of the ion series
MinIntensitythe minimum intensity of the peak to consider it as a match
Skipb1should the first forward going ion be ignored?
TerminalIonis either of the terminal ions statistically biased, e.g. only K or R at Cterm?
Maxproductionsthe number of ions in the ions series actually calculated
Sequencethe sequence (used for proline rule)
NoProlineno 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().

◆ Find()

CMSBasicMatchedPeak * CMSSpectrumMatch::Find ( TMSNumber  Number,
TMSCharge  ChargeIn,
TMSIonSeries  Series 
)

find a peak within HitInfo

Parameters
Numbernumber of the peak, starting with 0
ChargeIncharge of peak
Seriesthe series to search
Returns
found peak (0 if not found)

Definition at line 271 of file msscore.cpp.

References CMSBasicMatchedPeak::GetCharge(), GetHitInfo(), GetHits(), CMSBasicMatchedPeak::GetIonSeries(), CMSBasicMatchedPeak::GetNumber(), i, and SetHitInfo().

Referenced by FillMatchedPeaks().

◆ GetCharge()

const TMSCharge CMSSpectrumMatch::GetCharge ( void  ) const
inline

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().

◆ GetExpMass()

const TMSMZ CMSSpectrumMatch::GetExpMass ( void  ) const
inline

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().

◆ GetHitInfo()

const CMSBasicMatchedPeak & CMSSpectrumMatch::GetHitInfo ( int  n) const
inline

Get the hit info at array position n.

Parameters
narray position

Definition at line 906 of file msscore.hpp.

References HitInfo, and n.

Referenced by CSearch< LEGACY, NHITS >::AddIonsToHit(), CMSHit::CountHitsByType(), Find(), GetMaxDelta(), GetMeanDelta(), and GetStdDevDelta().

◆ GetHits()

const int CMSSpectrumMatch::GetHits ( void  ) const
inline

◆ GetIonSeriesMatchMap()

const CMSMatchedPeakSetMap & CMSSpectrumMatch::GetIonSeriesMatchMap ( void  ) const
inline

get map from ion series to CMSMatchedPeakSet *

Definition at line 918 of file msscore.hpp.

References IonSeriesMatchMap.

Referenced by CalcPoissonMean().

◆ GetM()

const int CMSSpectrumMatch::GetM ( void  ) const
inline

Get the number of matched peaks.

Definition at line 870 of file msscore.hpp.

References M.

Referenced by CalcRankProb().

◆ GetMaxDelta()

const TMSMZ CMSSpectrumMatch::GetMaxDelta ( void  ) const

calc max abs difference between experimental and theoretical mass values

Returns
const TMSMZ

Definition at line 629 of file msscore.cpp.

References abs, CMSBasicMatchedPeak::GetDelta(), GetHitInfo(), GetHits(), and i.

Referenced by CSearch< LEGACY, NHITS >::CalcNSort().

◆ GetMeanDelta()

const TMSMZ CMSSpectrumMatch::GetMeanDelta ( void  ) const

Calc mean delta.

Definition at line 599 of file msscore.cpp.

References CMSBasicMatchedPeak::GetDelta(), GetHitInfo(), GetHits(), and i.

Referenced by GetStdDevDelta().

◆ GetN()

const int CMSSpectrumMatch::GetN ( void  ) const
inline

Get the number of experimental peaks.

Definition at line 882 of file msscore.hpp.

References N.

Referenced by CalcRankProb().

◆ GetStdDevDelta()

const TMSMZ CMSSpectrumMatch::GetStdDevDelta ( void  ) const

Calc std dev of delta.

Definition at line 612 of file msscore.cpp.

References GetHitInfo(), GetHits(), GetMeanDelta(), and i.

◆ GetSum()

const int CMSSpectrumMatch::GetSum ( void  ) const
inline

Get the sum of ranks.

Definition at line 858 of file msscore.hpp.

References Sum.

Referenced by CalcRankProb().

◆ GetTheoreticalMass()

const TMSMZ CMSSpectrumMatch::GetTheoreticalMass ( void  ) const
inline

return theoretical mass of the hit

Definition at line 834 of file msscore.hpp.

References TheoreticalMass.

Referenced by CSearch< LEGACY, NHITS >::SetResult().

◆ SetCharge()

TMSCharge & CMSSpectrumMatch::SetCharge ( void  )
inline

set the charge

Definition at line 852 of file msscore.hpp.

References Charge.

Referenced by CMSHit::CMSHit(), and CSearch< LEGACY, NHITS >::Search().

◆ SetExpMass()

TMSMZ & CMSSpectrumMatch::SetExpMass ( void  )
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().

◆ SetHitInfo()

CMSBasicMatchedPeak & CMSSpectrumMatch::SetHitInfo ( int  n)
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

Parameters
narray position

Definition at line 912 of file msscore.hpp.

References HitInfo, and n.

Referenced by CMSHit::CountHits(), Find(), and CMSHit::RecordMatchesScan().

◆ SetHits()

int & CMSSpectrumMatch::SetHits ( void  )
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().

◆ SetIonSeriesMatchMap()

CMSMatchedPeakSetMap & CMSSpectrumMatch::SetIonSeriesMatchMap ( void  )
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().

◆ SetM()

int & CMSSpectrumMatch::SetM ( void  )
inline

Set the number of matched peaks.

Definition at line 876 of file msscore.hpp.

References M.

Referenced by CMSHit::RecordMatches(), and CMSHit::RecordMatchesScan().

◆ SetN()

int & CMSSpectrumMatch::SetN ( void  )
inline

Set the number of experimental peaks.

Definition at line 888 of file msscore.hpp.

References N.

Referenced by CMSHit::RecordMatches().

◆ SetSum()

int & CMSSpectrumMatch::SetSum ( void  )
inline

Set the sum of ranks.

Definition at line 864 of file msscore.hpp.

References Sum.

Referenced by CMSHit::RecordMatches(), and CMSHit::RecordMatchesScan().

◆ SetTheoreticalMass()

TMSMZ & CMSSpectrumMatch::SetTheoreticalMass ( void  )
inline

set the theoretical mass of the hit

Definition at line 840 of file msscore.hpp.

References TheoreticalMass.

Referenced by CMSHit::RecordMatches().

Member Data Documentation

◆ Charge

TMSCharge CMSSpectrumMatch::Charge
private

the charge of the hit

Definition at line 806 of file msscore.hpp.

Referenced by GetCharge(), and SetCharge().

◆ ExpMass

TMSMZ CMSSpectrumMatch::ExpMass
private

the experimental mass

Definition at line 800 of file msscore.hpp.

Referenced by GetExpMass(), and SetExpMass().

◆ HitInfo

CMSBasicMatchedPeak* CMSSpectrumMatch::HitInfo
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().

◆ Hits

int CMSSpectrumMatch::Hits
private

size of HitInfo array

Definition at line 797 of file msscore.hpp.

Referenced by GetHits(), and SetHits().

◆ IonSeriesMatchMap

CMSMatchedPeakSetMap CMSSpectrumMatch::IonSeriesMatchMap
private

map from ion series to matched peak sets

Definition at line 818 of file msscore.hpp.

Referenced by GetIonSeriesMatchMap(), and SetIonSeriesMatchMap().

◆ M

int CMSSpectrumMatch::M
private

Number of matched peaks.

Definition at line 812 of file msscore.hpp.

Referenced by GetM(), and SetM().

◆ N

int CMSSpectrumMatch::N
private

Number of exp peaks.

Definition at line 815 of file msscore.hpp.

Referenced by GetN(), and SetN().

◆ Sum

int CMSSpectrumMatch::Sum
private

Sum of Ranks.

Definition at line 809 of file msscore.hpp.

Referenced by GetSum(), and SetSum().

◆ TheoreticalMass

TMSMZ CMSSpectrumMatch::TheoreticalMass
private

theoretical mass

Definition at line 803 of file msscore.hpp.

Referenced by GetTheoreticalMass(), and SetTheoreticalMass().


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:30 2024 by modify_doxy.py rev. 669887