00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #if !defined(ms_fragment_INCLUDED_)
00020 #define ms_fragment_INCLUDED_
00021
00022
00023
00024 #include <string>
00025 #include <set>
00026 #include <vector>
00027 #include <map>
00028
00029
00030 namespace matrix_science {
00036
00037 class MS_MASCOTRESFILE_API ms_fragment
00038 {
00039 public:
00041
00067 enum LABEL_FORMAT {
00068 LABEL_FORMAT_TRADITIONAL = 0,
00069 LABEL_FORMAT_PEPTIDE_VIEW = 1
00070 };
00071
00073 ms_fragment();
00074
00076 ms_fragment(const ms_fragment &src);
00077
00078 #ifndef SWIG
00079
00080 ms_fragment& operator=(const ms_fragment& right);
00081 #endif
00082
00083 void copyFrom(const ms_fragment* src);
00084
00086 ms_fragment(const int seriesID,
00087 const double massValue,
00088 const double nlValue,
00089 const int col,
00090 const int chargeState = 1,
00091 const double matchedExptMass = 0,
00092 const double matchedExptIntensity = 0);
00093
00095 ms_fragment(const ms_peptide::PSM psmComponent,
00096 const int seriesID,
00097 const double massValue,
00098 const double nlValue,
00099 const int col,
00100 const int chargeState,
00101 const double matchedExptMass = 0,
00102 const double matchedExptIntensity = 0);
00103
00105 ms_fragment(const char * seriesName,
00106 const double massValue,
00107 const double nlValue,
00108 const int col,
00109 const int chargeState = 1,
00110 const double matchedExptMass = 0,
00111 const double matchedExptIntensity = 0);
00112
00114 ms_fragment(const ms_peptide::PSM psmComponent,
00115 const char * seriesName,
00116 const double massValue,
00117 const double nlValue,
00118 const int col,
00119 const int chargeState,
00120 const double matchedExptMass = 0,
00121 const double matchedExptIntensity = 0);
00122
00124 ms_fragment(const int seriesID,
00125 const double massValue,
00126 const double nlValue,
00127 const char * peptideStr,
00128 const int startPos,
00129 const int endPos,
00130 const int chargeState = 1,
00131 const double matchedExptMass = 0,
00132 const double matchedExptIntensity = 0);
00133
00135 ms_fragment(const ms_peptide::PSM psmComponent,
00136 const int seriesID,
00137 const double massValue,
00138 const double nlValue,
00139 const char * peptideStr,
00140 const int startPos,
00141 const int endPos,
00142 const int chargeState,
00143 const double matchedExptMass = 0,
00144 const double matchedExptIntensity = 0);
00145
00147 ms_fragment(const char residueName,
00148 const double massValue,
00149 const double nlValue,
00150 const int col = -1,
00151 const int chargeState = 1,
00152 const double matchedExptMass = 0,
00153 const double matchedExptIntensity = 0);
00154
00156 ms_fragment(const ms_peptide::PSM psmComponent,
00157 const char residueName,
00158 const double massValue,
00159 const double nlValue,
00160 const int col,
00161 const int chargeState,
00162 const double matchedExptMass = 0,
00163 const double matchedExptIntensity = 0);
00164
00166 ms_fragment(const double massValue,
00167 const double nlValue,
00168 const int chargeState,
00169 const double matchedExptMass = 0,
00170 const double matchedExptIntensity = 0);
00171
00173 bool isFromAlpha() const;
00174
00176 bool isFromBeta() const;
00177
00179 bool isRegular() const;
00180
00182 bool isNTerminal() const;
00183
00185 bool isCTerminal() const;
00186
00188 bool isInternal() const;
00189
00191 bool isImmonium() const;
00192
00194 bool isPrecursorNL() const;
00195
00197 double getMass() const;
00198
00200 double getNeutralLoss() const;
00201
00203 std::string getLabel(const LABEL_FORMAT fmt = LABEL_FORMAT_TRADITIONAL) const;
00204
00206 std::string getPeptideSubstring() const;
00207
00209 std::string getSeriesName() const;
00210
00212 int getColumn() const;
00213
00215 int getStart() const;
00216
00218 int getEnd() const;
00219
00221 int getCharge() const;
00222
00224 void clearMatchedIon();
00225
00227 void setMatchedIon(const double mass, const double intensity);
00228
00230 double getMatchedIonMass() const;
00231
00233 double getMatchedIonIntensity() const;
00234
00236 int getAllMatchedIons(std::vector<double> & masses, std::vector<double> & intensities) const;
00237
00238 protected:
00239 enum ION_TYPE {ION_TYPE_UNKNOWN,
00240 ION_TYPE_REGULAR,
00241 ION_TYPE_INTERNAL,
00242 ION_TYPE_IMMONIUM,
00243 ION_TYPE_PRECURSOR_NL};
00244 enum ION_TERMINUS {ION_TERM_AMBIGUOUS,
00245 ION_TERM_N,
00246 ION_TERM_C};
00247 ms_peptide::PSM psmComponent_;
00248 double mass_;
00249 double nl_;
00250 std::string labelTraditional_;
00251 std::string labelPeptideView_;
00252 std::string peptideSubstring_;
00253 std::string series_;
00254 int start_;
00255 int end_;
00256 int charge_;
00257 ION_TYPE type_;
00258 ION_TERMINUS terminus_;
00259 bool matchedValueSet_;
00260 double matchedExptMass_;
00261 double matchedExptIntensity_;
00262 std::vector<double> matchedExptMasses_;
00263 std::vector<double> matchedExptIntensities_;
00264
00265 private:
00266 void initRegularFragment(const ms_peptide::PSM psmComponent,
00267 const int seriesID,
00268 const double massValue,
00269 const double nlValue,
00270 const int col,
00271 const int chargeState,
00272 const double matchedExptMass,
00273 const double matchedExptIntensity);
00274
00275 void initRegularFragment(const ms_peptide::PSM psmComponent,
00276 const char* seriesName,
00277 const double massValue,
00278 const double nlValue,
00279 const int col,
00280 const int chargeState,
00281 const double matchedExptMass,
00282 const double matchedExptIntensity);
00283
00284 void initInternalFragment(const ms_peptide::PSM psmComponent,
00285 const int seriesID,
00286 const double massValue,
00287 const double nlValue,
00288 const char* peptideStr,
00289 const int startPos,
00290 const int endPos,
00291 const int chargeState,
00292 const double matchedExptMass,
00293 const double matchedExptIntensity);
00294
00295 void initImmoniumFragment(const ms_peptide::PSM psmComponent,
00296 const char residueName,
00297 const double massValue,
00298 const double nlValue,
00299 const int col,
00300 const int chargeState,
00301 const double matchedExptMass,
00302 const double matchedExptIntensity);
00303
00304 };
00306 }
00307
00308 #endif // !defined(ms_fragment_INCLUDED_)