All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | Friends | List of all members
PLMD::PDB Class Reference

Minimalistic pdb parser. More...

#include <PDB.h>

Public Member Functions

bool read (const std::string &file, bool naturalUnits, double scale)
 Read the pdb from a file, scaling positions by a factor scale. More...
 
bool readFromFilepointer (FILE *fp, bool naturalUnits, double scale)
 Read from a file pointer. More...
 
const std::vector< Vector > & getPositions () const
 Access to the position array. More...
 
const std::vector< double > & getOccupancy () const
 Access to the occupancy array. More...
 
const std::vector< double > & getBeta () const
 Access to the beta array. More...
 
void setArgKeyword (const std::string &new_args)
 This is used to set the keyword ARG - this is so we we can use a1. More...
 
const std::vector< std::string > & getRemark () const
 Access to the lines of REMARK. More...
 
const std::vector< AtomNumber > & getAtomNumbers () const
 Access to the indexes. More...
 
unsigned size () const
 Returns the number of atoms. More...
 
void getChainNames (std::vector< std::string > &chains) const
 Get the names of all the chains in the pdb file. More...
 
void getResidueRange (const std::string &chainname, unsigned &res_start, unsigned &res_end, std::string &errmsg) const
 Get the residues in each of the chains. More...
 
void getAtomRange (const std::string &chainname, AtomNumber &a_start, AtomNumber &a_end, std::string &errmsg) const
 Get the atoms in each of the chains. More...
 
bool getBackbone (const unsigned &resnumber, const std::vector< std::string > &backnames, std::vector< AtomNumber > &backnumbers) const
 Get the atoms in the backbone of a particular residue. More...
 
std::string getChainID (const unsigned &resnumber) const
 Get the chain ID that a particular residue is a part of. More...
 
void renameAtoms (const std::string &old_name, const std::string &new_name)
 This allows you to give atoms a new name - this is used to rename the HB1 atoms in GLY residues CB so that alpharmsd works. More...
 
std::string getAtomName (AtomNumber a) const
 return the name of a specific atom More...
 
unsigned getResidueNumber (AtomNumber a) const
 return the residue number for a specific atom More...
 
std::string getResidueName (AtomNumber a) const
 return the residue name for a specific atom More...
 

Private Attributes

std::vector< std::string > atomsymb
 
std::vector< std::string > chain
 
std::vector< unsigned > residue
 
std::vector< Vectorpositions
 
std::vector< double > occupancy
 
std::vector< double > beta
 
std::vector< std::string > remark
 
std::vector< AtomNumbernumbers
 
std::map< AtomNumber, unsigned > number2index
 
std::vector< std::string > residuenames
 

Friends

Logoperator<< (Log &ostr, const PDB &pdb)
 use the log to dump information More...
 

Detailed Description

Minimalistic pdb parser.

Contain positions, atomic indexes, occupancy and beta. We should also add other info (e.g. residue name etc).

Definition at line 38 of file PDB.h.

Member Function Documentation

std::string PLMD::PDB::getAtomName ( AtomNumber  a) const

return the name of a specific atom

Definition at line 51 of file PDB.cpp.

const std::vector< AtomNumber > & PLMD::PDB::getAtomNumbers ( ) const

Access to the indexes.

Definition at line 47 of file PDB.cpp.

void PLMD::PDB::getAtomRange ( const std::string &  chainname,
AtomNumber a_start,
AtomNumber a_end,
std::string &  errmsg 
) const

Get the atoms in each of the chains.

Definition at line 177 of file PDB.cpp.

bool PLMD::PDB::getBackbone ( const unsigned &  resnumber,
const std::vector< std::string > &  backnames,
std::vector< AtomNumber > &  backnumbers 
) const

Get the atoms in the backbone of a particular residue.

Definition at line 194 of file PDB.cpp.

const std::vector< double > & PLMD::PDB::getBeta ( ) const

Access to the beta array.

Definition at line 39 of file PDB.cpp.

std::string PLMD::PDB::getChainID ( const unsigned &  resnumber) const

Get the chain ID that a particular residue is a part of.

Definition at line 212 of file PDB.cpp.

void PLMD::PDB::getChainNames ( std::vector< std::string > &  chains) const

Get the names of all the chains in the pdb file.

Definition at line 152 of file PDB.cpp.

const std::vector< double > & PLMD::PDB::getOccupancy ( ) const

Access to the occupancy array.

Definition at line 35 of file PDB.cpp.

const std::vector< Vector > & PLMD::PDB::getPositions ( ) const

Access to the position array.

Definition at line 31 of file PDB.cpp.

const std::vector< std::string > & PLMD::PDB::getRemark ( ) const

Access to the lines of REMARK.

Definition at line 43 of file PDB.cpp.

std::string PLMD::PDB::getResidueName ( AtomNumber  a) const

return the residue name for a specific atom

Definition at line 65 of file PDB.cpp.

unsigned PLMD::PDB::getResidueNumber ( AtomNumber  a) const

return the residue number for a specific atom

Definition at line 58 of file PDB.cpp.

void PLMD::PDB::getResidueRange ( const std::string &  chainname,
unsigned &  res_start,
unsigned &  res_end,
std::string &  errmsg 
) const

Get the residues in each of the chains.

Definition at line 160 of file PDB.cpp.

bool PLMD::PDB::read ( const std::string &  file,
bool  naturalUnits,
double  scale 
)

Read the pdb from a file, scaling positions by a factor scale.

Definition at line 144 of file PDB.cpp.

bool PLMD::PDB::readFromFilepointer ( FILE *  fp,
bool  naturalUnits,
double  scale 
)

Read from a file pointer.

Definition at line 76 of file PDB.cpp.

void PLMD::PDB::renameAtoms ( const std::string &  old_name,
const std::string &  new_name 
)

This allows you to give atoms a new name - this is used to rename the HB1 atoms in GLY residues CB so that alpharmsd works.

Definition at line 219 of file PDB.cpp.

void PLMD::PDB::setArgKeyword ( const std::string &  new_args)

This is used to set the keyword ARG - this is so we we can use a1.

  • in the input for reference configurations

Definition at line 134 of file PDB.cpp.

unsigned PLMD::PDB::size ( ) const

Returns the number of atoms.

Definition at line 72 of file PDB.cpp.

Friends And Related Function Documentation

Log& operator<< ( Log ostr,
const PDB pdb 
)
friend

use the log to dump information

Definition at line 225 of file PDB.cpp.

Member Data Documentation

std::vector<std::string> PLMD::PDB::atomsymb
private

Definition at line 39 of file PDB.h.

std::vector<double> PLMD::PDB::beta
private

Definition at line 43 of file PDB.h.

std::vector<std::string> PLMD::PDB::chain
private

Definition at line 39 of file PDB.h.

std::map<AtomNumber,unsigned> PLMD::PDB::number2index
private

Definition at line 46 of file PDB.h.

std::vector<AtomNumber> PLMD::PDB::numbers
private

Definition at line 45 of file PDB.h.

std::vector<double> PLMD::PDB::occupancy
private

Definition at line 42 of file PDB.h.

std::vector<Vector> PLMD::PDB::positions
private

Definition at line 41 of file PDB.h.

std::vector<std::string> PLMD::PDB::remark
private

Definition at line 44 of file PDB.h.

std::vector<unsigned> PLMD::PDB::residue
private

Definition at line 40 of file PDB.h.

std::vector<std::string> PLMD::PDB::residuenames
private

Definition at line 47 of file PDB.h.


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