Public Member Functions | Private Attributes | Friends | List of all members
PLMD::PDB Class Reference

Minimalistic pdb parser. More...

#include <PDB.h>

Public Member Functions

void addBlockEnd (const unsigned &end)
 Check if the properties that are required are in this pdb this is used in PLMD::mapping::Mapping. More...
 
void addRemark (std::vector< std::string > &v1)
 Add data to argnames map. More...
 
bool checkForAtom (AtomNumber a) const
 Check if specific atom exists. More...
 
bool checkForAtom (const std::string &name) const
 Check if any of the atoms are named atom. More...
 
bool checkForResidue (const std::string &name) const
 Check if any of the residues are named name. More...
 
std::vector< std::string > getArgumentNames () const
 
bool getArgumentValue (const std::string &name, double &value) const
 Get the value of one of the arguments in the PDB file. More...
 
const std::vector< unsigned > & getAtomBlockEnds () const
 Get the extents of the blocks containing the atoms. More...
 
std::string getAtomName (AtomNumber a) const
 return the name of a specific atom More...
 
const std::vector< AtomNumber > & getAtomNumbers () const
 Access to the indexes. 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...
 
std::vector< AtomNumbergetAtomsInChain (const std::string &chainid) const
 Access to the atoms of a chain. More...
 
std::vector< AtomNumbergetAtomsInResidue (const unsigned &resnum, const std::string &chainid) const
 Access to the atoms of a residue. More...
 
const std::vector< double > & getBeta () const
 Access to the beta array. More...
 
const VectorgetBoxAng () const
 Returns box axis angles. More...
 
const VectorgetBoxAxs () const
 Returns box axis lengths. More...
 
const TensorgetBoxVec () const
 Returns box axis vectors. More...
 
std::string getChainID (AtomNumber a) const
 Get the chain ID from atom number. More...
 
std::string getChainID (const unsigned &resnumber) const
 Get the chain ID that a particular residue is a part of. More...
 
void getChainNames (std::vector< std::string > &chains) const
 Get the names of all the chains in the pdb file. More...
 
std::string getMtype () const
 Get the metric type. More...
 
AtomNumber getNamedAtomFromResidue (const std::string &aname, const unsigned &resnum) const
 Return the atom named aname from residue number resnum. More...
 
AtomNumber getNamedAtomFromResidueAndChain (const std::string &aname, const unsigned &resnum, const std::string &chain) const
 Return the atom named aname from residue number resnum and chain. More...
 
unsigned getNumberOfAtomBlocks () const
 Get the number of blocks of atoms in the pdb. More...
 
const std::vector< double > & getOccupancy () const
 Access to the occupancy array. More...
 
Vector getPosition (AtomNumber a) const
 Access to the position array. More...
 
const std::vector< Vector > & getPositions () const
 Access to the position array. More...
 
std::string getResidueName (AtomNumber a) const
 return the residue name for a specific atom More...
 
std::string getResidueName (const unsigned &resnum) const
 get the name of the resnum'th residue More...
 
std::string getResidueName (const unsigned &resnum, const std::string &chain) const
 get the name of the resnum'th residue of chain Chain=="*" matches any chain and makes it equivalent to getResidueName More...
 
unsigned getResidueNumber (AtomNumber a) const
 return the residue number for a specific atom 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...
 
bool hasFlag (const std::string &fname) const
 Does the PDB have this flag. More...
 
void print (const double &lunits, GenericMolInfo *mymoldat, OFile &ofile, const std::string &fmt)
 Print out a PDB object. More...
 
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...
 
void setArgumentNames (const std::vector< std::string > &argument_names)
 Set the argument names that you would like to use. More...
 
void setArgumentValue (const std::string &argname, const double &val)
 This is used in PLMD::analysis::AnalysisWithDataCollection to set the argument values. More...
 
void setAtomNumbers (const std::vector< AtomNumber > &atoms)
 This is used in PLMD::analysis::AnalysisWithDataCollection to add the numbers of the atoms. More...
 
void setAtomPositions (const std::vector< Vector > &pos)
 This is used in PLMD::analysis::AnalysisWithDataCollection to set the atom positions. More...
 
void setPositions (const std::vector< Vector > &v)
 Set the position array. More...
 
unsigned size () const
 Returns the number of atoms. More...
 

Private Attributes

std::map< std::string, double > arg_data
 
std::vector< std::string > argnames
 
std::vector< std::string > atomsymb
 
std::vector< double > beta
 
std::vector< unsigned > block_ends
 
Tensor Box
 
Vector BoxABG
 
Vector BoxXYZ
 
std::vector< std::string > chain
 
std::vector< std::string > flags
 
std::string mtype
 
std::map< AtomNumber, unsigned > number2index
 
std::vector< AtomNumbernumbers
 
std::vector< double > occupancy
 
std::vector< Vectorpositions
 
std::vector< unsigned > residue
 
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).

Member Function Documentation

◆ addBlockEnd()

void PLMD::PDB::addBlockEnd ( const unsigned &  end)

Check if the properties that are required are in this pdb this is used in PLMD::mapping::Mapping.

This is used in PLMD::analysis::AnalysisWithDataCollection to add the sizes of the domains for PLMD::MultiRMSD

◆ addRemark()

void PLMD::PDB::addRemark ( std::vector< std::string > &  v1)

Add data to argnames map.

◆ checkForAtom() [1/2]

bool PLMD::PDB::checkForAtom ( AtomNumber  a) const

Check if specific atom exists.

◆ checkForAtom() [2/2]

bool PLMD::PDB::checkForAtom ( const std::string &  name) const

