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 
152  RESOLUTION
153  };
154 
155  private:
156  typedef std::map<RecordType, std::string> TypeToDataMap;
157 
158  public:
162  typedef typename TypeToDataMap::value_type Record;
163 
167  typedef typename TypeToDataMap::const_iterator ConstRecordIterator;
168 
172  typedef typename TypeToDataMap::iterator RecordIterator;
173 
178  data() {}
179 
184  PDBData(const PDBData& other):
185  data(other.data) {}
186 
190  void clear();
191 
196  std::size_t getNumRecords() const;
197 
202  bool isEmpty() const;
203 
209  bool containsRecord(const RecordType& type) const;
210 
218 
226 
233  std::string& getData(const RecordType& type);
234 
241  const std::string& getData(const RecordType& type) const;
242 
247  void removeRecord(const RecordIterator& it);
248 
254  bool removeRecord(const RecordType& type);
255 
262 
269  RecordIterator setRecord(const RecordType& type, const std::string& data);
270 
276 
282 
288 
294 
300 
306 
312 
318 
319  private:
320  TypeToDataMap data;
321  };
322  } // namespace Biomol
323 } // namespace CDPL
324 
325 #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 data records found in PDB formatted data [PDB].
Definition: PDBData.hpp:51
PDBData(const PDBData &other)
Constructs a copy of the PDBData instance other.
Definition: PDBData.hpp:184
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 a stored (record-type, record-data) pair.
Definition: PDBData.hpp:162
bool removeRecord(const RecordType &type)
Removes the record of the given type.
RecordType
Identifies the type of PDB data record.
Definition: PDBData.hpp:63
@ REVDAT
PDB REVDAT record (revision history of the entry).
Definition: PDBData.hpp:86
@ OBSLTE
PDB OBSLTE record (PDB IDs that have replaced this entry).
Definition: PDBData.hpp:68
@ TURN
PDB TURN record (turn secondary-structure annotations).
Definition: PDBData.hpp:118
@ SHEET
PDB SHEET record (sheet secondary-structure annotations).
Definition: PDBData.hpp:116
@ SITE
PDB SITE record (groups of residues describing an active or binding site).
Definition: PDBData.hpp:126
@ HELIX
PDB HELIX record (helix secondary-structure annotations).
Definition: PDBData.hpp:114
@ MTRIX3
PDB MTRIX3 record (third row of a non-crystallographic-symmetry transformation matrix).
Definition: PDBData.hpp:134
@ JRNL
PDB JRNL record (literature citation associated with the entry).
Definition: PDBData.hpp:90
@ MTRIX1
PDB MTRIX1 record (first row of a non-crystallographic-symmetry transformation matrix).
Definition: PDBData.hpp:130
@ LINK
PDB LINK record (covalent links between non-standard residues).
Definition: PDBData.hpp:122
@ ORIGX3
PDB ORIGX3 record (third row of the orthogonal-to-submitted-coordinates transformation).
Definition: PDBData.hpp:140
@ TITLE
PDB TITLE record (title of the entry).
Definition: PDBData.hpp:70
@ CISPEP
PDB CISPEP record (cis peptide bond annotations).
Definition: PDBData.hpp:124
@ MTRIX2
PDB MTRIX2 record (second row of a non-crystallographic-symmetry transformation matrix).
Definition: PDBData.hpp:132
@ DBREF
PDB DBREF record (cross-references to external sequence databases).
Definition: PDBData.hpp:94
@ SEQADV
PDB SEQADV record (sequence differences relative to the reference database).
Definition: PDBData.hpp:100
@ AUTHOR
PDB AUTHOR record (authors of the entry).
Definition: PDBData.hpp:84
@ SEQRES
PDB SEQRES record (residue sequence of biopolymer chains).
Definition: PDBData.hpp:102
@ CAVEAT
PDB CAVEAT record (caveats about the structure).
Definition: PDBData.hpp:74
@ SSBOND
PDB SSBOND record (disulfide bond annotations).
Definition: PDBData.hpp:120
@ SPRSDE
PDB SPRSDE record (PDB IDs that this entry supersedes).
Definition: PDBData.hpp:88
@ STRUCTURE_ID
Derived: the 4-character PDB identifier extracted from the HEADER record.
Definition: PDBData.hpp:148
@ ORIGX2
PDB ORIGX2 record (second row of the orthogonal-to-submitted-coordinates transformation).
Definition: PDBData.hpp:138
@ DBREF2
PDB DBREF2 record (second part of a two-line database cross-reference).
Definition: PDBData.hpp:98
@ SCALE1
PDB SCALE1 record (first row of the orthogonal-to-fractional-coordinates transformation).
Definition: PDBData.hpp:142
@ DEPOSITION_DATE
Derived: the deposition date extracted from the HEADER record.
Definition: PDBData.hpp:150
@ HETSYN
PDB HETSYN record (synonyms for non-standard residues).
Definition: PDBData.hpp:112
@ ORIGX1
PDB ORIGX1 record (first row of the orthogonal-to-submitted-coordinates transformation).
Definition: PDBData.hpp:136
@ FORMUL
PDB FORMUL record (chemical formula of non-standard residues).
Definition: PDBData.hpp:108
@ CRYST1
PDB CRYST1 record (unit cell parameters and space group).
Definition: PDBData.hpp:128
@ KEYWDS
PDB KEYWDS record (keywords describing the entry).
Definition: PDBData.hpp:80
@ REMARK
PDB REMARK record (free-text annotations).
Definition: PDBData.hpp:92
@ COMPND
PDB COMPND record (description of macromolecular contents).
Definition: PDBData.hpp:76
@ HEADER
PDB HEADER record (structure classification, deposition date, PDB ID).
Definition: PDBData.hpp:66
@ EXPDTA
PDB EXPDTA record (experimental technique).
Definition: PDBData.hpp:82
@ SOURCE
PDB SOURCE record (source organism information).
Definition: PDBData.hpp:78
@ SPLIT
PDB SPLIT record (list of entries that together form the complete structure).
Definition: PDBData.hpp:72
@ HET
PDB HET record (non-standard residue identification).
Definition: PDBData.hpp:106
@ SCALE3
PDB SCALE3 record (third row of the orthogonal-to-fractional-coordinates transformation).
Definition: PDBData.hpp:146
@ MODRES
PDB MODRES record (modified residues).
Definition: PDBData.hpp:104
@ HETNAM
PDB HETNAM record (chemical name of non-standard residues).
Definition: PDBData.hpp:110
@ SCALE2
PDB SCALE2 record (second row of the orthogonal-to-fractional-coordinates transformation).
Definition: PDBData.hpp:144
@ DBREF1
PDB DBREF1 record (first part of a two-line database cross-reference).
Definition: PDBData.hpp:96
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:177
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:172
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:167
RecordIterator getRecordsEnd()
Returns a mutable iterator pointing one past the last stored record.
The namespace of the Chemical Data Processing Library.