dsrpdb::Protein Class Reference

#include <Protein.h>

List of all members.


Detailed Description

A class representing a single chain of a protein.

It probably should be called chain, but it is not :-)

Examples:

check_protein.cc, pdb_align.cc, pdb_align_points.cc, pdb_distance.cc, and pdb_split.cc.

Definition at line 41 of file Protein.h.


Public Types

typedef std::pair< Atom::Index,
Atom::Index
Bond
typedef std::vector< Residue >
::iterator 
Residues_iterator
typedef std::vector< Residue >
::const_iterator 
Const_residues_iterator

Public Member Functions

 Protein (std::istream &in, bool print_errors=false)
 Protein ()
char chain () const
void set_chain (char c)
Residues_iterator residues_begin ()
Residues_iterator residues_end ()
Const_residues_iterator residues_begin () const
Const_residues_iterator residues_end () const
Atoms_iterator atoms_begin ()
Atoms_iterator atoms_end ()
Const_atoms_iterator atoms_begin () const
Const_atoms_iterator atoms_end () const
unsigned int number_of_atoms () const
Bonds_iterator bonds_begin () const
Bonds_iterator bonds_end () const
unsigned int number_of_bonds () const
const Residueresidue_containing_atom (Atom::Index atom_index) const
Residueresidue_containing_atom (Atom::Index atom_index)
const Atomatom (Atom::Index atom_index) const
void set_atom (Atom::Index atom_index, const Atom &a)
std::vector< Residue::Typesequence () const
void write (std::ostream &out) const
void write_pdb (std::ostream &out) const
void dump (std::ostream &out) const
const Residueresidue (Residue::Index i) const
bool has_residue (Residue::Index i) const
bool has_bonds () const
void set_has_bonds (bool tf)

Classes

class  Atoms_iterator
 An iterator through the atoms of a dsrpdb::Protein. More...
class  Bonds_iterator
 An iterator through the bonds of a dsrpdb::Protein. More...
class  Const_atoms_iterator
 An iterator through the atoms of a dsrpdb::Protein. More...

Member Typedef Documentation

typedef std::pair<Atom::Index,Atom::Index> dsrpdb::Protein::Bond

A chemical bond within the protein.

Definition at line 50 of file Protein.h.

typedef std::vector<Residue>::iterator dsrpdb::Protein::Residues_iterator

An iterator to go through all the residues.

Definition at line 71 of file Protein.h.

typedef std::vector<Residue>::const_iterator dsrpdb::Protein::Const_residues_iterator

Iterator for residues in order of addition.

Examples:
pdb_split.cc.

Definition at line 81 of file Protein.h.


Constructor & Destructor Documentation

dsrpdb::Protein::Protein ( std::istream &  in,
bool  print_errors = false 
)

Build a protein from a pdb file. See check_protein.cc for an example of using this to read a pdb file.

The optional bool controls whether errors (such as unparsable PDB lines). Set it to false to disable printing errors.

dsrpdb::Protein::Protein (  ) 

Default.


Member Function Documentation

char dsrpdb::Protein::chain (  )  const

Return the chain id.

Examples:
pdb_split.cc.

void dsrpdb::Protein::set_chain ( char  c  ) 

Set the chain id.

Residues_iterator dsrpdb::Protein::residues_begin (  )  [inline]

Iterate through all the residues.

Examples:
check_protein.cc, and pdb_split.cc.

Definition at line 73 of file Protein.h.

Referenced by dsrpdb::simplified_coordinates_and_bonds().

Residues_iterator dsrpdb::Protein::residues_end (  )  [inline]

End iterator through the residues.

Examples:
pdb_split.cc.

Definition at line 77 of file Protein.h.

Referenced by dsrpdb::simplified_coordinates_and_bonds().

Const_residues_iterator dsrpdb::Protein::residues_begin (  )  const [inline]

Begin iterating residues.

Definition at line 83 of file Protein.h.

Const_residues_iterator dsrpdb::Protein::residues_end (  )  const [inline]

