00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef MSPEAK__HPP
00035 #define MSPEAK__HPP
00036
00037 #include <corelib/ncbimisc.hpp>
00038 #include <objects/omssa/omssa__.hpp>
00039 #include <util/rangemap.hpp>
00040 #include <util/itree.hpp>
00041
00042 #include <set>
00043 #include <iostream>
00044 #include <vector>
00045 #include <deque>
00046 #include <map>
00047 #include <string.h>
00048
00049 #include "msms.hpp"
00050 #include "msladder.hpp"
00051 #include "SpectrumSet.hpp"
00052 #include "omssascore.hpp"
00053
00054
00055 BEGIN_NCBI_SCOPE
00056 BEGIN_SCOPE(objects)
00057 BEGIN_SCOPE(omssa)
00058
00059
00060 class CMSPeak;
00061
00062
00063 enum EMSPeakListTypes {
00064 eMSPeakListOriginal,
00065 eMSPeakListTop,
00066 eMSPeakListCharge1,
00067 eMSPeakListCharge2,
00068 eMSPeakListCharge3,
00069 eMSPeakListCharge4,
00070 eMSPeakListCharge5,
00071 eMSPeakListCharge6,
00072 eMSPeakListCharge7,
00073 eMSPeakListCharge8,
00074 eMSPeakListCharge9,
00075 eMSPeakListCharge10,
00076 eMSPeakListCharge11,
00077 eMSPeakListCharge12,
00078 eMSPeakListCharge13,
00079 eMSPeakListCharge14,
00080 eMSPeakListCharge15,
00081 eMSPeakListCharge16,
00082 eMSPeakListCharge17,
00083 eMSPeakListCharge18,
00084 eMSPeakListCharge19,
00085 eMSPeakListCharge20,
00086 eMSPeakListCharge21,
00087 eMSPeakListCharge22,
00088 eMSPeakListCharge23,
00089 eMSPeakListCharge24,
00090 eMSPeakListCharge25,
00091 eMSPeakListCharge26,
00092 eMSPeakListCharge27,
00093 eMSPeakListCharge28,
00094 eMSPeakListCharge29,
00095 eMSPeakListCharge30,
00096 eMSPeakListChargeMax
00097 };
00098
00099
00100
00101
00102
00103 class CMSModInfo {
00104 public:
00105 const int GetModEnum(void) const;
00106 int& SetModEnum(void);
00107
00108 const int GetSite(void) const;
00109 int& SetSite(void);
00110
00111 const int GetIsFixed(void) const;
00112 int& SetIsFixed(void);
00113
00114 private:
00115
00116 int ModEnum;
00117
00118 int Site;
00119
00120 int IsFixed;
00121 };
00122
00123
00124
00125
00126 inline
00127 const int CMSModInfo::GetModEnum(void) const
00128 {
00129 return ModEnum;
00130 }
00131
00132 inline
00133 int& CMSModInfo::SetModEnum(void)
00134 {
00135 return ModEnum;
00136 }
00137
00138 inline
00139 const int CMSModInfo::GetSite(void) const
00140 {
00141 return Site;
00142 }
00143
00144 inline
00145 int& CMSModInfo::SetSite(void)
00146 {
00147 return Site;
00148 }
00149
00150
00151 inline
00152 const int CMSModInfo::GetIsFixed(void) const
00153 {
00154 return IsFixed;
00155 }
00156
00157 inline
00158 int& CMSModInfo::SetIsFixed(void)
00159 {
00160 return IsFixed;
00161 }
00162
00163
00164
00165
00166
00167
00168
00169 typedef AutoPtr <CMSModInfo, ArrayDeleter<CMSModInfo> > TModInfo;
00170
00171
00172
00173
00174
00175 class CMSHit: public CMSSpectrumMatch {
00176 public:
00177
00178 CMSHit(void);
00179 CMSHit(int StartIn, int StopIn, int IndexIn);
00180 CMSHit(int StartIn, int StopIn, int IndexIn, int MassIn, int HitsIn,
00181 int ChargeIn);
00182
00183
00184 const int GetStart(void) const;
00185
00186
00187 int& SetStart();
00188
00189
00190 const int GetStop(void) const;
00191
00192
00193 int& SetStop(void);
00194
00195
00196 const int GetSeqIndex(void) const;
00197
00198
00199 int& SetSeqIndex(void);
00200
00201
00202
00203
00204
00205
00206 const CMSModInfo& GetModInfo(int n) const;
00207
00208
00209
00210
00211
00212
00213 CMSModInfo& SetModInfo(int n);
00214
00215
00216
00217
00218 const int GetNumModInfo(void) const;
00219
00220
00221
00222
00223 int CountHits(double Threshold, int MaxI);
00224
00225
00226
00227
00228
00229
00230
00231
00232 void CountHitsByType(int& Independent,
00233 int& Dependent,
00234 double Threshold,
00235 int MaxI) const;
00236
00237
00238
00239
00240
00241 int CountHits(double Threshold, int MaxI, int High);
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257 void RecordMatches(CLadderContainer& LadderContainer,
00258 int iMod,
00259 CMSPeak *Peaks,
00260 unsigned ModMask,
00261 CMod ModList[],
00262 int NumMod,
00263 const char *PepStart,
00264 int Searchctermproduct,
00265 int Searchb1,
00266 int TheoreticalMassIn
00267 );
00268
00269
00270
00271
00272
00273
00274 int CountMods(unsigned ModMask, int NumMod);
00275
00276
00277
00278
00279
00280
00281
00282
00283 void RecordModInfo(unsigned ModMask,
00284 CMod ModList[],
00285 int NumMod,
00286 const char *PepStart
00287 );
00288
00289
00290
00291
00292
00293
00294
00295 CMSHit& operator= (CMSHit& in);
00296
00297 protected:
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309 void RecordMatchesScan(CLadder& Ladder,
00310 int& iHitInfo,
00311 CMSPeak *Peaks,
00312 EMSPeakListTypes Which,
00313 int NOffset,
00314 int COffset);
00315
00316 private:
00317
00318
00319 CMSHit(const CMSHit& in) {}
00320
00321
00322
00323
00324 int Start, Stop;
00325
00326
00327
00328
00329 int Index;
00330
00331
00332 TModInfo ModInfo;
00333
00334
00335 int NumModInfo;
00336 };
00337
00338
00339
00340
00341 inline
00342 CMSHit::CMSHit(void)
00343 {
00344 SetHits() = 0;
00345 }
00346
00347 inline
00348 CMSHit::CMSHit(int StartIn, int StopIn, int IndexIn):
00349 Start(StartIn), Stop(StopIn), Index(IndexIn)
00350 {
00351 SetHits() = 0;
00352 }
00353
00354 inline
00355 CMSHit::CMSHit(int StartIn, int StopIn, int IndexIn, int MassIn, int HitsIn,
00356 int ChargeIn):
00357 Start(StartIn), Stop(StopIn), Index(IndexIn)
00358 {
00359 SetHits() = HitsIn;
00360 SetExpMass() = MassIn;
00361 SetCharge() = ChargeIn;
00362 }
00363
00364 inline
00365 const int CMSHit::GetStart(void) const
00366 {
00367 return Start;
00368 }
00369
00370 inline
00371 int& CMSHit::SetStart(void)
00372 {
00373 return Start;
00374 }
00375
00376 inline
00377 const int CMSHit::GetStop(void) const
00378 {
00379 return Stop;
00380 }
00381
00382 inline
00383 int& CMSHit::SetStop(void)
00384 {
00385 return Stop;
00386 }
00387
00388 inline
00389 const int CMSHit::GetSeqIndex(void) const
00390 {
00391 return Index;
00392 }
00393
00394 inline
00395 int& CMSHit::SetSeqIndex(void)
00396 {
00397 return Index;
00398 }
00399
00400 inline
00401 CMSModInfo& CMSHit::SetModInfo(int n)
00402 {
00403 return *(ModInfo.get() + n);
00404 }
00405
00406 inline
00407 const CMSModInfo& CMSHit::GetModInfo(int n) const
00408 {
00409 return *(ModInfo.get() + n);
00410 }
00411
00412 inline
00413 const int CMSHit::GetNumModInfo(void) const
00414 {
00415 return NumModInfo;
00416 }
00417
00418 inline
00419 CMSHit& CMSHit::operator= (CMSHit& in)
00420 {
00421
00422 if(this == &in) return *this;
00423
00424 CMSSpectrumMatch::operator= (in);
00425 Start = in.Start;
00426 Stop = in.Stop;
00427 Index = in.Index;
00428 NumModInfo = in.NumModInfo;
00429 int i;
00430 ModInfo.reset();
00431 if(in.ModInfo) {
00432 ModInfo.reset(new CMSModInfo[NumModInfo]);
00433 for(i = 0; i < NumModInfo; i++)
00434 SetModInfo(i) = in.SetModInfo(i);
00435 }
00436 return *this;
00437 }
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453 class CMZI: public CMSBasicPeak {
00454 public:
00455 CMZI(void);
00456 CMZI(int MZIn, unsigned IntensityIn);
00457 CMZI(double MZIn, double IntensityIn);
00458
00459
00460 const TMSRank GetRank(void) const;
00461
00462
00463 TMSRank& SetRank(void);
00464
00465 private:
00466
00467 TMSRank Rank;
00468 };
00469
00470
00471
00472 inline
00473 CMZI::CMZI(void)
00474 {}
00475
00476 inline
00477 CMZI::CMZI(int MZIn, unsigned IntensityIn)
00478 {
00479 SetMZ() = MZIn;
00480 SetIntensity() = IntensityIn;
00481 }
00482
00483 inline
00484 CMZI::CMZI(double MZIn, double IntensityIn)
00485 {
00486 SetMZ() = MSSCALE2INT(MZIn);
00487 SetIntensity() = static_cast <unsigned> (IntensityIn);
00488 }
00489
00490 inline
00491 const TMSRank CMZI::GetRank(void) const
00492 {
00493 return Rank;
00494 }
00495
00496 inline
00497 TMSRank& CMZI::SetRank(void)
00498 {
00499 return Rank;
00500 }
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515 typedef CMSHit * TMSHitList;
00516
00517
00518 #define MSHITMIN 2
00519
00520
00521
00522 #define MSPEAKMIN 5
00523
00524
00525 #define MSBIN 100
00526
00527
00528
00529
00530
00531
00532
00533 typedef bool (*TMZIbool) (const CMZI&, const CMZI&, int tol);
00534
00535 enum EChargeState {
00536 eChargeUnknown,
00537 eCharge1,
00538 eChargeNot1,
00539 eCharge2,
00540 eCharge3,
00541 eCharge4,
00542 eCharge5 };
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552 enum EMSPeakListSort {
00553 eMSPeakListSortNone,
00554 eMSPeakListSortMZ,
00555 eMSPeakListSortIntensity
00556 };
00557
00558
00559
00560
00561
00562
00563 class CMSPeakList : public CObject {
00564 public:
00565 CMSPeakList(void);
00566
00567 CMZI * const GetMZI(void) const;
00568 void SetMZI(CMZI *In);
00569
00570 const int GetNum(void) const;
00571 int& SetNum(void);
00572
00573 const EMSPeakListSort GetSorted(void) const;
00574 EMSPeakListSort& SetSorted(void);
00575
00576
00577
00578
00579
00580
00581 void CreateLists(int Size);
00582
00583
00584
00585
00586
00587 void Sort(EMSPeakListSort SortType);
00588
00589
00590
00591
00592
00593
00594 void Rank(void);
00595
00596 private:
00597
00598 AutoPtr <CMZI, ArrayDeleter<CMZI> > MZI;
00599
00600
00601 int Num;
00602
00603 EMSPeakListSort Sorted;
00604 };
00605
00606 inline
00607 CMZI * const CMSPeakList::GetMZI(void) const
00608 {
00609 return MZI.get();
00610 }
00611
00612 inline
00613 void CMSPeakList::SetMZI(CMZI *In)
00614 {
00615 MZI.reset(In);
00616 }
00617
00618 inline
00619 const int CMSPeakList::GetNum(void) const
00620 {
00621 return Num;
00622 }
00623
00624 inline
00625 int& CMSPeakList::SetNum(void)
00626 {
00627 return Num;
00628 }
00629
00630 inline
00631 const EMSPeakListSort CMSPeakList::GetSorted(void) const
00632 {
00633 return Sorted;
00634 }
00635
00636 inline
00637 EMSPeakListSort& CMSPeakList::SetSorted(void)
00638 {
00639 return Sorted;
00640 }
00641
00642
00643
00644
00645
00646
00647
00648 class CMSPeak {
00649 public:
00650
00651
00652
00653
00654 CMSPeak(void);
00655
00656
00657
00658
00659
00660
00661 CMSPeak(int HitListSize);
00662
00663
00664 private:
00665
00666
00667
00668
00669 void xCMSPeak(void);
00670
00671
00672
00673
00674
00675
00676
00677
00678 void xWrite(std::ostream& FileOut, const CMZI * const Temp, const int Num) const;
00679
00680 public:
00681
00682 ~CMSPeak(void);
00683
00684
00685
00686
00687
00688
00689
00690 int CompareSortedRank(CLadder& Ladder,
00691 EMSPeakListTypes Which,
00692 vector<bool>& usedPeaks);
00693
00694
00695
00696
00697
00698
00699
00700 int Read(const CMSSpectrum& Spectrum,
00701 const CMSSearchSettings& Settings);
00702
00703
00704
00705
00706
00707
00708
00709 void ReadAndProcess(const CMSSpectrum& Spectrum,
00710 const CMSSearchSettings& Settings);
00711
00712
00713
00714
00715
00716
00717
00718
00719 void Write(std::ostream& FileOut, const EMSSpectrumFileType FileType,
00720 const EMSPeakListTypes Which) const;
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731 void CullIterate(CMZI *Temp, int& TempLen, const TMZIbool FCN);
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742 void CullPrecursor(CMZI *Temp,
00743 int& TempLen,
00744 const int Precursor,
00745 const int Charge,
00746 bool PrecursorCull);
00747
00748
00749
00750
00751
00752
00753
00754
00755 void CullBaseLine(const double Threshold, CMZI *Temp, int& TempLen);
00756
00757
00758
00759
00760
00761
00762
00763 void CullIsotope(CMZI *Temp, int& TempLen);
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773 void CullH20NH3(CMZI *Temp, int& TempLen);
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783 void SmartCull(const CMSSearchSettings& Settings,
00784 CMZI *Temp,
00785 int& TempLen,
00786 const bool ConsiderMultProduct
00787 );
00788
00789
00790
00791
00792
00793
00794 void CullAll(const CMSSearchSettings& Settings);
00795
00796
00797
00798
00799
00800
00801 void CullChargeAndWhich(const CMSSearchSettings& Settings
00802 );
00803
00804
00805
00806
00807
00808
00809
00810
00811 void HighLow(int& High,
00812 int& Low,
00813 int& NumPeaks,
00814 const int PrecursorMass,
00815 const int Charge,
00816 const double Threshold,
00817 int& NumLo,
00818 int& NumHi
00819 );
00820
00821
00822
00823
00824 const int CountAAIntervals(const CMassArray& MassArray,
00825 const bool Nodup,
00826 const EMSPeakListTypes Which ) const;
00827
00828
00829
00830
00831 const int AboveThresh(const double Threshold,
00832 const EMSPeakListTypes Which) const;
00833
00834
00835
00836
00837 const int PercentBelow(void) const;
00838
00839
00840
00841
00842 const int CountRange(const double StartFraction,
00843 const double StopFraction) const;
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853 const int CountMZRange(const int StartIn,
00854 const int StopIn,
00855 const double MinIntensity,
00856 const int Which) const;
00857
00858
00859
00860
00861
00862 const double RangeRatio(const double Start,
00863 const double Middle,
00864 const double Stop) const;
00865
00866
00867
00868
00869
00870 void SetPlusOne(const double PlusIn);
00871
00872
00873
00874
00875 const bool IsPlus1(const double PercentBelowIn) const;
00876
00877
00878
00879
00880
00881
00882
00883 void SetComputedCharge(const CMSChargeHandle& ChargeHandle,
00884 const CMSSpectrum& Spectrum);
00885
00886
00887
00888
00889 const EChargeState GetComputedCharge(void) const;
00890
00891
00892
00893
00894 int * GetCharges(void);
00895
00896
00897
00898
00899 const int GetNumCharges(void) const;
00900
00901
00902
00903
00904
00905
00906
00907 const int Compare(CLadder& Ladder,
00908 const EMSPeakListTypes Which) const;
00909
00910
00911
00912
00913
00914
00915
00916 const bool Contains(const int value,
00917 const EMSPeakListTypes Which) const;
00918
00919
00920
00921
00922
00923
00924
00925
00926 const bool ContainsFast(const int value,
00927 const EMSPeakListTypes Which) const;
00928
00929
00930
00931
00932
00933
00934 const bool CompareTop(CLadder& Ladder);
00935
00936
00937
00938
00939
00940
00941 const int GetMaxI(const EMSPeakListTypes Which) const;
00942
00943
00944
00945
00946
00947
00948 const EMSPeakListTypes GetWhich(const int Charge) const;
00949
00950
00951
00952
00953
00954
00955 void InitHitList(const int Minhitin
00956 );
00957
00958
00959
00960
00961
00962
00963 TMSHitList& GetHitList(const int Index);
00964
00965
00966
00967
00968
00969 const int GetMinhit() const;
00970
00971
00972
00973
00974
00975 int & SetMinhit(void);
00976
00977
00978
00979
00980
00981
00982 const int GetHitListIndex(const int Index) const;
00983
00984
00985
00986
00987
00988
00989
00990
00991 const bool AddHit(CMSHit& in, CMSHit*& out);
00992
00993
00994
00995
00996
00997
00998
00999 const int GetPeptidesExamined(const int ChargeIn) const;
01000
01001
01002
01003
01004
01005
01006 int& SetPeptidesExamined(const int ChargeIn);
01007
01008
01009
01010
01011
01012
01013
01014 const int GetPrecursormz(void) const;
01015
01016
01017
01018
01019
01020
01021 const int CalcPrecursorMass(const int PrecursorCharge) const;
01022
01023
01024
01025
01026 const int GetConsiderMult(void) const;
01027
01028
01029
01030
01031 const EMSHitError GetError(void) const;
01032
01033
01034
01035
01036
01037
01038 void SetError(const EMSHitError ErrorIn);
01039
01040
01041
01042
01043 CMSSpectrum::TIds& SetName(void);
01044
01045
01046
01047
01048 const CMSSpectrum::TIds& GetName(void) const;
01049
01050
01051
01052
01053 int& SetNumber(void);
01054
01055
01056
01057
01058 const int GetNumber(void) const;
01059
01060
01061
01062
01063
01064
01065 void SetTolerance(const double tolin);
01066
01067
01068
01069
01070 const int GetTol(void) const;
01071
01072
01073
01074
01075
01076
01077 void SetPrecursorTol(double tolin);
01078
01079
01080
01081
01082 const int GetPrecursorTol(void) const;
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092
01093
01094 const bool IsAtMZ(const int BigMZ,
01095 const int TestMZ,
01096 const int Diff,
01097 const int tolin) const;
01098
01099
01100
01101
01102
01103
01104
01105
01106 const bool IsMajorPeak(const int BigMZ,
01107 const int TestMZ,
01108 const int tolin) const;
01109
01110
01111
01112
01113 typedef vector < CRef < CMSPeakList > > TPeakLists;
01114
01115
01116
01117
01118 const TPeakLists& GetPeakLists(void) const;
01119
01120
01121
01122
01123 TPeakLists& SetPeakLists(void);
01124
01125 private:
01126
01127 TPeakLists PeakLists;
01128 int Precursormz;
01129 int Charges[eMSPeakListChargeMax - eMSPeakListCharge1];
01130 int NumCharges;
01131
01132
01133 int tol;
01134
01135 int PrecursorTol;
01136
01137 double PlusOne;
01138 EChargeState ComputedCharge;
01139 int ConsiderMult;
01140 int MaxCharge;
01141 int MinCharge;
01142 CAA AA;
01143
01144 CMSSpectrum::TIds Name;
01145 int Number;
01146 int Minhit;
01147
01148
01149 TMSHitList HitList[eMSPeakListChargeMax - eMSPeakListCharge1];
01150 int HitListSize;
01151 int HitListIndex[eMSPeakListChargeMax - eMSPeakListCharge1];
01152 int LastHitNum[eMSPeakListChargeMax - eMSPeakListCharge1];
01153 int PeptidesExamined[eMSPeakListChargeMax - eMSPeakListCharge1];
01154
01155 EMSHitError Error;
01156
01157 };
01158
01159
01160
01161
01162 inline
01163 const CMSPeak::TPeakLists& CMSPeak::GetPeakLists(void) const
01164 {
01165 return PeakLists;
01166 }
01167
01168 inline
01169 CMSPeak::TPeakLists& CMSPeak::SetPeakLists(void)
01170 {
01171 return PeakLists;
01172 }
01173
01174 inline
01175 void CMSPeak::SetPlusOne(const double PlusIn)
01176 {
01177 PlusOne = PlusIn;
01178 }
01179
01180 inline
01181 const EChargeState CMSPeak::GetComputedCharge(void) const
01182 {
01183 return ComputedCharge;
01184 }
01185
01186 inline
01187 TMSHitList& CMSPeak::GetHitList(const int Index)
01188 {
01189 return HitList[Index];
01190 }
01191
01192 inline
01193 const int CMSPeak::GetHitListIndex(const int Index) const
01194 {
01195 return HitListIndex[Index];
01196 }
01197
01198 inline
01199 const int CMSPeak::GetMinhit() const
01200 {
01201 return Minhit;
01202 }
01203
01204 inline
01205 int & CMSPeak::SetMinhit(void)
01206 {
01207 return Minhit;
01208 }
01209
01210 inline
01211 const int CMSPeak::GetPeptidesExamined(const int ChargeIn) const
01212 {
01213 return PeptidesExamined[ChargeIn - Charges[0]];
01214 }
01215
01216 inline
01217 int& CMSPeak::SetPeptidesExamined(const int ChargeIn)
01218 {
01219 return PeptidesExamined[ChargeIn - Charges[0]];
01220 }
01221
01222 inline
01223 const int CMSPeak::GetPrecursormz(void) const
01224 {
01225 return Precursormz;
01226 }
01227
01228 inline
01229 const int CMSPeak::CalcPrecursorMass(const int PrecursorCharge) const
01230 {
01231 return Precursormz * PrecursorCharge - MSSCALE2INT(PrecursorCharge * kProton);
01232 }
01233
01234
01235 inline
01236 const int CMSPeak::GetConsiderMult(void) const
01237 {
01238 return ConsiderMult;
01239 }
01240
01241 inline
01242 const EMSHitError CMSPeak::GetError(void) const
01243 {
01244 return Error;
01245 }
01246
01247 inline
01248 void CMSPeak::SetError(const EMSHitError ErrorIn)
01249 {
01250 Error = ErrorIn;
01251 }
01252
01253 inline
01254 CMSSpectrum::TIds& CMSPeak::SetName(void)
01255 {
01256 return Name;
01257 }
01258
01259 inline
01260 const CMSSpectrum::TIds& CMSPeak::GetName(void) const
01261 {
01262 return Name;
01263 }
01264
01265 inline
01266 int& CMSPeak::SetNumber(void)
01267 {
01268 return Number;
01269 }
01270
01271 inline
01272 const int CMSPeak::GetNumber(void) const
01273 {
01274 return Number;
01275 }
01276
01277 inline
01278 void CMSPeak::SetTolerance(const double tolin)
01279 {
01280 tol = MSSCALE2INT(tolin);
01281 }
01282
01283 inline
01284 const int CMSPeak::GetTol(void) const
01285 {
01286 return tol;
01287 }
01288
01289 inline
01290 void CMSPeak::SetPrecursorTol(double tolin)
01291 {
01292 PrecursorTol = MSSCALE2INT(tolin);
01293 }
01294
01295 inline
01296 const int CMSPeak::GetPrecursorTol(void) const
01297 {
01298 return PrecursorTol;
01299 }
01300
01301
01302 inline
01303 const EMSPeakListTypes CMSPeak::GetWhich(const int Charge) const
01304 {
01305 return static_cast <EMSPeakListTypes> (eMSPeakListCharge1 + Charge - 1);
01306 }
01307
01308 inline
01309 int * CMSPeak::GetCharges(void)
01310 {
01311 return Charges;
01312 }
01313
01314 inline
01315 const int CMSPeak::GetNumCharges(void) const
01316 {
01317 return NumCharges;
01318 }
01319
01320
01321
01322
01323
01324
01325
01326
01327
01328
01329
01330
01331 typedef deque <CMSPeak *> TPeakSet;
01332
01333 class _MassPeak: public CObject {
01334 public:
01335 int Mass, Peptol;
01336 int Charge;
01337 CMSPeak *Peak;
01338 };
01339
01340 typedef _MassPeak TMassPeak;
01341
01342
01343
01344 typedef CRange<TSignedSeqPos> TMassRange;
01345
01346 class CMSPeakSet: public CObject {
01347 public:
01348
01349 CMSPeakSet(void);
01350 ~CMSPeakSet();
01351
01352 void AddPeak(CMSPeak *PeakIn);
01353
01354
01355
01356
01357
01358
01359
01360
01361 int SortPeaks(
01362 int Peptol,
01363 int Zdep
01364 );
01365
01366 TPeakSet& GetPeaks(void);
01367 CIntervalTree& SetIntervalTree(void);
01368
01369 private:
01370 TPeakSet PeakSet;
01371 CIntervalTree MassIntervals;
01372 };
01373
01374
01375
01376 inline CMSPeakSet::CMSPeakSet(void)
01377 {}
01378
01379 inline void CMSPeakSet::AddPeak(CMSPeak *PeakIn)
01380 {
01381 PeakSet.push_back(PeakIn);
01382 }
01383
01384 inline
01385 CIntervalTree& CMSPeakSet::SetIntervalTree(void)
01386 {
01387 return MassIntervals;
01388 }
01389
01390 inline
01391 TPeakSet& CMSPeakSet::GetPeaks(void)
01392 {
01393 return PeakSet;
01394 }
01395
01396
01397
01398 END_SCOPE(omssa)
01399 END_SCOPE(objects)
01400 END_NCBI_SCOPE
01401
01402 #endif
01403
01404
01405