OBResidue Class Reference

Residue information. More...

#include <openbabel/residue.h>

Inheritance diagram for OBResidue:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 OBResidue (void)
 OBResidue (const OBResidue &)
virtual ~OBResidue (void)
OBResidueoperator= (const OBResidue &)
void AddAtom (OBAtom *atom)
void InsertAtom (OBAtom *atom)
void RemoveAtom (OBAtom *atom)
bool Clear ()
void SetName (const std::string &resname)
void SetNum (const unsigned int resnum)
void SetChain (const char chain)
void SetChainNum (const unsigned int chainnum)
void SetIdx (const unsigned int idx)
void SetAtomID (OBAtom *atom, const std::string &id)
void SetHetAtom (OBAtom *atom, bool hetatm)
void SetSerialNum (OBAtom *atom, unsigned int sernum)
std::string GetName (void) const
unsigned int GetNum (void) const
unsigned int GetNumAtoms () const
char GetChain (void) const
unsigned int GetChainNum (void) const
unsigned int GetIdx (void) const
unsigned int GetResKey (void) const
std::vector< OBAtom * > GetAtoms (void) const
std::vector< OBBond * > GetBonds (bool exterior=true) const
std::string GetAtomID (OBAtom *atom) const
unsigned GetSerialNum (OBAtom *atom) const
bool GetAminoAcidProperty (int) const
bool GetAtomProperty (OBAtom *a, int) const
bool GetResidueProperty (int) const
bool IsHetAtom (OBAtom *atom) const
bool IsResidueType (int) const
virtual OBBaseDoTransformations (const std::map< std::string, std::string > *)
template<class T>
T * CastAndClear (bool clear=true)
Iterator methods
OBAtomIterator BeginAtoms ()
OBAtomIterator EndAtoms ()
OBAtomBeginAtom (std::vector< OBAtom * >::iterator &i)
OBAtomNextAtom (std::vector< OBAtom * >::iterator &i)
Generic data handling methods (via OBGenericData)
bool HasData (const std::string &)
bool HasData (const char *)
bool HasData (const unsigned int type)
void DeleteData (unsigned int type)
void DeleteData (OBGenericData *)
void DeleteData (std::vector< OBGenericData * > &)
void SetData (OBGenericData *d)
unsigned int DataSize () const
OBGenericDataGetData (const unsigned int type)
OBGenericDataGetData (const std::string &)
OBGenericDataGetData (const char *)
std::vector< OBGenericData * > & GetData ()
std::vector< OBGenericData * > GetData (DataOrigin source)
OBDataIterator BeginData ()
OBDataIterator EndData ()

Static Public Member Functions

static const char * ClassDescription ()

Protected Attributes

unsigned int _idx
char _chain
unsigned int _aakey
unsigned int _reskey
unsigned int _resnum
std::string _resname
std::vector< bool > _hetatm
std::vector< std::string > _atomid
std::vector< OBAtom * > _atoms
std::vector< unsigned int > _sernum
std::vector< OBGenericData * > _vdata

Detailed Description

Residue information.

The residue information is drawn from PDB or MOL2 files (or similar), which track biomolecule information, and are stored in the OBResidue class. OBResidues are stored inside the OBAtom class and OBMol classes. The residue information for an atom can be requested in the following way:

      OBAtom *atom;
      OBResidue *r;
      atom = mol.GetAtom(1);
      r = atom->GetResidue();
The residue information for a molecule can be manipulated too:
      cout << "This molecule has " << mol.NumResidues() << " residues." << endl;
      OBResidue *r;
      r = mol.GetResidue(1);


Constructor & Destructor Documentation

OBResidue ( void   ) 

Constructor.

OBResidue ( const OBResidue  ) 

Copy constructor.

~OBResidue ( void   )  [virtual]

Destructor.


Member Function Documentation

OBResidue & operator= ( const OBResidue  ) 

void AddAtom ( OBAtom atom  ) 

Add atom to this residue. Updates the atom via OBAtom::SetResidue().

void InsertAtom ( OBAtom atom  ) 

Add atom to this residue. Updates the atom via OBAtom::SetResidue().

void RemoveAtom ( OBAtom atom  ) 

Remove atom from this residue and update the atom.

bool Clear (  )  [virtual]

Clear any and all data associated with this residue. Updates all atoms included in the residue, as well as calling OBBase::Clear() for any generic data.

Returns:
Whether the call was successful.

Reimplemented from OBBase.

void SetName ( const std::string &  resname  ) 

Set the name of this residue (e.g., "ALA"). Use 3-char PDB standard names. http://www.rcsb.org/pdb/file_formats/pdb/pdbguide2.2/part_79.html MODRES records for modified residues: http://www.rcsb.org/pdb/file_formats/pdb/pdbguide2.2/part_36.html.

void SetNum ( const unsigned int  resnum  ) 

Set the residue number (in the sequence).

void SetChain ( const char  chain  ) 

Set the chain ID for this residue.

void SetChainNum ( const unsigned int  chainnum  ) 

Set the chain number for this residue.

void SetIdx ( const unsigned int  idx  ) 

Set the internal index of this residue in the parent OBMol. Intended mostly for internal use

void SetAtomID ( OBAtom atom,
const std::string &  id 
)

Set the character code ID for an ATOM record for the supplied atom This does nothing if the supplied atom is not found in the residue

void SetHetAtom ( OBAtom atom,
bool  hetatm 
)

void SetSerialNum ( OBAtom atom,
unsigned int  sernum 
)

Set the atomic serial number for a given atom (see OBSerialNums).

