ProteoWizard
ProteomeData.hpp
Go to the documentation of this file.
1 //
2 // $Id$
3 //
4 //
5 // Original author: Matt Chambers <matt.chambers .@. vanderbilt.edu>
6 //
7 // Copyright 2009 Vanderbilt University - Nashville, TN 37232
8 //
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
12 //
13 // http://www.apache.org/licenses/LICENSE-2.0
14 //
15 // Unless required by applicable law or agreed to in writing, software
16 // distributed under the License is distributed on an "AS IS" BASIS,
17 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 // See the License for the specific language governing permissions and
19 // limitations under the License.
20 //
21 
22 
23 #ifndef _PROTEOMEDATA_HPP_
24 #define _PROTEOMEDATA_HPP_
25 
26 
28 #include "Peptide.hpp"
29 #include <boost/shared_ptr.hpp>
30 
31 
32 namespace pwiz {
33 namespace proteome {
34 
35 
36 struct PWIZ_API_DECL Protein : public Peptide
37 {
38  Protein(const std::string& id, size_t index, const std::string& description, const std::string& sequence);
39 
40  bool empty() const;
41 
42  std::string id;
43  size_t index;
44  std::string description;
45 };
46 
47 
48 typedef boost::shared_ptr<Protein> ProteinPtr;
49 
50 
51 // note: derived container to support dynamic linking on Windows
52 class IndexList : public std::vector<size_t> {};
53 
54 
56 {
57  public:
58 
59  virtual size_t size() const = 0;
60 
61  virtual ProteinPtr protein(size_t index, bool getSequence = true) const = 0;
62 
63  virtual bool empty() const;
64 
65  virtual size_t find(const std::string& id) const;
66 
67  virtual IndexList findKeyword(const std::string& keyword, bool caseSensitive = true) const;
68 
69  virtual ~ProteinList() {}
70 };
71 
72 
73 typedef boost::shared_ptr<ProteinList> ProteinListPtr;
74 
75 
77 {
78  std::vector<ProteinPtr> proteins;
79 
80  // ProteinList implementation
81 
82  virtual size_t size() const {return proteins.size();}
83  virtual bool empty() const {return proteins.empty();}
84  virtual ProteinPtr protein(size_t index, bool getSequence = true) const;
85 };
86 
87 
89 {
90  std::string id;
91 
93 
95  virtual ~ProteomeData() {}
96  bool empty() const;
97 
98  private:
99  // no copying
100  ProteomeData(const ProteomeData&);
101  ProteomeData& operator=(const ProteomeData&);
102 };
103 
104 
105 } // namespace proteome
106 } // namespace pwiz
107 
108 
109 #endif // _PROTEOMEDATA_HPP_
pwiz::proteome::Protein::description
std::string description
Definition: ProteomeData.hpp:44
pwiz::proteome::ProteinListSimple
Definition: ProteomeData.hpp:76
pwiz
Definition: ChromatogramList_Filter.hpp:36
pwiz::proteome::Protein::id
std::string id
Definition: ProteomeData.hpp:42
pwiz::proteome::ProteomeData::ProteomeData
ProteomeData()
Definition: ProteomeData.hpp:94
pwiz::proteome
Definition: AminoAcid.hpp:35
pwiz::proteome::ProteinList::~ProteinList
virtual ~ProteinList()
Definition: ProteomeData.hpp:69
pwiz::proteome::Peptide
represents a peptide or polypeptide (a sequence of amino acids)
Definition: Peptide.hpp:61
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition: Export.hpp:32
pwiz::proteome::ProteomeData::id
std::string id
Definition: ProteomeData.hpp:90
pwiz::proteome::ProteomeData::proteinListPtr
ProteinListPtr proteinListPtr
Definition: ProteomeData.hpp:92
Export.hpp
pwiz::proteome::IndexList
Definition: ProteomeData.hpp:52
pwiz::proteome::ProteomeData
Definition: ProteomeData.hpp:88
pwiz::proteome::ProteinListPtr
boost::shared_ptr< ProteinList > ProteinListPtr
Definition: ProteomeData.hpp:73
pwiz::proteome::Protein
Definition: ProteomeData.hpp:36
pwiz::proteome::ProteinListSimple::size
virtual size_t size() const
Definition: ProteomeData.hpp:82
pwiz::proteome::ProteinListSimple::proteins
std::vector< ProteinPtr > proteins
Definition: ProteomeData.hpp:78
pwiz::proteome::ProteomeData::~ProteomeData
virtual ~ProteomeData()
Definition: ProteomeData.hpp:95
pwiz::proteome::ProteinListSimple::empty
virtual bool empty() const
Definition: ProteomeData.hpp:83
pwiz::proteome::Protein::index
size_t index
Definition: ProteomeData.hpp:43
pwiz::proteome::ProteinList
Definition: ProteomeData.hpp:55
Peptide.hpp
pwiz::proteome::ProteinPtr
boost::shared_ptr< Protein > ProteinPtr
Definition: ProteomeData.hpp:48