Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

ProteinIdentification.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------------
00002 //                   OpenMS -- Open-Source Mass Spectrometry
00003 // --------------------------------------------------------------------------
00004 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
00005 // ETH Zurich, and Freie Universitaet Berlin 2002-2012.
00006 //
00007 // This software is released under a three-clause BSD license:
00008 //  * Redistributions of source code must retain the above copyright
00009 //    notice, this list of conditions and the following disclaimer.
00010 //  * Redistributions in binary form must reproduce the above copyright
00011 //    notice, this list of conditions and the following disclaimer in the
00012 //    documentation and/or other materials provided with the distribution.
00013 //  * Neither the name of any author or any participating institution
00014 //    may be used to endorse or promote products derived from this software
00015 //    without specific prior written permission.
00016 // For a full list of authors, refer to the file AUTHORS.
00017 // --------------------------------------------------------------------------
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00019 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
00022 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00024 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00025 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00026 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00027 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00028 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00030 // --------------------------------------------------------------------------
00031 // $Maintainer: Chris Bielow $
00032 // $Authors: Nico Pfeifer, Chris Bielow $
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 } //namespace OpenMS
00284 #endif // OPENMS_METADATA_PROTEINIDENTIFICATION_H

OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:43 using doxygen 1.7.1