Main Page | Namespace List | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Examples

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
unsigned int number_of_residues () 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)

Protected Attributes

std::vector< Residueresidues_
std::vector< std::string > header_
char chain_

Friends

class Model

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>::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.

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.


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

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

Return the atom which has the pdb index passed.

Referenced by dsrpdb::Protein::Bonds_iterator::cur_bond().

Const_atoms_iterator dsrpdb::Protein::atoms_begin  )  const
 

Begin iterating through the atoms.

Atoms_iterator dsrpdb::Protein::atoms_begin  ) 
 

Begin iterating through the atoms.

Examples:
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().

Const_atoms_iterator dsrpdb::Protein::atoms_end  )  const
 

End iterating through the atoms.

Atoms_iterator dsrpdb::Protein::atoms_end  ) 
 

End iterating through the atoms.

Examples:
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().

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.

Bonds_iterator dsrpdb::Protein::bonds_end  )  const
 

End iterating through all the bonds.

char dsrpdb::Protein::chain  )  const
 

Return the chain id.

Examples:
pdb_split.cc.

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

Dump as human readable.

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

Return whether bonds have been computed for this protein.

Definition at line 176 of file Protein.h.

References residues_.

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

Return true if there is a residue with that index.

unsigned int dsrpdb::Protein::number_of_atoms  )  const
 

This is non-const time.

unsigned int dsrpdb::Protein::number_of_bonds  )  const
 

This is non-const time.

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.

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

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

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.

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

Begin iterating residues.

Definition at line 83 of file Protein.h.

References residues_.

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

Iterate through all the residues.

Examples:
pdb_split.cc.

Definition at line 73 of file Protein.h.

References residues_.

Referenced by dsrpdb::simplified_coordinates_and_bonds().

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

End iterating residues.

Definition at line 87 of file Protein.h.

References residues_.

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

End iterator through the residues.

Examples:
pdb_split.cc.

Definition at line 77 of file Protein.h.

References residues_.

Referenced by dsrpdb::simplified_coordinates_and_bonds().

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

The sequence of residue types.

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

Return the atom which has the pdb index passed.

void dsrpdb::Protein::set_chain char  c  ) 
 

Set the chain id.

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.

References residues_.

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.


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