Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | List of all members
CDPL::Biomol::PDBData Class Reference

Data structure for the storage of data records found in PDB formatted data [PDB]. More...

#include <PDBData.hpp>

Public Types

enum  RecordType {
  HEADER ,
  OBSLTE ,
  TITLE ,
  SPLIT ,
  CAVEAT ,
  COMPND ,
  SOURCE ,
  KEYWDS ,
  EXPDTA ,
  AUTHOR ,
  REVDAT ,
  SPRSDE ,
  JRNL ,
  REMARK ,
  DBREF ,
  DBREF1 ,
  DBREF2 ,
  SEQADV ,
  SEQRES ,
  MODRES ,
  HET ,
  FORMUL ,
  HETNAM ,
  HETSYN ,
  HELIX ,
  SHEET ,
  TURN ,
  SSBOND ,
  LINK ,
  CISPEP ,
  SITE ,
  CRYST1 ,
  MTRIX1 ,
  MTRIX2 ,
  MTRIX3 ,
  ORIGX1 ,
  ORIGX2 ,
  ORIGX3 ,
  SCALE1 ,
  SCALE2 ,
  SCALE3 ,
  STRUCTURE_ID ,
  DEPOSITION_DATE ,
  RESOLUTION
}
 Identifies the type of PDB data record. More...
 
typedef std::shared_ptr< PDBDataSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated PDBData instances. More...
 
typedef TypeToDataMap::value_type Record
 The type of a stored (record-type, record-data) pair. More...
 
typedef TypeToDataMap::const_iterator ConstRecordIterator
 A constant iterator over the stored records. More...
 
typedef TypeToDataMap::iterator RecordIterator
 A mutable iterator over the stored records. More...
 

Public Member Functions

 PDBData ()
 Constructs an empty PDBData instance. More...
 
 PDBData (const PDBData &other)
 Constructs a copy of the PDBData instance other. More...
 
void clear ()
 Removes all stored records. More...
 
std::size_t getNumRecords () const
 Returns the number of stored records. More...
 
bool isEmpty () const
 Tells whether no records are stored. More...
 
bool containsRecord (const RecordType &type) const
 Tells whether a record of the given type is stored. More...
 
RecordIterator getRecord (const RecordType &type)
 Returns an iterator to the record of the given type. More...
 
ConstRecordIterator getRecord (const RecordType &type) const
 Returns a constant iterator to the record of the given type. More...
 
std::string & getData (const RecordType &type)
 Returns the data string associated with the given record type. More...
 
const std::string & getData (const RecordType &type) const
 Returns the data string associated with the given record type. More...
 
void removeRecord (const RecordIterator &it)
 Removes the record referenced by the given iterator. More...
 
bool removeRecord (const RecordType &type)
 Removes the record of the given type. More...
 
RecordIterator setRecord (const Record &rec)
 Stores the given record. Any pre-existing record of the same type is replaced. More...
 
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. More...
 
ConstRecordIterator getRecordsBegin () const
 Returns a constant iterator pointing to the first stored record. More...
 
RecordIterator getRecordsBegin ()
 Returns a mutable iterator pointing to the first stored record. More...
 
ConstRecordIterator getRecordsEnd () const
 Returns a constant iterator pointing one past the last stored record. More...
 
RecordIterator getRecordsEnd ()
 Returns a mutable iterator pointing one past the last stored record. More...
 
ConstRecordIterator begin () const
 Returns a constant iterator pointing to the first stored record (range-based for support). More...
 
RecordIterator begin ()
 Returns a mutable iterator pointing to the first stored record (range-based for support). More...
 
ConstRecordIterator end () const
 Returns a constant iterator pointing one past the last stored record (range-based for support). More...
 
RecordIterator end ()
 Returns a mutable iterator pointing one past the last stored record (range-based for support). More...
 

Detailed Description

Data structure for the storage of data records found in PDB formatted data [PDB].

Member Typedef Documentation

◆ SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated PDBData instances.

◆ Record

typedef TypeToDataMap::value_type CDPL::Biomol::PDBData::Record

The type of a stored (record-type, record-data) pair.

◆ ConstRecordIterator

typedef TypeToDataMap::const_iterator CDPL::Biomol::PDBData::ConstRecordIterator

A constant iterator over the stored records.

◆ RecordIterator

typedef TypeToDataMap::iterator CDPL::Biomol::PDBData::RecordIterator

