-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSpecAnalyzeSupport.h
151 lines (128 loc) · 5.21 KB
/
SpecAnalyzeSupport.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*
Copyright 2007-2016, Michael R. Hoopmann, Institute for Systems Biology
Michael J. MacCoss, University of Washington
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef _SPECANALYZESUPPORT_H
#define _SPECANALYZESUPPORT_H
#include <vector>
#include "CAveragine.h"
#include "CMercury8.h"
#include "HardklorTypes.h"
/* ******************************************************* */
/* CPeakPrediction */
/* ******************************************************* */
class CPeakPrediction{
private:
//Data Members
double mz; //Peak m/z in spectrum
float intensity; //Peak intensity in spectrum
std::vector<int> *charges; //All charge state predictions for this peak
protected:
public:
//Constructors and Destructors
CPeakPrediction();
CPeakPrediction(const CPeakPrediction& p);
~CPeakPrediction();
//Overloaded operators
CPeakPrediction& operator=(const CPeakPrediction& p);
//Functions
void AddCharge(int charge); //Add charge state to the vector
void Clear(); //Clear all information
void EraseCharge(int index); //Remove charge state
int GetCharge(int index); //Get charge state from index
float GetIntensity(); //Return intensity
double GetMZ(); //Return m/z
void SetIntensity(float newIntens); //Set intensity
void SetMZ(double newMZ); //Set m/z
int Size(); //Get number of charge state predictions
};
/* ******************************************************* */
/* CPeptideVariant */
/* ******************************************************* */
class CPeptideVariant {
private:
MSToolkit::Peak_T *match; //Array of mz and intensities that match the peak list at index n
int matchSize;
MSToolkit::Peak_T *mismatch; //Array of mz and intensities that do not match the peak list at index n
int mismatchSize;
std::vector<MSToolkit::Peak_T> *extra; //Temporary storage of mismatch data until mismatch array size is determined
int charge; //Charge state of variant
char formula[64]; //Molecular formula (averagine-based)
double monoMass; //monoisotopic mass
double distArea; //distribution area (sum of centroided peaks)
CHardklorVariant variant; //Variant settings
protected:
public:
//Constructors & Destructors
CPeptideVariant();
CPeptideVariant(const CPeptideVariant& p);
~CPeptideVariant();
//Operator overloads
CPeptideVariant& operator=(const CPeptideVariant& p);
//Functions
void AddExtra(double& mz, float& intensity);
void AddMatch(int& index, double& mz, float& intensity);
void AddMismatch(int& index, double& mz, float& intensity);
void Clear();
void DeleteExtra();
double& GetArea();
int& GetCharge();
MSToolkit::Peak_T& GetExtra(int& index);
char* GetFormula();
CHardklorVariant& GetHKVariant();
MSToolkit::Peak_T& GetMatch(int& index);
MSToolkit::Peak_T& GetMismatch(int& index);
double& GetMonoMass();
void SetArea(double& d);
void SetCharge(int ch);
void SetFormula(char form[64]);
void SetMatchSize(int& num);
void SetMismatchSize(int& num);
void SetMonoMass(double mass);
void SetVariant(CHardklorVariant& v);
int SizeExtra();
};
/* ******************************************************* */
/* CPeptidePrediction */
/* ******************************************************* */
class CPeptidePrediction {
private:
std::vector<CPeptideVariant> *variantList; //vector of all variants for this peptide
double mz; //mz peak from which variants are derived
float intensity; //intensity of mz peak
int bestVar; //Index to variant with best match/mismatch score
int maxPeakIndex;
protected:
public:
//Make variants here?
/* Pass vector of variants (CHardklorVariant) and make Mercury distributions */
/* Or calculate the variant externally and add it. */
//Constructors & Destructors
CPeptidePrediction();
CPeptidePrediction(const CPeptidePrediction& p);
~CPeptidePrediction();
//Overloaded operators
CPeptidePrediction& operator=(const CPeptidePrediction& p);
//Functions
void AddVariant(CPeptideVariant& var);
void Clear();
float GetIntensity();
int GetMaxPeakIndex();
double GetMZ();
CPeptideVariant& GetVariant(int& index);
void SetIntensity(float intens);
void SetMaxPeakIndex(int index);
void SetMZ(double mass);
int VariantListSize();
float& GetIntensityAt(int& variant, int& mz);
};
#endif