End iterating residues.

Definition at line 87 of file Protein.h.

Atoms_iterator dsrpdb::Protein::atoms_begin (  ) 

Begin iterating through the atoms.

Examples:
check_protein.cc, pdb_align_points.cc, and pdb_distance.cc.

Referenced by dsrpdb::all_coordinates_begin(), dsrpdb::backbone_coordinates_begin(), dsrpdb::ca_coordinates_begin(), and dsrpdb::protein_backbone_indices_begin().

Atoms_iterator dsrpdb::Protein::atoms_end (  ) 

End iterating through the atoms.

Examples:
check_protein.cc, pdb_align_points.cc, and pdb_distance.cc.

Referenced by dsrpdb::all_coordinates_begin(), dsrpdb::all_coordinates_end(), dsrpdb::backbone_coordinates_begin(), dsrpdb::backbone_coordinates_end(), dsrpdb::ca_coordinates_begin(), dsrpdb::ca_coordinates_end(), dsrpdb::protein_backbone_indices_begin(), and dsrpdb::protein_backbone_indices_end().

Const_atoms_iterator dsrpdb::Protein::atoms_begin (  )  const

Begin iterating through the atoms.

Const_atoms_iterator dsrpdb::Protein::atoms_end (  )  const

End iterating through the atoms.

unsigned int dsrpdb::Protein::number_of_atoms (  )  const

This is non-const time.

Bonds_iterator dsrpdb::Protein::bonds_begin (  )  const

Begin iterating through all the bonds

Note:
These bonds are indexed by the atom numbers in the pdb which will not correspond to the atom sequence numbers in the atoms_begin() sequence when the PDB atoms do not start from 1 or have missing residues. This is a bug (I think) and will be fixed. However, doing so is slightly complicated as I need to handle the case of missing residues.
Examples:
check_protein.cc.

Bonds_iterator dsrpdb::Protein::bonds_end (  )  const

End iterating through all the bonds.

Examples:
check_protein.cc.

unsigned int dsrpdb::Protein::number_of_bonds (  )  const

This is non-const time.

const Residue& dsrpdb::Protein::residue_containing_atom ( Atom::Index  atom_index  )  const

Return the dsrpdb::Residue which contains the atoms with a particular index.

This operation is currently linear in the number of residues. Making it logrighmic should be easy, but it isn't done.

Examples:
check_protein.cc.

Residue& dsrpdb::Protein::residue_containing_atom ( Atom::Index  atom_index  ) 

Return the dsrpdb::Residue which contains the atom witha particular index.

const Atom& dsrpdb::Protein::atom ( Atom::Index  atom_index  )  const

Return the atom which has the pdb index passed.

Examples:
check_protein.cc.

void dsrpdb::Protein::set_atom ( Atom::Index  atom_index,
const Atom a 
)

Return the atom which has the pdb index passed.

std::vector<Residue::Type> dsrpdb::Protein::sequence (  )  const

The sequence of residue types.

void dsrpdb::Protein::write ( std::ostream &  out  )  const

Write as part of pdb file.

void dsrpdb::Protein::write_pdb ( std::ostream &  out  )  const

Write a pdb file.

See check_protein.cc for an example of using this to write a pdb file.

Examples:
check_protein.cc.

void dsrpdb::Protein::dump ( std::ostream &  out  )  const

Dump as human readable.

const Residue& dsrpdb::Protein::residue ( Residue::Index  i  )  const

Return the residue with a particular index.

Note:
This function has changed. Use the iterators if you just want to go through the list.

bool dsrpdb::Protein::has_residue ( Residue::Index  i  )  const

Return true if there is a residue with that index.

bool dsrpdb::Protein::has_bonds (  )  const [inline]

Return whether bonds have been computed for this protein.

Definition at line 176 of file Protein.h.

void dsrpdb::Protein::set_has_bonds ( bool  tf  )  [inline]

Set whether the protein has bonds or not.

Definition at line 181 of file Protein.h.


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