Check if any of the atoms are named atom.

◆ checkForResidue()

bool PLMD::PDB::checkForResidue ( const std::string &  name) const

Check if any of the residues are named name.

◆ getArgumentNames()

std::vector< std::string > PLMD::PDB::getArgumentNames ( ) const

◆ getArgumentValue()

bool PLMD::PDB::getArgumentValue ( const std::string &  name,
double &  value 
) const

Get the value of one of the arguments in the PDB file.

◆ getAtomBlockEnds()

const std::vector< unsigned > & PLMD::PDB::getAtomBlockEnds ( ) const

Get the extents of the blocks containing the atoms.

◆ getAtomName()

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

return the name of a specific atom

◆ getAtomNumbers()

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

Access to the indexes.

◆ getAtomRange()

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.

◆ getAtomsInChain()

std::vector< AtomNumber > PLMD::PDB::getAtomsInChain ( const std::string &  chainid) const

Access to the atoms of a chain.

◆ getAtomsInResidue()

std::vector< AtomNumber > PLMD::PDB::getAtomsInResidue ( const unsigned &  resnum,
const std::string &  chainid 
) const

Access to the atoms of a residue.

◆ getBeta()

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

Access to the beta array.

◆ getBoxAng()

const Vector & PLMD::PDB::getBoxAng ( ) const

Returns box axis angles.

◆ getBoxAxs()

const Vector & PLMD::PDB::getBoxAxs ( ) const

Returns box axis lengths.

◆ getBoxVec()

const Tensor & PLMD::PDB::getBoxVec ( ) const

Returns box axis vectors.

◆ getChainID() [1/2]

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

Get the chain ID from atom number.

◆ getChainID() [2/2]

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

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

◆ getChainNames()

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

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

◆ getMtype()

std::string PLMD::PDB::getMtype ( ) const

Get the metric type.

◆ getNamedAtomFromResidue()

AtomNumber PLMD::PDB::getNamedAtomFromResidue ( const std::string &  aname,
const unsigned &  resnum 
) const

Return the atom named aname from residue number resnum.

◆ getNamedAtomFromResidueAndChain()

AtomNumber PLMD::PDB::getNamedAtomFromResidueAndChain ( const std::string &  aname,
const unsigned &  resnum,
const std::string &  chain 
) const

Return the atom named aname from residue number resnum and chain.

Chain=="*" matches any chain and makes it equivalent to getNamedAtomFromResidue.

◆ getNumberOfAtomBlocks()

unsigned PLMD::PDB::getNumberOfAtomBlocks ( ) const

Get the number of blocks of atoms in the pdb.

◆ getOccupancy()

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

Access to the occupancy array.

◆ getPosition()

Vector PLMD::PDB::getPosition ( AtomNumber  a) const

Access to the position array.

◆ getPositions()

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

Access to the position array.

◆ getResidueName() [1/3]

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

return the residue name for a specific atom

◆ getResidueName() [2/3]

std::string PLMD::PDB::getResidueName ( const unsigned &  resnum) const

get the name of the resnum'th residue

◆ getResidueName() [3/3]

std::string PLMD::PDB::getResidueName ( const unsigned &  resnum,
const std::string &  chain 
) const

get the name of the resnum'th residue of chain Chain=="*" matches any chain and makes it equivalent to getResidueName

◆ getResidueNumber()

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

return the residue number for a specific atom

◆ getResidueRange()

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.

◆ hasFlag()

bool PLMD::PDB::hasFlag ( const std::string &  fname) const

Does the PDB have this flag.

◆ print()

void PLMD::PDB::print ( const double &  lunits,
GenericMolInfo mymoldat,
OFile ofile,
const std::string &  fmt 
)

Print out a PDB object.

◆ read()

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

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

◆ readFromFilepointer()

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

Read from a file pointer.

◆ setArgumentNames()

void PLMD::PDB::setArgumentNames ( const std::vector< std::string > &  argument_names)

Set the argument names that you would like to use.

◆ setArgumentValue()

void PLMD::PDB::setArgumentValue ( const std::string &  argname,
const double &  val 
)

This is used in PLMD::analysis::AnalysisWithDataCollection to set the argument values.

◆ setAtomNumbers()

void PLMD::PDB::setAtomNumbers ( const std::vector< AtomNumber > &  atoms)

This is used in PLMD::analysis::AnalysisWithDataCollection to add the numbers of the atoms.

◆ setAtomPositions()

void PLMD::PDB::setAtomPositions ( const std::vector< Vector > &  pos)

This is used in PLMD::analysis::AnalysisWithDataCollection to set the atom positions.

◆ setPositions()

void PLMD::PDB::setPositions ( const std::vector< Vector > &  v)

Set the position array.

◆ size()

unsigned PLMD::PDB::size ( ) const

Returns the number of atoms.

Friends And Related Function Documentation

◆ operator<<

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

use the log to dump information

Member Data Documentation

◆ arg_data

std::map<std::string,double> PLMD::PDB::arg_data
private

◆ argnames

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

◆ atomsymb

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

◆ beta

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

◆ block_ends

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

◆ Box

Tensor PLMD::PDB::Box
private

◆ BoxABG

Vector PLMD::PDB::BoxABG
private

◆ BoxXYZ

Vector PLMD::PDB::BoxXYZ
private

◆ chain

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

◆ flags

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

◆ mtype

std::string PLMD::PDB::mtype
private

◆ number2index

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

◆ numbers

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

◆ occupancy

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

◆ positions

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

◆ residue

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

◆ residuenames

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

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