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
32namespace pwiz {
33namespace proteome {
34
35
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
48typedef boost::shared_ptr<Protein> ProteinPtr;
49
50
51// note: derived container to support dynamic linking on Windows
52class 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
73typedef 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
102};
103
104
105} // namespace proteome
106} // namespace pwiz
107
108
109#endif // _PROTEOMEDATA_HPP_
#define PWIZ_API_DECL
Definition Export.hpp:32
represents a peptide or polypeptide (a sequence of amino acids)
Definition Peptide.hpp:62
virtual bool empty() const
virtual ProteinPtr protein(size_t index, bool getSequence=true) const =0
virtual IndexList findKeyword(const std::string &keyword, bool caseSensitive=true) const
virtual size_t find(const std::string &id) const
virtual size_t size() const =0
boost::shared_ptr< Protein > ProteinPtr
boost::shared_ptr< ProteinList > ProteinListPtr
Protein(const std::string &id, size_t index, const std::string &description, const std::string &sequence)
std::vector< ProteinPtr > proteins
virtual ProteinPtr protein(size_t index, bool getSequence=true) const
ProteomeData & operator=(const ProteomeData &)
ProteomeData(const ProteomeData &)