Go to the documentation of this file.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
00035
00036 #ifndef OPENMS_ANALYSIS_DENOVO_COMPNOVOIDENTIFICATIONBASE_H
00037 #define OPENMS_ANALYSIS_DENOVO_COMPNOVOIDENTIFICATIONBASE_H
00038
00039
00040 #include <OpenMS/METADATA/PeptideIdentification.h>
00041 #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
00042 #include <OpenMS/DATASTRUCTURES/Map.h>
00043 #include <OpenMS/COMPARISON/SPECTRA/ZhangSimilarityScore.h>
00044 #include <OpenMS/CHEMISTRY/MASSDECOMPOSITION/MassDecomposition.h>
00045 #include <OpenMS/CHEMISTRY/MASSDECOMPOSITION/MassDecompositionAlgorithm.h>
00046 #include <OpenMS/ANALYSIS/DENOVO/CompNovoIonScoringBase.h>
00047
00048
00049 #include <vector>
00050
00051 namespace OpenMS
00052 {
00058 class OPENMS_DLLAPI CompNovoIdentificationBase :
00059 public DefaultParamHandler
00060 {
00061
00062 public:
00063
00067
00068 CompNovoIdentificationBase();
00069
00071 CompNovoIdentificationBase(const CompNovoIdentificationBase & source);
00072
00074 virtual ~CompNovoIdentificationBase();
00076
00078 CompNovoIdentificationBase & operator=(const CompNovoIdentificationBase & source);
00079
00083
00084 virtual void getIdentifications(std::vector<PeptideIdentification> & ids, const PeakMap & exp) = 0;
00086
00087 typedef CompNovoIonScoringBase::IonScore IonScore;
00088
00089 protected:
00090
00092 void updateMembers_();
00093
00095 void filterPermuts_(std::set<String> & permut);
00096
00098 void selectPivotIons_(std::vector<Size> & pivots, Size left, Size right, Map<DoubleReal, IonScore> & CID_nodes, const PeakSpectrum & CID_orig_spec, DoubleReal precursor_weight, bool full_range = false);
00099
00101 void filterDecomps_(std::vector<MassDecomposition> & decomps);
00102
00104 void getDecompositions_(std::vector<MassDecomposition> & decomps, DoubleReal mass, bool no_caching = false);
00105
00107 void permute_(String prefix, String s, std::set<String> & permutations);
00108
00109 Size countMissedCleavagesTryptic_(const String & peptide) const;
00110
00112 void getCIDSpectrumLight_(PeakSpectrum & spec, const String & sequence, DoubleReal prefix, DoubleReal suffix);
00113
00115 void getCIDSpectrum_(PeakSpectrum & spec, const String & sequence, Size charge, DoubleReal prefix = 0.0, DoubleReal suffix = 0.0);
00116
00118 void initIsotopeDistributions_();
00119
00121 DoubleReal estimatePrecursorWeight_(const PeakSpectrum & ETD_spec, Size & charge);
00122
00124 void windowMower_(PeakSpectrum & spec, DoubleReal windowsize, Size no_peaks);
00125
00127 DoubleReal compareSpectra_(const PeakSpectrum & s1, const PeakSpectrum & s2);
00128
00130 AASequence getModifiedAASequence_(const String & sequence);
00131
00133 String getModifiedStringFromAASequence_(const AASequence & sequence);
00134
00136 Map<char, const Residue *> name_to_residue_;
00137
00139 Map<const Residue *, char> residue_to_name_;
00140
00142 Map<Size, std::vector<DoubleReal> > isotope_distributions_;
00143
00145 Map<char, DoubleReal> aa_to_weight_;
00146
00147 MassDecompositionAlgorithm mass_decomp_algorithm_;
00148
00149 DoubleReal min_aa_weight_;
00150
00151 ZhangSimilarityScore zhang_;
00152
00153 Map<Size, Map<Size, std::set<String> > > subspec_to_sequences_;
00154
00155 Size max_number_aa_per_decomp_;
00156
00157 bool tryptic_only_;
00158
00159 DoubleReal fragment_mass_tolerance_;
00160
00161 Size max_number_pivot_;
00162
00163 DoubleReal decomp_weights_precision_;
00164
00165 DoubleReal max_mz_;
00166
00167 DoubleReal min_mz_;
00168
00169 DoubleReal max_decomp_weight_;
00170
00171 Size max_subscore_number_;
00172
00173 Size max_isotope_;
00174
00175 Map<DoubleReal, std::vector<MassDecomposition> > decomp_cache_;
00176
00177 Map<String, std::set<String> > permute_cache_;
00178
00179 public:
00180
00186 class Permut
00187 {
00188 private:
00189
00190 Permut() :
00191 score_(0)
00192 {
00193 }
00194
00195 public:
00196
00197 Permut(const std::set<String>::const_iterator & permut, DoubleReal s) :
00198 permut_(permut),
00199 score_(s)
00200 {
00201 }
00202
00203 Permut(const Permut & rhs) :
00204 permut_(rhs.permut_),
00205 score_(rhs.score_)
00206 {
00207 }
00208
00209 virtual ~Permut()
00210 {
00211 }
00212
00213 Permut & operator=(const Permut & rhs)
00214 {
00215 if (&rhs != this)
00216 {
00217 permut_ = rhs.permut_;
00218 score_ = rhs.score_;
00219 }
00220 return *this;
00221 }
00222
00223 const std::set<String>::const_iterator & getPermut() const
00224 {
00225 return permut_;
00226 }
00227
00228 void setPermut(const std::set<String>::const_iterator & it)
00229 {
00230 permut_ = it;
00231 }
00232
00233 DoubleReal getScore() const
00234 {
00235 return score_;
00236 }
00237
00238 void setScore(DoubleReal score)
00239 {
00240 score_ = score;
00241 }
00242
00243 protected:
00244
00245 std::set<String>::const_iterator permut_;
00246 DoubleReal score_;
00247 };
00248
00249 };
00250
00251 namespace Internal
00252 {
00253 bool PermutScoreComparator(const CompNovoIdentificationBase::Permut & p1, const CompNovoIdentificationBase::Permut & p2);
00254 }
00255 }
00256
00257 #endif