A mutable iterator over the stored records.

Member Enumeration Documentation

◆ RecordType

Identifies the type of PDB data record.

Enumerator
HEADER 

PDB HEADER record (structure classification, deposition date, PDB ID).

OBSLTE 

PDB OBSLTE record (PDB IDs that have replaced this entry).

TITLE 

PDB TITLE record (title of the entry).

SPLIT 

PDB SPLIT record (list of entries that together form the complete structure).

CAVEAT 

PDB CAVEAT record (caveats about the structure).

COMPND 

PDB COMPND record (description of macromolecular contents).

SOURCE 

PDB SOURCE record (source organism information).

KEYWDS 

PDB KEYWDS record (keywords describing the entry).

EXPDTA 

PDB EXPDTA record (experimental technique).

AUTHOR 

PDB AUTHOR record (authors of the entry).

REVDAT 

PDB REVDAT record (revision history of the entry).

SPRSDE 

PDB SPRSDE record (PDB IDs that this entry supersedes).

JRNL 

PDB JRNL record (literature citation associated with the entry).

REMARK 

PDB REMARK record (free-text annotations).

DBREF 

PDB DBREF record (cross-references to external sequence databases).

DBREF1 

PDB DBREF1 record (first part of a two-line database cross-reference).

DBREF2 

PDB DBREF2 record (second part of a two-line database cross-reference).

SEQADV 

PDB SEQADV record (sequence differences relative to the reference database).

SEQRES 

PDB SEQRES record (residue sequence of biopolymer chains).

MODRES 

PDB MODRES record (modified residues).

HET 

PDB HET record (non-standard residue identification).

FORMUL 

PDB FORMUL record (chemical formula of non-standard residues).

HETNAM 

PDB HETNAM record (chemical name of non-standard residues).

HETSYN 

PDB HETSYN record (synonyms for non-standard residues).

HELIX 

PDB HELIX record (helix secondary-structure annotations).

SHEET 

PDB SHEET record (sheet secondary-structure annotations).

TURN 

PDB TURN record (turn secondary-structure annotations).

SSBOND 

PDB SSBOND record (disulfide bond annotations).

LINK 

PDB LINK record (covalent links between non-standard residues).

CISPEP 

PDB CISPEP record (cis peptide bond annotations).

SITE 

PDB SITE record (groups of residues describing an active or binding site).

CRYST1 

PDB CRYST1 record (unit cell parameters and space group).

MTRIX1 

PDB MTRIX1 record (first row of a non-crystallographic-symmetry transformation matrix).

MTRIX2 

PDB MTRIX2 record (second row of a non-crystallographic-symmetry transformation matrix).

MTRIX3 

PDB MTRIX3 record (third row of a non-crystallographic-symmetry transformation matrix).

ORIGX1 

PDB ORIGX1 record (first row of the orthogonal-to-submitted-coordinates transformation).

ORIGX2 

PDB ORIGX2 record (second row of the orthogonal-to-submitted-coordinates transformation).

ORIGX3 

PDB ORIGX3 record (third row of the orthogonal-to-submitted-coordinates transformation).

SCALE1 

PDB SCALE1 record (first row of the orthogonal-to-fractional-coordinates transformation).

SCALE2 

PDB SCALE2 record (second row of the orthogonal-to-fractional-coordinates transformation).

SCALE3 

PDB SCALE3 record (third row of the orthogonal-to-fractional-coordinates transformation).

STRUCTURE_ID 

Derived: the 4-character PDB identifier extracted from the HEADER record.

DEPOSITION_DATE 

Derived: the deposition date extracted from the HEADER record.

RESOLUTION 

Derived: the experimental resolution extracted from REMARK records.

Constructor & Destructor Documentation

◆ PDBData() [1/2]

CDPL::Biomol::PDBData::PDBData ( )
inline

Constructs an empty PDBData instance.

◆ PDBData() [2/2]

CDPL::Biomol::PDBData::PDBData ( const PDBData other)
inline

Constructs a copy of the PDBData instance other.

Parameters
otherThe PDBData to copy.

Member Function Documentation

◆ clear()

void CDPL::Biomol::PDBData::clear ( )

Removes all stored records.

◆ getNumRecords()

std::size_t CDPL::Biomol::PDBData::getNumRecords ( ) const

Returns the number of stored records.

Returns
The number of records.

◆ isEmpty()

