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 #ifndef OPENMS_METADATA_PROTEINIDENTIFICATION_H
00036 #define OPENMS_METADATA_PROTEINIDENTIFICATION_H
00037
00038 #include <OpenMS/METADATA/ProteinHit.h>
00039 #include <OpenMS/METADATA/MetaInfoInterface.h>
00040 #include <OpenMS/DATASTRUCTURES/DateTime.h>
00041
00042 #include <set>
00043
00044 namespace OpenMS
00045 {
00046 class PeptideIdentification;
00061 class OPENMS_DLLAPI ProteinIdentification :
00062 public MetaInfoInterface
00063 {
00064 public:
00066 typedef ProteinHit HitType;
00067
00071 struct ProteinGroup
00072 {
00074 DoubleReal probability;
00076 StringList accessions;
00077
00078 ProteinGroup() :
00079 probability(0.0), accessions()
00080 {}
00081
00082 bool operator==(const ProteinGroup rhs) const
00083 {
00084 return probability == rhs.probability &&
00085 accessions == rhs.accessions;
00086 }
00087
00088 };
00089
00091 enum PeakMassType
00092 {
00093 MONOISOTOPIC,
00094 AVERAGE,
00095 SIZE_OF_PEAKMASSTYPE
00096 };
00098 static const std::string NamesOfPeakMassType[SIZE_OF_PEAKMASSTYPE];
00099
00100
00101 enum DigestionEnzyme
00102 {
00103 TRYPSIN,
00104 PEPSIN_A,
00105 PROTEASE_K,
00106 CHYMOTRYPSIN,
00107 NO_ENZYME,
00108 UNKNOWN_ENZYME,
00109 SIZE_OF_DIGESTIONENZYME
00110 };
00112 static const std::string NamesOfDigestionEnzyme[SIZE_OF_DIGESTIONENZYME];
00113
00115 struct SearchParameters :
00116 public MetaInfoInterface
00117 {
00118 String db;
00119 String db_version;
00120 String taxonomy;
00121 String charges;
00122 PeakMassType mass_type;
00123 std::vector<String> fixed_modifications;
00124 std::vector<String> variable_modifications;
00125 DigestionEnzyme enzyme;
00126 UInt missed_cleavages;
00127 DoubleReal peak_mass_tolerance;
00128 DoubleReal precursor_tolerance;
00129
00130 SearchParameters() :
00131 db(),
00132 db_version(),
00133 taxonomy(),
00134 charges(),
00135 mass_type(MONOISOTOPIC),
00136 fixed_modifications(),
00137 variable_modifications(),
00138 enzyme(UNKNOWN_ENZYME),
00139 missed_cleavages(0),
00140 peak_mass_tolerance(0.0),
00141 precursor_tolerance(0.0)
00142 {
00143 }
00144
00145 bool operator==(const SearchParameters & rhs) const
00146 {
00147 return db == rhs.db &&
00148 db_version == rhs.db_version &&
00149 taxonomy == rhs.taxonomy &&
00150 charges == rhs.charges &&
00151 mass_type == rhs.mass_type &&
00152 fixed_modifications == rhs.fixed_modifications &&
00153 variable_modifications == rhs.variable_modifications &&
00154 enzyme == rhs.enzyme &&
00155 missed_cleavages == rhs.missed_cleavages &&
00156 peak_mass_tolerance == rhs.peak_mass_tolerance &&
00157 precursor_tolerance == rhs.precursor_tolerance;
00158 }
00159
00160 bool operator!=(const SearchParameters & rhs) const
00161 {
00162 return !(*this == rhs);
00163 }
00164
00165 };
00166
00167
00170
00171 ProteinIdentification();
00173 virtual ~ProteinIdentification();
00175 ProteinIdentification(const ProteinIdentification & source);
00177 ProteinIdentification & operator=(const ProteinIdentification & source);
00179 bool operator==(const ProteinIdentification & rhs) const;
00181 bool operator!=(const ProteinIdentification & rhs) const;
00183
00185
00186
00187 const std::vector<ProteinHit> & getHits() const;
00189 std::vector<ProteinHit> & getHits();
00191 void insertHit(const ProteinHit & input);
00193 void setHits(const std::vector<ProteinHit> & hits);
00195 std::vector<ProteinHit>::iterator findHit(const String & accession);
00196
00198 const std::vector<ProteinGroup> & getProteinGroups() const;
00200 std::vector<ProteinGroup> & getProteinGroups();
00202 void insertProteinGroup(const ProteinGroup & group);
00203
00205 const std::vector<ProteinGroup> & getIndistinguishableProteins() const;
00207 std::vector<ProteinGroup> & getIndistinguishableProteins();
00209 void insertIndistinguishableProteins(const ProteinGroup & group);
00210
00212 DoubleReal getSignificanceThreshold() const;
00214 void setSignificanceThreshold(DoubleReal value);
00216 const String & getScoreType() const;
00218 void setScoreType(const String & type);
00220 bool isHigherScoreBetter() const;
00222 void setHigherScoreBetter(bool higher_is_better);
00224 void sort();
00226 void assignRanks();
00234 Size computeCoverage(const std::vector<PeptideIdentification> & pep_ids);
00236
00238
00239
00240 const DateTime & getDateTime() const;
00242 void setDateTime(const DateTime & date);
00244 void setSearchEngine(const String & search_engine);
00246 const String & getSearchEngine() const;
00248 void setSearchEngineVersion(const String & search_engine_version);
00250 const String & getSearchEngineVersion() const;
00252 void setSearchParameters(const SearchParameters & search_parameters);
00254 const SearchParameters & getSearchParameters() const;
00256 const String & getIdentifier() const;
00258 void setIdentifier(const String & id);
00260
00261 protected:
00263
00264 String id_;
00265 String search_engine_;
00266 String search_engine_version_;
00267 SearchParameters search_parameters_;
00268 DateTime date_;
00270
00272
00273 String protein_score_type_;
00274 bool higher_score_better_;
00275 std::vector<ProteinHit> protein_hits_;
00276 std::vector<ProteinGroup> protein_groups_;
00278 std::vector<ProteinGroup> indistinguishable_proteins_;
00279 DoubleReal protein_significance_threshold_;
00281 };
00282
00283 }
00284 #endif // OPENMS_METADATA_PROTEINIDENTIFICATION_H