Chemical Data Processing Library C++ API - Version 1.4.0
PDBData.hpp
Go to the documentation of this file.
1 /*
2  * PDBData.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_BIOMOL_PDBDATA_HPP
30 #define CDPL_BIOMOL_PDBDATA_HPP
31 
32 #include <cstddef>
33 #include <string>
34 #include <map>
35 #include <memory>
36 
38 
39 
40 namespace CDPL
41 {
42 
43  namespace Biomol
44  {
45 
51  {
52 
53  public:
57  typedef std::shared_ptr<PDBData> SharedPointer;
58 
63  {
64 
69 
74 
79 
84 
89 
94 
99 
104 
109 
114 
119 
124 
129 
134 
139 
144 
149 
154 
159 
164 
169 
174 
179 
184 
189 
194 
199 
204 
209 
214 
219 
224 
229 
234 
239 
244 
249 
254 
259 
264 
269 
274 
279 
283  RESOLUTION
284  };
285 
286  private:
287  typedef std::map<RecordType, std::string> TypeToDataMap;
288 
289  public:
293  typedef typename TypeToDataMap::value_type Record;
294 
298  typedef typename TypeToDataMap::const_iterator ConstRecordIterator;
299 
303  typedef typename TypeToDataMap::iterator RecordIterator;
304 
309  data() {}
310 
315  PDBData(const PDBData& other):
316  data(other.data) {}
317 
321  void clear();
322 
327  std::size_t getNumRecords() const;
328 
333  bool isEmpty() const;
334 
340  bool containsRecord(const RecordType& type) const;
341 
349 
357 
364  std::string& getData(const RecordType& type);
365 
372  const std::string& getData(const RecordType& type) const;
373 
378  void removeRecord(const RecordIterator& it);
379 
385  bool removeRecord(const RecordType& type);
386 
393 
400  RecordIterator setRecord(const RecordType& type, const std::string& data);
401 
407 
413 
419 
425 
431 
437 
443 
449 
450  private:
451  TypeToDataMap data;
452  };
453  } // namespace Biomol
454 } // namespace CDPL
455 
456 #endif // CDPL_BIOMOL_PDBDATA_HPP
Definition of the preprocessor macro CDPL_BIOMOL_API.
#define CDPL_BIOMOL_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Data structure for the storage of preprocessed Brookhaven Protein Data Bank (PDB) data.
Definition: PDBData.hpp:51
PDBData(const PDBData &other)
Constructs a copy of the PDBData instance other.
Definition: PDBData.hpp:315
void clear()
Removes all stored records.
ConstRecordIterator end() const
Returns a constant iterator pointing one past the last stored record (range-based for support).
ConstRecordIterator begin() const
Returns a constant iterator pointing to the first stored record (range-based for support).
RecordIterator setRecord(const RecordType &type, const std::string &data)
Stores a record built from type and data (any pre-existing record of the same type is replaced).
ConstRecordIterator getRecordsBegin() const
Returns a constant iterator pointing to the first stored record.
bool containsRecord(const RecordType &type) const
Tells whether a record of the given type is stored.
RecordIterator getRecord(const RecordType &type)
Returns an iterator to the record of the given type.
ConstRecordIterator getRecordsEnd() const
Returns a constant iterator pointing one past the last stored record.
TypeToDataMap::value_type Record
The type of the stored record type and data pairs.
Definition: PDBData.hpp:293
bool removeRecord(const RecordType &type)
Removes the record of the given type.
RecordType
Specifies the type of a stored PDB data record.
Definition: PDBData.hpp:63
@ REVDAT
REVDAT record (revision history of the entry).
Definition: PDBData.hpp:118
@ OBSLTE
OBSLTE record (PDB IDs that have replaced this entry).
Definition: PDBData.hpp:73
@ TURN
TURN record (locations of short loop turns that connect standard secondary structure segments).
Definition: PDBData.hpp:198
@ SHEET
SHEET record (sheet secondary structure annotations).
Definition: PDBData.hpp:193
@ SITE
SITE record (specifies residues of an active or binding site).
Definition: PDBData.hpp:218
@ HELIX
HELIX record (helix secondary structure annotations).
Definition: PDBData.hpp:188
@ MTRIX3
MTRIX3 record (third row of a non-crystallographic symmetry transformation matrix).
Definition: PDBData.hpp:238
@ JRNL
JRNL record (literature citation associated with the entry).
Definition: PDBData.hpp:128
@ MTRIX1
MTRIX1 record (first row of a non-crystallographic symmetry transformation matrix).
Definition: PDBData.hpp:228
@ LINK
LINK record (bonds between residues that are not implied by the primary structure).
Definition: PDBData.hpp:208
@ ORIGX3
ORIGX3 record (third row of the orthogonal to submitted coordinates transformation).
Definition: PDBData.hpp:253
@ TITLE
TITLE record (title of the entry).
Definition: PDBData.hpp:78
@ CISPEP
CISPEP record (specifies prolines and other peptides found to be in the cis conformation).
Definition: PDBData.hpp:213
@ MTRIX2
MTRIX2 record (second row of a non-crystallographic symmetry transformation matrix).
Definition: PDBData.hpp:233
@ DBREF
DBREF record (cross-reference links between PDB sequences and a corresponding database sequence).
Definition: PDBData.hpp:138
@ SEQADV
SEQADV record (differences between sequence information in the SEQRES record and the sequence databas...
Definition: PDBData.hpp:153
@ AUTHOR
AUTHOR record (contains the names of the people responsible for the contents of the entry).
Definition: PDBData.hpp:113
@ SEQRES
SEQRES record (residue sequence of biopolymer chains).
Definition: PDBData.hpp:158
@ CAVEAT
CAVEAT record (warns of errors and unresolved issues of the entry).
Definition: PDBData.hpp:88
@ SSBOND
SSBOND record (identifies disulfide bonds in protein and polypeptide structures).
Definition: PDBData.hpp:203
@ SPRSDE
SPRSDE record (PDB IDs that this entry supersedes).
Definition: PDBData.hpp:123
@ STRUCTURE_ID
The 4 character PDB identifier extracted from the HEADER record.
Definition: PDBData.hpp:273
@ ORIGX2
ORIGX2 record (second row of the orthogonal to submitted coordinates transformation).
Definition: PDBData.hpp:248
@ DBREF2
DBREF2 record (second part of a two-line database cross-reference).
Definition: PDBData.hpp:148
@ SCALE1
SCALE1 record (first row of the orthogonal to fractional coordinates transformation).
Definition: PDBData.hpp:258
@ DEPOSITION_DATE
The deposition date extracted from the HEADER record.
Definition: PDBData.hpp:278
@ HETSYN
HETSYN record (synonyms for non-standard residues).
Definition: PDBData.hpp:183
@ ORIGX1
ORIGX1 record (first row of the orthogonal to submitted coordinates transformation).
Definition: PDBData.hpp:243
@ FORMUL
FORMUL record (chemical formula of non-standard residues).
Definition: PDBData.hpp:173
@ CRYST1
CRYST1 record (unit cell parameters, space group, and Z value).
Definition: PDBData.hpp:223
@ KEYWDS
KEYWDS record (a set of terms relevant to the entry).
Definition: PDBData.hpp:103
@ REMARK
REMARK record (experimental details, annotations, comments, and information not included in other rec...
Definition: PDBData.hpp:133
@ COMPND
COMPND record (description of the macromolecular contents).
Definition: PDBData.hpp:93
@ HEADER
HEADER record (structure classification, deposition date, PDB ID).
Definition: PDBData.hpp:68
@ EXPDTA
EXPDTA record (information about the experiment).
Definition: PDBData.hpp:108
@ SOURCE
SOURCE record (specifies the biological and/or chemical source of each biological molecule).
Definition: PDBData.hpp:98
@ SPLIT
SPLIT record (list of entries that together form the complete structure).
Definition: PDBData.hpp:83
@ HET
HET record (describes non-standard residues for which coordinates are supplied).
Definition: PDBData.hpp:168
@ SCALE3
SCALE3 record (third row of the orthogonal to fractional coordinates transformation).
Definition: PDBData.hpp:268
@ MODRES
MODRES record (descriptions of modifications to protein and nucleic acid residues).
Definition: PDBData.hpp:163
@ HETNAM
HETNAM record (chemical names of non-standard residues).
Definition: PDBData.hpp:178
@ SCALE2
SCALE2 record (second row of the orthogonal to fractional coordinates transformation).
Definition: PDBData.hpp:263
@ DBREF1
DBREF1 record (first part of a two-line database cross-reference).
Definition: PDBData.hpp:143
std::shared_ptr< PDBData > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated PDBData instances.
Definition: PDBData.hpp:57
void removeRecord(const RecordIterator &it)
Removes the record referenced by the given iterator.
std::size_t getNumRecords() const
Returns the number of stored records.
std::string & getData(const RecordType &type)
Returns the data string associated with the given record type.
PDBData()
Constructs an empty PDBData instance.
Definition: PDBData.hpp:308
RecordIterator begin()
Returns a mutable iterator pointing to the first stored record (range-based for support).
TypeToDataMap::iterator RecordIterator
A mutable iterator over the stored records.
Definition: PDBData.hpp:303
RecordIterator getRecordsBegin()
Returns a mutable iterator pointing to the first stored record.
RecordIterator end()
Returns a mutable iterator pointing one past the last stored record (range-based for support).
ConstRecordIterator getRecord(const RecordType &type) const
Returns a constant iterator to the record of the given type.
const std::string & getData(const RecordType &type) const
Returns the data string associated with the given record type.
bool isEmpty() const
Tells whether no records are stored.
RecordIterator setRecord(const Record &rec)
Stores the given record (any pre-existing record of the same type is replaced).
TypeToDataMap::const_iterator ConstRecordIterator
A constant iterator over the stored records.
Definition: PDBData.hpp:298
RecordIterator getRecordsEnd()
Returns a mutable iterator pointing one past the last stored record.
The namespace of the Chemical Data Processing Library.