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

PeptideHit.h (Maintainer: Nico Pfeifer)

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // --------------------------------------------------------------------------
00005 //                   OpenMS Mass Spectrometry Framework
00006 // --------------------------------------------------------------------------
00007 //  Copyright (C) 2003-2008 -- Oliver Kohlbacher, Knut Reinert
00008 //
00009 //  This library is free software; you can redistribute it and/or
00010 //  modify it under the terms of the GNU Lesser General Public
00011 //  License as published by the Free Software Foundation; either
00012 //  version 2.1 of the License, or (at your option) any later version.
00013 //
00014 //  This library is distributed in the hope that it will be useful,
00015 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 //  Lesser General Public License for more details.
00018 //
00019 //  You should have received a copy of the GNU Lesser General Public
00020 //  License along with this library; if not, write to the Free Software
00021 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //
00023 // --------------------------------------------------------------------------
00024 // $Maintainer: Nico Pfeifer $
00025 // --------------------------------------------------------------------------
00026 
00027 #ifndef OPENMS_METADATA_PEPTIDEHIT_H
00028 #define OPENMS_METADATA_PEPTIDEHIT_H
00029 
00030 #include <vector>
00031 
00032 #include <OpenMS/CONCEPT/Types.h>
00033 #include <OpenMS/DATASTRUCTURES/String.h>
00034 #include <OpenMS/METADATA/MetaInfoInterface.h>
00035 
00036 namespace OpenMS
00037 {
00045   class PeptideHit
00046     : public MetaInfoInterface
00047   {
00048     public:
00049 
00051 
00052 
00053       class ScoreMore
00054       {
00055         public:
00056           template<typename Arg>
00057           bool operator()(const Arg& a, const Arg& b)
00058           {
00059             return a.getScore() > b.getScore();
00060           }
00061       };
00062       
00064       class ScoreLess
00065       {
00066         public:
00067           template<typename Arg>
00068           bool operator()(const Arg& a, const Arg& b)
00069           {
00070             return a.getScore() < b.getScore();
00071           }
00072       };
00074 
00077 
00078       PeptideHit();
00079       
00081       PeptideHit(DoubleReal score, 
00082                  UInt rank, 
00083                  Int charge,
00084                  const String& sequence);
00085   
00087       PeptideHit(const PeptideHit& source);
00088           
00090       virtual ~PeptideHit();
00092       
00094       PeptideHit& operator=(const PeptideHit& source);
00095   
00097       bool operator == (const PeptideHit& rhs) const;
00098       
00100       bool operator != (const PeptideHit& rhs) const;
00101   
00105 
00106       Real getScore() const;
00107       
00109       UInt getRank() const;
00110       
00112       String getSequence() const;
00113       
00115       Int getCharge() const;
00116       
00118       const std::vector<String>& getProteinAccessions() const;
00119   
00121       void setProteinAccessions(const std::vector<String>& accessions);
00122       
00124       void setScore(DoubleReal score);
00125       
00127       void setRank(UInt newrank);
00128       
00130       void setSequence(const String& sequence);
00131   
00133       void setCharge(Int charge);
00134       
00136       void addProteinAccession(const String& accession); 
00137       
00139       void setAABefore(char acid);
00141       char getAABefore() const;
00142 
00144       void setAAAfter(char acid);
00146       char getAAAfter() const;
00147 
00148       
00150   
00151     
00152     protected:
00153       Real score_;                  
00154       UInt rank_;           
00155       Int charge_; 
00156       String sequence_;             
00157       char aa_before_; 
00158       char aa_after_; 
00159       std::vector<String> corresponding_protein_accessions_; 
00160   
00161   };
00162 
00163 } // namespace OpenMS
00164 
00165 #endif // OPENMS_METADATA_PEPTIDEHIT_H

Generated Tue Apr 1 15:36:36 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1