bool CDPL::Biomol::PDBData::isEmpty ( ) const

Tells whether no records are stored.

Returns
true if no records are stored, and false otherwise.

◆ containsRecord()

bool CDPL::Biomol::PDBData::containsRecord ( const RecordType type) const

Tells whether a record of the given type is stored.

Parameters
typeThe queried record type.
Returns
true if a record of the given type is stored, and false otherwise.

◆ getRecord() [1/2]

RecordIterator CDPL::Biomol::PDBData::getRecord ( const RecordType type)

Returns an iterator to the record of the given type.

Parameters
typeThe record type to look up.
Returns
An iterator pointing to the matching record, or to getRecordsEnd() if no matching record exists.

◆ getRecord() [2/2]

ConstRecordIterator CDPL::Biomol::PDBData::getRecord ( const RecordType type) const

Returns a constant iterator to the record of the given type.

Parameters
typeThe record type to look up.
Returns
A constant iterator pointing to the matching record, or to getRecordsEnd() if no matching record exists.

◆ getData() [1/2]

std::string& CDPL::Biomol::PDBData::getData ( const RecordType type)

Returns the data string associated with the given record type.

Parameters
typeThe record type whose data is requested.
Returns
A reference to the data string.
Exceptions
Base::ItemNotFoundif no record of the given type is stored.

◆ getData() [2/2]

const std::string& CDPL::Biomol::PDBData::getData ( const RecordType type) const

Returns the data string associated with the given record type.

Parameters
typeThe record type whose data is requested.
Returns
A const reference to the data string.
Exceptions
Base::ItemNotFoundif no record of the given type is stored.

◆ removeRecord() [1/2]

void CDPL::Biomol::PDBData::removeRecord ( const RecordIterator it)

Removes the record referenced by the given iterator.

Parameters
itIterator referencing the record to remove.

◆ removeRecord() [2/2]

bool CDPL::Biomol::PDBData::removeRecord ( const RecordType type)

Removes the record of the given type.

Parameters
typeThe type of the record to remove.
Returns
true if the record was removed, and false if no matching record existed.

◆ setRecord() [1/2]

RecordIterator CDPL::Biomol::PDBData::setRecord ( const Record rec)

Stores the given record. Any pre-existing record of the same type is replaced.

Parameters
recThe record to store.
Returns
An iterator referencing the stored record.

◆ setRecord() [2/2]

RecordIterator CDPL::Biomol::PDBData::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.

Parameters
typeThe record type.
dataThe record data string.
Returns
An iterator referencing the stored record.

◆ getRecordsBegin() [1/2]

ConstRecordIterator CDPL::Biomol::PDBData::getRecordsBegin ( ) const

Returns a constant iterator pointing to the first stored record.

Returns
A constant iterator pointing to the first record.

◆ getRecordsBegin() [2/2]

RecordIterator CDPL::Biomol::PDBData::getRecordsBegin ( )

Returns a mutable iterator pointing to the first stored record.

Returns
A mutable iterator pointing to the first record.

◆ getRecordsEnd() [1/2]

ConstRecordIterator CDPL::Biomol::PDBData::getRecordsEnd ( ) const

Returns a constant iterator pointing one past the last stored record.

Returns
A constant iterator pointing one past the last record.

◆ getRecordsEnd() [2/2]

RecordIterator CDPL::Biomol::PDBData::getRecordsEnd ( )

Returns a mutable iterator pointing one past the last stored record.

Returns
A mutable iterator pointing one past the last record.

◆ begin() [1/2]

ConstRecordIterator CDPL::Biomol::PDBData::begin ( ) const

Returns a constant iterator pointing to the first stored record (range-based for support).

Returns
A constant iterator pointing to the first record.

◆ begin() [2/2]

RecordIterator CDPL::Biomol::PDBData::begin ( )

Returns a mutable iterator pointing to the first stored record (range-based for support).

Returns
A mutable iterator pointing to the first record.

◆ end() [1/2]

ConstRecordIterator CDPL::Biomol::PDBData::end ( ) const

Returns a constant iterator pointing one past the last stored record (range-based for support).

Returns
A constant iterator pointing one past the last record.

◆ end() [2/2]

RecordIterator CDPL::Biomol::PDBData::end ( )

Returns a mutable iterator pointing one past the last stored record (range-based for support).

Returns
A mutable iterator pointing one past the last record.

The documentation for this class was generated from the following file: