PDB

The PDB class defines a set of tools used for reading the Protein Data Bank file format, used to describe molecular structures, like proteins, drugs and Nucleic Acids

[ GAMB | Source | Keywords | Summary | Ancestors | All Members | Descendants ]

Quick Index

AUTHORS
CHANGES LOG
GOALS
USAGE

Class Summary

class PDB
{
public:
// PDB record type determination methods.
static bool isATOMrec(const char *const PDBrec);
static bool isHETATMrec(const char *const PDBrec);
static bool isCaATOMrec(const char *const PDBrec);
static bool isNucleicRecord(const char *const PDBrec);
static bool isNucleicAcid(const char *const residueName);
static bool isCONECTrec(const char *const PDBrec);
// ATOM record costants and methods.
static float atomXCoord(const char *const PDBrec);
static float atomYCoord(const char *const PDBrec);
static float atomZCoord(const char *const PDBrec);
static int atomIndex(const char *const PDBrec);
static const char* atomType(const char *const PDBrec);
static char atomAltLocIndicator(const char *const PDBrec);
static char atomChainId(const char *const PDBrec);
static short atomResidueIndex(const char *const PDBrec);
static char atomResidueICode(const char *const PDBrec);
static char atomResidueType(const char *const PDBrec);
static const char* const residueLongName(const char resChar);
static string const nucleicAcidLongName(const char resChar);
static const char* getAtomResidueLongName(const char *const PDBrec);
static AtomEntryType getAtomEntryType(const char *const PDBrec);
static float getOccupancy(const char *const PDBrec);
static float getTempFactor(const char *const PDBrec);
static char residueShortName(const char *const resName);
static vector< unsigned short> connectedAtoms(const char *const PDBrec);
class Selector ;
class CAlphaSelector ;
class CBetaSelector;
class CSelector;
class NSelector;
class AllSelector ;
class ChainSelector ;
class WaterSelector ;
class HydrogenSelector ;
class WaterHydrogenUnSelector ;
class WaterUnSelector ;
class PSelector ;
class NucleicSelector ;
class IgnoreAlternativesSelector ;
protected:
}; // PDB

Back to the top of PDB


AUTHORS

Meir Fuchs. (meirfux@math.tau.ac.il)

Copyright: SAMBA group, Tel-Aviv Univ. Israel, 1997.

Back to the top of PDB


CHANGES LOG

Back to the top of PDB


GOALS

Class PDB is designed to encapsulate a set of methods used for reading the PDB file format. Methods are static requiring no object instantiation before their use.

Back to the top of PDB


USAGE

A PDB file is comprised of 80-char lines called records. These records describe different properties of a molecular structure (mainly proteins). A record can describe an atom coordinate, an amino-acid sequence, an alpha helix or some other chemical or geometrical properties of the molecule, depending on the record's type. For more information see the Protein Data Bank home page.

Class PDB's methods are all static. Hence the class's constructor was declared private so that no objects of type PDB will be declared. PDB's methods recieve a PDB record line as an argument and return requested data found in the record.

    char rec[81];    pdbFile.getline(line, 81);         // read line from stream.
    if (PDB::isATOMrec(rec))             // if record is of type ATOM
      Vector3 v(PDB::atomXCoord(rec),    // instantiate a vector with
                PDB::atomYCoord(rec),    // atom's coordinates.
                PDB::atomZCoord(rec));
Note that one must make sure the record is of the correct type before asking for data found in the record. For example you cannot ask for an x-coordinate of an atom before making sure that you are dealing with an ATOM record. Method names are prefixed by the type of record they are meant to handle (e.g. atomXCoord is meant to extract the X coordinate from an ATOM record). Methods beginning with the is prefix (e.g. isATOMrec) check for record type.

Back to the top of PDB


bool isATOMrec(const char *const PDBrec);

Returns true if the given record is an ATOM record.

  static bool isATOMrec(const char *const PDBrec);

Back to the top of PDB


bool isHETATMrec(const char *const PDBrec);

Returns true if the given record is a HETATM record.

  static bool isHETATMrec(const char *const PDBrec);

Back to the top of PDB


bool isCaATOMrec(const char *const PDBrec);

Returns true if the given record is an ATOM record of a C-alpha atom.

  static bool isCaATOMrec(const char *const PDBrec);

Back to the top of PDB


bool isNucleicRecord(const char *const PDBrec);

Returns true if the given record is a record of a nucleic acid residue
Author: Oranit Dror (oranit@tau.ac.il)

  static bool isNucleicRecord(const char *const PDBrec);

Back to the top of PDB


bool isNucleicAcid(const char *const residueName);

returns true if the residue name is of nucleic acid

  static bool isNucleicAcid(const char *const residueName);

Back to the top of PDB


bool isCONECTrec(const char *const PDBrec);

Returns true if the given record is a record of a connection between atoms
Author: Bluvshtein Nelly (bluvsh@post.tau.ac.il)

  static bool isCONECTrec(const char *const PDBrec);

Back to the top of PDB


float atomXCoord(const char *const PDBrec);

Returns an ATOM record's X coordinate.

  static float atomXCoord(const char *const PDBrec);

Back to the top of PDB


float atomYCoord(const char *const PDBrec);

Returns an ATOM record's Y coordinate.

  static float atomYCoord(const char *const PDBrec);

Back to the top of PDB


float atomZCoord(const char *const PDBrec);

Returns an ATOM record's Z coordinate.

  static float atomZCoord(const char *const PDBrec);

Back to the top of PDB


int atomIndex(const char *const PDBrec);

Returns an ATOM record's atom index number.

  static int atomIndex(const char *const PDBrec);

Back to the top of PDB


const char* atomType(const char *const PDBrec);

Returns a pointer to an ATOM's record atom type string. The atom type is a 4 charachter long field. A pointer is returned to the correct position withing the given string PDBrec. Hence the pointer should not be freed or deleted.

  static const char* atomType(const char *const PDBrec);

Back to the top of PDB


char atomAltLocIndicator(const char *const PDBrec);

Returns an ATOM record's alternative location indicator.

  static char  atomAltLocIndicator(const char *const PDBrec);

Back to the top of PDB


char atomChainId(const char *const PDBrec);

Returns an ATOM record's chain id.

  static char  atomChainId(const char *const PDBrec);

Back to the top of PDB


short atomResidueIndex(const char *const PDBrec);

Returns an ATOM record's residue index.

  static short atomResidueIndex(const char *const PDBrec);

Back to the top of PDB


char atomResidueICode(const char *const PDBrec);

code for insertion of residues Returns the value stored in the atomResIndexCharField of the given PDB record (column 26).
ATOM 279 CA SER 60 8.961 9.167 37.481 1.00 20.10 1SGT 477
ATOM 285 CA GLY 60A 5.640 10.901 38.407 1.00 21.41 1SGT 483
In this case for atom no. 285 the atomResidueICode method will return 'A' and for the atom no. 279 it will return ' '

  static char atomResidueICode(const char *const PDBrec);  

Back to the top of PDB


char atomResidueType(const char *const PDBrec);

Gets a PDB record of an atom and returns a one-letter abbreviation of the type of the residue that the atom belongs to.
For a nucleic acid atom returns A for adenine, G for guanine, T for thymine, U for uracil and X for unknown type.

  static char atomResidueType(const char *const PDBrec);

Back to the top of PDB


const char* const residueLongName(const char resChar);

Gets a one-letter abbreviation of the type of the residue that the atom belongs to
For a protein atom the method returns the 3-letter abbreviation of its residue. Returns 0 for other types of atoms.

  static const char* const residueLongName(const char resChar);

Back to the top of PDB


string const nucleicAcidLongName(const char resChar);

the same for nucleic acid

  static string const nucleicAcidLongName(const char resChar);

Back to the top of PDB


const char* getAtomResidueLongName(const char *const PDBrec);

Returns the full string of the Residue Name field

  static const char* getAtomResidueLongName(const char *const PDBrec);

Back to the top of PDB


AtomEntryType getAtomEntryType(const char *const PDBrec);

Return the type of the PDB entry, currently only ATOM and HETATM are identified.

  static AtomEntryType getAtomEntryType(const char *const PDBrec);

Back to the top of PDB


float getOccupancy(const char *const PDBrec);

Returns the occupancy, which is a measure of the fraction of molecules in the crystal in which the current atom actually occupies the specified position

  static float getOccupancy(const char *const PDBrec);

Back to the top of PDB


float getTempFactor(const char *const PDBrec);

Returns the temperature factor, which is a measure of how much an atom oscillates or vibrates around the specified position

  static float getTempFactor(const char *const PDBrec);

Back to the top of PDB


char residueShortName(const char *const resName);

Given a charachter string with a PDB residue type code, the method returns a one-letter abbreviation of the type of the residue that the atom belongs to:
- For a nucleic acid atom returns A for adenine, G for guanine, T for thymine, U for uracil and X for unknown type.
- For a protein atom, returns a 3-letter abbreviation of the residue name

  static char residueShortName(const char *const resName);

Back to the top of PDB


vector< unsigned short> connectedAtoms(const char *const PDBrec);

  static vector< unsigned short> connectedAtoms(const char *const PDBrec);

Back to the top of PDB


class Selector ;

Selector is a general purpose class used to select records from a PDB file. Using descendants of this class one may implement arbitrary selection functions with operator() and pass them to PDB reading functions for object selection. (See Molecule for examples).

  class Selector {
  public:
    virtual bool operator()(const char*) const {  
      return true;  
    }
    virtual ~Selector() {}
  };

Function is currently defined inline.


Back to the top of PDB


class CAlphaSelector ;

Defines a selector that will pick only C-alpha atoms.

  class CAlphaSelector : public Selector{  
   public:
    bool operator()(const char *PDBrec)const{
      const char *type = atomType(PDBrec);
      if(*(type+1) == 'C' && *(type+2) == 'A' && *(type+3) == ' '
	 && (*(type+4) == ' ' || *(type+4) == 'A')){
	return true;
      }else
	return false;
    }
  };

Function is currently defined inline.


Back to the top of PDB


class CBetaSelector;

Defines a selector that will pick only C-beta atoms.

  class CBetaSelector: public Selector{  
   public:
    bool operator()(const char *PDBrec) const {
      const char* residueName = getAtomResidueLongName(PDBrec);
      if (*(residueName) == 'G' && *(residueName+1) == 'L' && *(residueName+2) == 'Y') {
	return CAlphaSelector()(PDBrec);
      }

Back to the top of PDB


class CSelector;

Defines a selector that will pick only C atoms. (not Ca or Cb)

  class CSelector: public Selector{  
     public:
    bool operator()(const char *PDBrec) const {
      const char *type = atomType(PDBrec);
      return (*(type+1) == 'C' && *(type+2) == ' ');
    }
  };

Function is currently defined inline.


Back to the top of PDB


class NSelector;

Defines a selector that will pick only N atoms.

  class NSelector: public Selector{  
   public:
    bool operator()(const char *PDBrec) const {
      const char *type = atomType(PDBrec);
      return (*(type+1) == 'N' && *(type+2) == ' ');
    }
  };

Function is currently defined inline.


Back to the top of PDB


class AllSelector ;

Defines a selector that will pick every atom.

  class AllSelector : public Selector{  
   public:
    bool operator()(const char *PDBrec)const{
      return true;
    }
  };

Function is currently defined inline.


Back to the top of PDB


class ChainSelector ;

Selector that picks atoms of a given chain.

  class ChainSelector : public Selector {
   public:
    // constructor
    ChainSelector(const string& chainID): chains(chainID) {}
    virtual ~ChainSelector() {}
    bool operator()(const char* PDBrec) const {
      for(int i=0; i< (int)chains.length(); i++)
	if(atomChainId(PDBrec) == chains[i])
	  return true;
      return false;
    }
   private:
    string chains;
  };

Function is currently defined inline.


Back to the top of PDB


class WaterSelector ;

Selector that check if the line is water record

  class WaterSelector : public Selector {
   public:
    bool operator()(const char* PDBrec) const {
      return ((PDBrec[17]=='H' && PDBrec[18]=='O' && PDBrec[19]=='H') ||
	      (PDBrec[17]=='D' && PDBrec[18]=='O' && PDBrec[19]=='D'));
    }
  };

Function is currently defined inline.


Back to the top of PDB


class HydrogenSelector ;

Selector that check if the line is hydrogen record

  class HydrogenSelector : public Selector {
   public:
    bool operator()(const char* PDBrec) const {
      return (PDBrec[13] == 'H' || PDBrec[13] == 'D');
    }
  };

Function is currently defined inline.


Back to the top of PDB


class WaterHydrogenUnSelector ;

Selector that picks non water and non hydrogen atoms

  class WaterHydrogenUnSelector : public Selector {
   public:
    bool operator()(const char* PDBrec) const {
      return( !((PDBrec[17]=='H' && PDBrec[18]=='O' && PDBrec[19]=='H') ||
		(PDBrec[17]=='D' && PDBrec[18]=='O' && PDBrec[19]=='D')) &&
	      ! (PDBrec[13] == 'H' || PDBrec[13] == 'D' || PDBrec[12] == 'H' || PDBrec[12] == 'D') );
    }
  };

Function is currently defined inline.


Back to the top of PDB


class WaterUnSelector ;

Selector that picks non water atoms

  class WaterUnSelector : public Selector {
   public:
    bool operator()(const char* PDBrec) const {
      return( !((PDBrec[17]=='H' && PDBrec[18]=='O' && PDBrec[19]=='H') ||
		(PDBrec[17]=='D' && PDBrec[18]=='O' && PDBrec[19]=='D'))); 
	}
  };

Function is currently defined inline.


Back to the top of PDB


class PSelector ;

A PDB Selector that picks only Phosphate atoms.

  class PSelector : public Selector {  
  public:
    bool operator()(const char *PDBrec) const {
      const char *type = PDB::atomType(PDBrec);
      return (*(type+1) == 'P' && *(type+2) == ' ');
    }
  };

Function is currently defined inline.


Back to the top of PDB


class NucleicSelector ;

A PDB Selector that picks only nucleic acid atoms.

  class NucleicSelector : public Selector {  
  public:
    bool operator()(const char *PDBrec) const {
      return PDB::isNucleicRecord(PDBrec);
    }
  };

Function is currently defined inline.


Back to the top of PDB


class IgnoreAlternativesSelector ;

A PDB Selector that ignores all alternative location atoms.

  class IgnoreAlternativesSelector : public Selector {
  public:
    bool operator()(const char *PDBrec) const {
      return ((PDB::atomAltLocIndicator(PDBrec) == ' ') ||
	      (PDB::atomAltLocIndicator(PDBrec) == 'A'));
    }
  };

Function is currently defined inline.


Back to the top of PDB


All Members

public:
// PDB record type determination methods.
static bool isATOMrec(const char *const PDBrec);
static bool isHETATMrec(const char *const PDBrec);
static bool isCaATOMrec(const char *const PDBrec);
static bool isNucleicRecord(const char *const PDBrec);
static bool isNucleicAcid(const char *const residueName);
static bool isCONECTrec(const char *const PDBrec);
// ATOM record costants and methods.
static float atomXCoord(const char *const PDBrec);
static float atomYCoord(const char *const PDBrec);
static float atomZCoord(const char *const PDBrec);
static int atomIndex(const char *const PDBrec);
static const char* atomType(const char *const PDBrec);
static char atomAltLocIndicator(const char *const PDBrec);
static char atomChainId(const char *const PDBrec);
static short atomResidueIndex(const char *const PDBrec);
static char atomResidueICode(const char *const PDBrec);
static char atomResidueType(const char *const PDBrec);
static const char* const residueLongName(const char resChar);
static string const nucleicAcidLongName(const char resChar);
static const char* getAtomResidueLongName(const char *const PDBrec);
static AtomEntryType getAtomEntryType(const char *const PDBrec);
static float getOccupancy(const char *const PDBrec);
static float getTempFactor(const char *const PDBrec);
static char residueShortName(const char *const resName);
static vector< unsigned short> connectedAtoms(const char *const PDBrec);
class Selector ;
class CAlphaSelector ;
class CBetaSelector;
class CSelector;
class NSelector;
class AllSelector ;
class ChainSelector ;
class WaterSelector ;
class HydrogenSelector ;
class WaterHydrogenUnSelector ;
class WaterUnSelector ;
class PSelector ;
class NucleicSelector ;
class IgnoreAlternativesSelector ;
protected:

Back to the top of PDB


Ancestors

Class does not inherit from any other class.

Back to the top of PDB


Descendants

Class is not inherited by any others.

Back to the top of PDB


Generated from source by the Cocoon utilities on Sun Nov 15 13:35:26 2009 .

Report problems to jkotula@unimax.com