⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mspeak.hpp

📁 ncbi源码
💻 HPP
📖 第 1 页 / 共 2 页
字号:
    // return allowed computed charges    int* GetCharges(void) { return Charges;}    // return number of allowed computed charges    int GetNumCharges(void) { return NumCharges; }    // Truncate the at the precursor if plus one and set charge to 1    // if charge is erronously set to 1, set it to 2    void TruncatePlus1(void);        unsigned GetNum(int Which = MSORIGINAL);    CMZI *GetMZI(int Which = MSORIGINAL);    int Compare(CLadder& Ladder, int Which = MSCULLED1);    bool Contains(int value, int Which);    bool ContainsFast(int value, int Which);    // compares only the top hits    bool CompareTop(CLadder& Ladder);    int GetMaxI(int Which = MSORIGINAL);    // returns the cull array index    int GetWhich(int Charge);    // compare assuming all lists are sorted    // Intensity is optional argument that allows recording of the intensity    int CompareSorted(CLadder& Ladder, int Which, TIntensity * Intensity);    // initializes arrays used to track hits    void CMSPeak::InitHitList(void);    TMSHitList& GetHitList(int Index);    int GetHitListIndex(int Index);    // add hit to hitlist.  returns true and the added hit if successful    bool AddHit(CMSHit& in, CMSHit*& out);    // keep track of the number of peptides examine for each charge state    int GetPeptidesExamined(int ChargeIn);    int& SetPeptidesExamined(int ChargeIn);    // getter-setters    int GetMass(void);    // get charge that came from input file    int GetCharge(void);    EMSHitError GetError(void);    void SetError(EMSHitError ErrorIn);    string& SetName(void);    const string& GetName(void) const;    int& SetNumber(void);    const int GetNumber(void) const;    // set the mass tolerance.  input in Daltons.    void SetTolerance(double tolin);    int GetTol(void);    char *SetUsed(int Which);    // clear used arrays for one cull type    void ClearUsed(int Which);    // clear used arrays for all cull types    void ClearUsedAll(void);    // functions for testing if peaks are h2o or nh3 losses    // check to see if TestMZ is Diff away from BigMZ    bool IsAtMZ(int BigMZ, int TestMZ, int Diff, int tol);    // see if TestMZ can be associated with BigMZ, e.g. water loss, etc.    bool IsMajorPeak(int BigMZ, int TestMZ, int tol);private:    CMZI *MZI[MSNUMDATA]; // m/z values and intensities, sorted by m/z.  first is original, second is culled    char *Used[MSNUMDATA];  // used to mark m/z values as used in a match    unsigned Num[MSNUMDATA]; // number of CMZI.  first is original, second is culled    bool Sorted[MSNUMDATA]; // have the CMZI been sorted?    bool *Match;    // is a peak matched or not?    CMZI ** IntensitySort;  // points to CMZI original, sorted.    int TotalMass;  // singly protonated m/z    int Charge;    // Charge from input file    int Charges[MSMAXCHARGE];  // Computed allowed charges    int NumCharges;  // array size of Charges[]    int tol;        // error tolerance of peptide    double PlusOne;  // value used to determine if spectra is +1    EChargeState ComputedCharge;  // algorithmically calculated     CAA AA;    char *AAMap;    string Name;  // name taken from spectrum    int Number;  // spectrum number taken from spectrum    // list of hits    TMSHitList HitList[MSMAXCHARGE];    int HitListSize;  // max size of hit list    int HitListIndex[MSMAXCHARGE];  // current size of HitList    int LastHitNum[MSMAXCHARGE];  // the smallest hit currently in List    int PeptidesExamined[MSMAXCHARGE];  // the number of peptides examined in search    EMSHitError Error; // errors that have occurred in processing};///////////////////   CMSPeak inline methodsinline void CMSPeak::SetPlusOne(double PlusIn) {     PlusOne = PlusIn; }inline EChargeState CMSPeak::GetComputedCharge(void) {     return ComputedCharge; }inline unsigned CMSPeak::GetNum(int Which) {     return Num[Which];}inline CMZI * CMSPeak::GetMZI(int Which) {     return MZI[Which];}inline TMSHitList& CMSPeak::GetHitList(int Index) {     return HitList[Index]; }inline int CMSPeak::GetHitListIndex(int Index) {     return HitListIndex[Index]; }// keep track of the number of peptides examine for each charge stateinline int CMSPeak::GetPeptidesExamined(int ChargeIn) {     return PeptidesExamined[ChargeIn - Charges[0]];}inline int& CMSPeak::SetPeptidesExamined(int ChargeIn) {     return PeptidesExamined[ChargeIn - Charges[0]];}inline int CMSPeak::GetMass(void) {     return TotalMass; }// get charge that came from input fileinline int CMSPeak::GetCharge(void) {     return Charge; }inline EMSHitError CMSPeak::GetError(void) {    return Error; }inline void CMSPeak::SetError(EMSHitError ErrorIn) {    Error = ErrorIn; }inline string& CMSPeak::SetName(void) {     return Name; }inline const string& CMSPeak::GetName(void) const {     return Name; }inline int& CMSPeak::SetNumber(void) {     return Number; }inline const int CMSPeak::GetNumber(void) const {     return Number; }// set the mass tolerance.  input in Daltons.inline void CMSPeak::SetTolerance(double tolin){    tol = static_cast <int> (tolin*MSSCALE);}inline int CMSPeak::GetTol(void) {     return tol; }inline char *CMSPeak::SetUsed(int Which){    return Used[Which];}inline void CMSPeak::ClearUsed(int Which){    memset(Used[Which], 0, Num[Which]);}inline void CMSPeak::ClearUsedAll(void){    int iCharges;    for(iCharges = 0; iCharges < GetNumCharges(); iCharges++)	ClearUsed(GetWhich(GetCharges()[iCharges]));    ClearUsed(MSTOPHITS);}// returns the cull array indexinline int CMSPeak::GetWhich(int Charge){    if(Charge <  kConsiderMult) return MSCULLED1;    else return MSCULLED2;}/////////////////// end of  CMSPeak  inline methods/////////////////////////////////////////////////////////////////////////////////  CMSPeakSet::////  Class used to hold sets of CMSPeak and access them quickly//typedef deque <CMSPeak *> TPeakSet;typedef struct _MassPeak {    int Mass, Peptol;    int Charge;    CMSPeak *Peak;} TMassPeak;typedef AutoPtr <TMassPeak, ArrayDeleter<TMassPeak> > TAPMassPeak;typedef multimap <int, TMassPeak> TMassPeakMap;class NCBI_XOMSSA_EXPORT CMSPeakSet {public:    // tor's    CMSPeakSet(void);    ~CMSPeakSet();    void AddPeak(CMSPeak *PeakIn);    // put the pointers into an array sorted by mass    void SortPeaks(		   int Peptol  // the precursor mass tolerance		   );    int GetArraySize(void);    // Get the first index into the sorted array where the mass    // is >= the given mass.  Remember to subtract the tolerance and    // check for out of bounds    TMassPeak *GetIndexLo(int Mass);    // get peak for sorted list by index into list    CMSPeak *GetPeak(int Index);      TMassPeak *GetEndMassPeak(void);     // get a particular MassPeak    TMassPeak& GetMassPeak(int i);    TPeakSet& GetPeaks(void);private:    TPeakSet PeakSet;  // peak list for deletion    TMassPeakMap MassMap;    TAPMassPeak MassPeak; // array of neutral masses    int ArraySize;  // size of above array};///////////////////   CMSPeakSet inline methodsinline CMSPeakSet::CMSPeakSet(void){}inline void CMSPeakSet::AddPeak(CMSPeak *PeakIn){     PeakSet.push_back(PeakIn); }inline int CMSPeakSet::GetArraySize(void) {     return ArraySize; }inline TMassPeak * CMSPeakSet::GetEndMassPeak(void) {     return MassPeak.get()+ArraySize; }inline TMassPeak& CMSPeakSet::GetMassPeak(int i) {     return *(MassPeak.get()+i); }inline TPeakSet& CMSPeakSet::GetPeaks(void) {     return PeakSet; }/////////////////// end of CMSPeakSet inline methodsEND_SCOPE(omssa)END_SCOPE(objects)END_NCBI_SCOPE#endif/*  $Log: mspeak.hpp,v $  Revision 1000.3  2004/06/01 18:09:07  gouriano  PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.14  Revision 1.14  2004/05/27 20:52:15  lewisg  better exception checking, use of AutoPtr, command line parsing  Revision 1.13  2004/04/06 19:53:20  lewisg  allow adjustment of precursor charges that allow multiply charged product ions  Revision 1.12  2004/03/30 19:36:59  lewisg  multiple mod code  Revision 1.11  2004/03/16 20:18:54  gorelenk  Changed includes of private headers.  Revision 1.10  2003/12/22 23:03:18  lewisg  top hit code and variable mod fixes  Revision 1.9  2003/12/08 17:37:20  ucko  #include <string.h> rather than <cstring>, since MIPSpro lacks the latter.  Revision 1.8  2003/12/05 13:10:32  lewisg  delete GetUsed  Revision 1.7  2003/12/04 23:39:08  lewisg  no-overlap hits and various bugfixes  Revision 1.6  2003/11/14 20:28:05  lewisg  scale precursor tolerance by charge  Revision 1.5  2003/11/10 22:24:12  lewisg  allow hitlist size to vary  Revision 1.4  2003/10/24 21:28:41  lewisg  add omssa, xomssa, omssacl to win32 build, including dll  Revision 1.3  2003/10/21 21:12:17  lewisg  reorder headers  Revision 1.2  2003/10/21 03:43:20  lewisg  fix double default  Revision 1.1  2003/10/20 21:32:13  lewisg  ommsa toolkit version  Revision 1.20  2003/10/07 18:02:28  lewisg  prep for toolkit  Revision 1.19  2003/10/06 18:14:17  lewisg  threshold vary  Revision 1.18  2003/08/14 23:49:22  lewisg  first pass at variable mod  Revision 1.17  2003/08/06 18:29:11  lewisg  support for filenames, numbers using regex  Revision 1.16  2003/07/21 20:25:03  lewisg  fix missing peak bug  Revision 1.15  2003/07/19 15:07:38  lewisg  indexed peaks  Revision 1.14  2003/07/18 20:50:34  lewisg  *** empty log message ***  Revision 1.13  2003/07/17 18:45:50  lewisg  multi dta support  Revision 1.12  2003/07/07 16:17:51  lewisg  new poisson distribution and turn off histogram  Revision 1.11  2003/04/24 18:45:55  lewisg  performance enhancements to ladder creation and peak compare  Revision 1.10  2003/04/18 20:46:52  lewisg  add graphing to omssa  Revision 1.9  2003/04/02 18:49:51  lewisg  improved score, architectural changes  Revision 1.8  2003/03/21 21:14:40  lewisg  merge ming's code, other stuff  Revision 1.7  2003/02/07 16:18:23  lewisg  bugfixes for perf and to work on exp data  Revision 1.6  2003/02/03 20:39:02  lewisg  omssa cgi  Revision 1.5  2003/01/21 22:19:26  lewisg  get rid of extra 2 aa function  Revision 1.4  2003/01/21 21:46:12  lewisg  *** empty log message ***  Revision 1.3  2002/11/27 00:07:52  lewisg  fix conflicts  Revision 1.2  2002/11/26 00:53:34  lewisg  sync versions  Revision 1.1  2002/07/16 13:27:09  lewisg  *** empty log message ***  	*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -