Loading...
Searching...
No Matches
Residue Class Reference

The Residue class represents a chemical residue, used commonly in the PDB format.

`#include <avogadro/core/residue.h>`

## Public Types

enum | SecondaryStructure { piHelix = 0 , bend = 1 , alphaHelix = 2 , betaSheet = 3 , helix310 = 4 , betaBridge = 5 , turn = 6 , coil = 7 , maybeBeta = -3 , undefined = -1 }
using | AtomNameMap = std::map<std::string, Atom>

## Public Member Functions

| Residue ()=default
| Residue (std::string &name)
| Residue (std::string &name, Index &number)
| Residue (std::string &name, Index &number, char &id)
| Residue (const Residue &other)
Residue & | operator= (Residue other)
std::string | residueName () const
void | setResidueName (std::string &name)
Index | residueId () const
void | setResidueId (Index &number)
char | chainId () const
void | setChainId (const char &id)
SecondaryStructure | secondaryStructure () const
void | setSecondaryStructure (const SecondaryStructure &ss)
void | addResidueAtom (const std::string &name, const Atom &atom)
std::vector< Atom > | residueAtoms () const
AtomNameMap & | atomNameMap ()
void | resolveResidueBonds (Molecule &mol)
Atom | atomByName (std::string name) const
int | atomicNumber (std::string name) const
std::string | atomName (const Atom atom) const
std::string | atomName (const Index index) const
bool | hasAtomByIndex (Index index) const
void | setHeterogen (bool heterogen)
bool | isHeterogen () const
void | setColor (const Vector3ub color)
Vector3ub | color () const

## Protected Attributes

std::string | m_residueName
Index | m_residueId = std::numeric_limits<Index>::max()
char | m_chainId = 'A'
AtomNameMap | m_atomNameMap
bool | m_heterogen = false
Vector3ub | m_color = Vector3ub(0, 0, 0)
bool | m_customColorSet = false
SecondaryStructure | m_secondaryStructure = undefined

## Member Typedef Documentation

## AtomNameMap

using AtomNameMap = std::map<std::string, Atom>

Type for atom name map.

## Constructor & Destructor Documentation

## Residue()

Residue | ( |  | ) |

default

Creates a new, empty residue.

## Member Function Documentation

## addResidueAtom()

void addResidueAtom | ( | const std::string & | name,
|  | const Atom & | atom )

Adds an atom to the residue class

## residueAtoms()

std::vector< Atom > residueAtoms | ( |  | ) | const

Returns
  a vector containing the atoms added to the residue

## atomNameMap()

AtomNameMap & atomNameMap | ( |  | ) |

Returns
  the atom map for the residue

## resolveResidueBonds()

void resolveResidueBonds | ( | Molecule & | mol | ) |

Sets bonds to atoms in the residue based on data from residuedata header

## atomByName()

Atom atomByName | ( | std::string | name | ) | const

Returns
  the atom with the name specified (e.g., "CA")

## atomicNumber()

int atomicNumber | ( | std::string | name | ) | const

Returns
  the atomic number of the atom with the name specified (e.g., "CA" = "C")

## atomName() [1/2]

std::string atomName | ( | const Atom | atom | ) | const

Returns
  the name of `atom` or an empty string if not in this residue

## atomName() [2/2]

std::string atomName | ( | const Index | index | ) | const

Returns
  the name of atom `index` or an empty string if not in this residue

## setHeterogen()

void setHeterogen | ( | bool | heterogen | ) |

Set whether this residue is a "HET" / "HETATOM" ligand

## isHeterogen()

bool isHeterogen | ( |  | ) | const

Returns
  is this residue a heterogen (HET / HETATM)

## setColor()

void setColor | ( | const Vector3ub | color | ) |

Set a custom color for this residue

## color()

Vector3ub color | ( |  | ) | const

Returns
  the color set for this residue, or a default from the chain id

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

- residue.h