string GetName ( void   )  const

Returns:
The residue name

unsigned int GetNum ( void   )  const

Returns:
The residue number (in the sequence)

unsigned int GetNumAtoms (  )  const

Returns:
The number of atoms in this residue

char GetChain ( void   )  const

Returns:
The ID of the chain which includes this residue

unsigned int GetChainNum ( void   )  const

Returns:
The number of the chain which includes this residue

unsigned int GetIdx ( void   )  const

Returns:
The internal index of this residue in the parent OBMol

unsigned int GetResKey ( void   )  const

Returns:
The residue key (i.e., an entry in the OBResidueIndex namespace)

vector< OBAtom * > GetAtoms ( void   )  const

Returns:
a vector of all atoms in this residue

vector< OBBond * > GetBonds ( bool  exterior = true  )  const

Returns:
all bonds in this residue. exterior includes bonds to atoms outside this residue (default is true)

string GetAtomID ( OBAtom atom  )  const

Returns:
the atom ID (character code) for the supplied atom or "" if the atom is not found in this residue

unsigned int GetSerialNum ( OBAtom atom  )  const

Returns:
the serial number of the supplied atom (uses OBSerialNums)

bool GetAminoAcidProperty ( int   )  const

Returns:
Whether this residue has the supplied amino acid property defined from the OBAminoAcidProperty namespace

bool GetAtomProperty ( OBAtom a,
int   
) const

Returns:
Whether atom a has the supplied residue atom property defined from the OBResidueAtomProperty namespace

bool GetResidueProperty ( int   )  const

Returns:
Whether this residue has the supplied property defined from the OBResidueProperty namespace

bool IsHetAtom ( OBAtom atom  )  const

Returns:
If the given atom is a HETATM record

bool IsResidueType ( int   )  const

Returns:
If this residue matches the supplied restype Set by SetResidueKeys()

OBAtomIterator BeginAtoms (  )  [inline]

Returns:
An iterator to the beginning of the atom list in this residue

OBAtomIterator EndAtoms (  )  [inline]

Returns:
An iterator to the end of the atom list in this residue

OBAtom * BeginAtom ( std::vector< OBAtom * >::iterator &  i  ) 

Set the iterator i to the beginning of the atom list in this residue

Returns:
The first atom (or NULL if none exist)

OBAtom * NextAtom ( std::vector< OBAtom * >::iterator &  i  ) 

Increment the iterator i

Returns:
The next atom (or NULL if none exist)

virtual OBBase* DoTransformations ( const std::map< std::string, std::string > *   )  [inline, virtual, inherited]

Perform a set of transformations specified by the user

Typically these are program options to filter or modify an object For example, see OBMol::DoTransformations() and OBMol::ClassDescription()

Reimplemented in OBMol.

static const char* ClassDescription (  )  [inline, static, inherited]

Returns:
A list of descriptions of command-line options for DoTransformations()

Reimplemented in OBMol.

T* CastAndClear ( bool  clear = true  )  [inline, inherited]

By default clears the object. Called from ReadMolecule of most format classes.

bool HasData ( const std::string &   )  [inherited]

Returns:
whether the generic attribute/value pair exists

bool HasData ( const char *   )  [inherited]

Returns:
whether the generic attribute/value pair exists

bool HasData ( const unsigned int  type  )  [inherited]

Returns:
whether the generic attribute/value pair exists, for a given OBGenericDataType

void DeleteData ( unsigned int  type  )  [inherited]

Delete any data matching the given OBGenericDataType.

void DeleteData ( OBGenericData  )  [inherited]

Delete the given generic data from this object.

void DeleteData ( std::vector< OBGenericData * > &   )  [inherited]

Delete all of the given generic data from this object.

void SetData ( OBGenericData d  )  [inline, inherited]

Adds a data object; does nothing if d==NULL.

unsigned int DataSize (  )  const [inline, inherited]

Returns:
the number of OBGenericData items attached to this molecule.

OBGenericData * GetData ( const unsigned int  type  )  [inherited]

Returns:
the first matching data for a given type from OBGenericDataType or NULL if nothing matches

OBGenericData * GetData ( const std::string &   )  [inherited]

Returns:
the value given an attribute name

OBGenericData * GetData ( const char *   )  [inherited]

Returns:
the value given an attribute name

std::vector<OBGenericData*>& GetData (  )  [inline, inherited]

Returns:
all data, suitable for iterating

std::vector< OBGenericData * > GetData ( DataOrigin  source  )  [inherited]

Returns:
all data with a specific origin, suitable for iterating

OBDataIterator BeginData (  )  [inline, inherited]

Returns:
An iterator pointing to the beginning of the data

OBDataIterator EndData (  )  [inline, inherited]

Returns:
An iterator pointing to the end of the data


Member Data Documentation

unsigned int _idx [protected]

Residue index (i.e., internal index in an OBMol).

char _chain [protected]

Chain ID.

unsigned int _aakey [protected]

Amino Acid key ID -- see SetResidueKeys().

unsigned int _reskey [protected]

Residue key ID -- see SetResidueKeys().

unsigned int _resnum [protected]

Residue number (i.e., in file).

std::string _resname [protected]

Residue text name.

std::vector<bool> _hetatm [protected]

Is a given atom a HETAM.

std::vector<std::string> _atomid [protected]

Residue atom text IDs.

std::vector<OBAtom*> _atoms [protected]

List of OBAtom in this residue.

std::vector<unsigned int> _sernum [protected]

List of serial numbers.

std::vector<OBGenericData*> _vdata [protected, inherited]

Custom data.


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