OpenStructure
Public Member Functions
ResidueHandle Class Reference

#include <residue_handle.hh>

Inherits ResidueBase.

Public Member Functions

 ResidueHandle ()
 
 ResidueHandle (const impl::ResidueImplPtr &impl)
 
EntityHandle GetEntity () const
 
double GetMass () const
 
geom::Vec3 GetCenterOfMass () const
 
geom::Vec3 GetCenterOfAtoms () const
 
geom::AlignedCuboid GetBounds () const
 
ChainHandle GetChain () const
 
ResidueHandle GetPrev () const
 
ResidueHandle GetNext () const
 
AtomHandle FindAtom (const String &aname) const
 
void Apply (EntityVisitor &visitor)
 
AtomHandleList GetAtomList () const
 
int GetAtomCount () const
 
int GetBondCount () const
 
TorsionHandle FindTorsion (const String &torsion_name) const
 
TorsionHandleList GetTorsionList () const
 
int GetIndex () const
 
Alternative atom positions

Alternative atom positions have traditionally been used to indicate that the position of an atom is not limited to one point, but that the atom may occur at more than one position. The following functions let you work with alternative atom locations on the level of residues.

bool HasAltAtomGroup (const String &group) const
 
const StringGetCurrentAltGroupName () const
 
std::vector< StringGetAltAtomGroupNames () const
 
bool HasAltAtoms () const
 
geom::Vec3 GetAltAtomPos (const AtomHandle &atom, const String &group) const
 
bool SwitchAtomPos (const String &group)
 
ResidueHandle GetHandle () const
 
unsigned long GetHashCode () const
 
EntityView Select (const Query &q, QueryFlags flags=0) const
 
EntityView Select (const String &query_string, QueryFlags flags=0) const
 
bool operator== (const ResidueHandle &ref) const
 
bool operator!= (const ResidueHandle &ref) const
 
- Public Member Functions inherited from ResidueBase
 ResidueBase ()
 
 ResidueBase (const impl::ResidueImplPtr &impl)
 
 ResidueBase (const ResidueBase &rhs)
 
 operator bool () const
 
bool IsValid () const
 
const ResNumGetNumber () const
 
const ResidueKeyGetKey () const
 
const StringGetName () const
 
String GetQualifiedName () const
 
AtomHandle GetCentralAtom () const
 
void SetCentralAtom (const AtomHandle &a)
 
geom::Vec3 GetCentralNormal () const
 
bool IsPeptideLinking () const
 
bool IsNucleotideLinking () const
 
ChemClass GetChemClass () const
 
void SetChemClass (ChemClass cc)
 
ChemType GetChemType () const
 
void SetChemType (ChemType ct)
 
SecStructure GetSecStructure () const
 
void SetSecStructure (SecStructure ss)
 
TorsionHandle GetPhiTorsion () const
 
TorsionHandle GetPsiTorsion () const
 
TorsionHandle GetOmegaTorsion () const
 
char GetOneLetterCode () const
 
void SetOneLetterCode (char olc)
 
String GetStringProperty (Prop::ID prop_id) const
 
Real GetFloatProperty (Prop::ID prop_id) const
 
int GetIntProperty (Prop::ID prop_id) const
 
bool IsProtein () const
 
void SetIsProtein (bool protein)
 
void SetIsLigand (bool ligand)
 
bool IsLigand () const
 
impl::ResidueImplPtrImpl ()
 
const impl::ResidueImplPtrImpl () const
 
- Public Member Functions inherited from GenericPropContainer< ResidueBase >
void ClearProps ()
 
void SetStringProp (const String &key, const String &value)
 
void SetFloatProp (const String &key, Real value)
 
void SetIntProp (const String &key, int value)
 
void SetBoolProp (const String &key, bool value)
 
void SetVec3Prop (const String &key, geom::Vec3 value)
 
void RemoveProp (const String &key)
 
- Public Member Functions inherited from ConstGenericPropContainer< H >
bool HasProp (const String &key) const
 
String GetPropAsString (const String &key) const
 
String GetStringProp (const String &key) const
 
Real GetFloatProp (const String &key) const
 
int GetIntProp (const String &key) const
 
bool GetBoolProp (const String &key) const
 
geom::Vec3 GetVec3Prop (const String &key) const
 
String GetStringProp (const String &key, const String &def) const
 
Real GetFloatProp (const String &key, Real def) const
 
int GetIntProp (const String &key, int def) const
 
bool GetBoolProp (const String &key, bool def) const
 
std::map< String, GenericPropValueGetPropMap () const
 
std::vector< StringGetPropList () const
 

Additional Inherited Members

- Protected Member Functions inherited from ResidueBase
GenericPropContainerImplGpImpl ()
 
const GenericPropContainerImplGpImpl () const
 
void CheckValidity () const
 
- Protected Member Functions inherited from ConstGenericPropContainer< H >
template<typename T >
gp_get (const String &key) const
 
template<typename T >
gp_get (const String &key, const T &def) const
 
GenericPropContainerImplGetImpl ()
 
const GenericPropContainerImplGetImpl () const
 

Detailed Description

Residue handle.

In a polymer a residue is a single unit such as a nucleotide or an amino acid. In case of ligands, a residue ofter represents a completye molecule, such as a HEM group.

Every residue belongs to a chain and has a defined position (GetIndex) in that chain. In a peptide chain, the previous (towards N-terminus) and next (towards C-terminus) can be obtained with GetPrev() and GetNext() respectively.

A residue consist of one or more atoms. The list of atoms can be retrieved with GetAtomList(), wheras FindAtom() will locate a particular atom in the residue.

To add atoms to the residue, you have to request an editor and call EditorBase::InsertAtom() or EditorBase::InsertAltAtom()

XCSEditor edi=residue.GetEntity().EditXCS();
edi.InsertAtom(residue, "CA", geom.Vec3(1.0, 0.0, 0.0));
Three dimensional vector class, using Real precision.
Definition: vec3.hh:48

Definition at line 54 of file residue_handle.hh.

Constructor & Destructor Documentation

◆ ResidueHandle() [1/2]

◆ ResidueHandle() [2/2]

ResidueHandle ( const impl::ResidueImplPtr impl)
inline

Definition at line 59 of file residue_handle.hh.

Member Function Documentation

◆ Apply()

void Apply ( EntityVisitor visitor)

Apply entity visitor.

Parameters
visitoris the entity visitor to apply
See also
EntityVisitor

◆ FindAtom()

AtomHandle FindAtom ( const String aname) const

Find atom by name.

Parameters
anameis the atom name

◆ FindTorsion()

TorsionHandle FindTorsion ( const String torsion_name) const

Find torsion by name.

Note
For the PHI, ISP and PSI torsions of the backbone use the designated GetPhiTorsion and GetPsiTorsion methods, respectively.
Parameters
torsion_nameis the name of the torsion you are looking for. Torsions are named with uppercase letters.
Returns
The torsion, or an invalid torsion handle if the residues does not have a torsion with the given name.
See also
ResidueBase::GetPhiTorsion, ResidueBase::GetPsiTorsion

◆ GetAltAtomGroupNames()

std::vector<String> GetAltAtomGroupNames ( ) const

Get names of alternative atom groups.

◆ GetAltAtomPos()

geom::Vec3 GetAltAtomPos ( const AtomHandle atom,
const String group 
) const

Get alternative atom position for given atom.

If the atom is not in group, an IntegrityError is thrown.

◆ GetAtomCount()

int GetAtomCount ( ) const

Get number of atoms of this residue.

◆ GetAtomList()

AtomHandleList GetAtomList ( ) const

Get number of atoms of this residue.

See also
ResidueHandle::GetAtomCount

◆ GetBondCount()

int GetBondCount ( ) const

Get number of bonds of this residue. This method might NOT work as expected (see warning below).

Warning
For a bond between two different residues, it is not clearly defined to which residue it belongs. Therefore, this method works only correctly if the residue has NO bonds to any other residues!

◆ GetBounds()

geom::AlignedCuboid GetBounds ( ) const

get axis-aligned bounding box of residue

◆ GetCenterOfAtoms()

geom::Vec3 GetCenterOfAtoms ( ) const

Get residue's center of atoms (not mass weighted)

Returns the center of all the atoms in this residue. This is similar to GetCenterOfMass(), but the atoms are not mass weighted

◆ GetCenterOfMass()

geom::Vec3 GetCenterOfMass ( ) const

Get residue's center of mass (mass weighted)

◆ GetChain()

ChainHandle GetChain ( ) const

The chain this residue is attached to.

◆ GetCurrentAltGroupName()

const String& GetCurrentAltGroupName ( ) const

Name of active alternative atom group.

Returns
The alternative atom group name or an empty String, if the atom does not have any alternative atoms.

◆ GetEntity()

EntityHandle GetEntity ( ) const

◆ GetHandle()

ResidueHandle GetHandle ( ) const

get this handle

This method exists as a convenience duck-typing in Python.

◆ GetHashCode()

unsigned long GetHashCode ( ) const

◆ GetIndex()

int GetIndex ( ) const

Get position of residue in chain.

◆ GetMass()

double GetMass ( ) const

Get residue's mass.

◆ GetNext()

ResidueHandle GetNext ( ) const

Get next residue in chain.

Returns
Invalid handle, when there is no next residue.

◆ GetPrev()

ResidueHandle GetPrev ( ) const

Get previous residue in chain.

Returns
Invalid handle, when there is no previous residue.

◆ GetTorsionList()

TorsionHandleList GetTorsionList ( ) const

Get list of all torsion angles of this residue.

◆ HasAltAtomGroup()

bool HasAltAtomGroup ( const String group) const

Test if residue has group of alternative atoms with a certain name.

◆ HasAltAtoms()

bool HasAltAtoms ( ) const

Test if the residue has any alternative atom positions.

◆ operator!=()

bool operator!= ( const ResidueHandle ref) const

◆ operator==()

bool operator== ( const ResidueHandle ref) const

◆ Select() [1/2]

EntityView Select ( const Query q,
QueryFlags  flags = 0 
) const

return view based on a query object

See also
Query

◆ Select() [2/2]

EntityView Select ( const String query_string,
QueryFlags  flags = 0 
) const

return view based on query String.

See also
Query

◆ SwitchAtomPos()

bool SwitchAtomPos ( const String group)

switch atoms that have alternative positions to the position in the group. Atoms that do not have an alternative position are left untouched.

Parameters
groupis the group name to switch to.
Returns
True, if such a group exists, false if not.

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