Avogadro::Core::Residue#

class Residue#

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

Public Types

enum SecondaryStructure#

Values:

enumerator piHelix#
enumerator bend#
enumerator alphaHelix#
enumerator betaSheet#
enumerator helix310#
enumerator betaBridge#
enumerator turn#
enumerator coil#
enumerator maybeBeta#
enumerator undefined#
typedef std::map<std::string, Atom> AtomNameMap#

Type for atom name map.

Public Functions

Residue()#

Creates a new, empty residue.

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)#
virtual ~Residue()#
inline std::string residueName() const#
inline void setResidueName(std::string &name)#
inline Index residueId() const#
inline void setResidueId(Index &number)#
inline char chainId() const#
inline void setChainId(const char &id)#
inline SecondaryStructure secondaryStructure() const#
inline void setSecondaryStructure(const SecondaryStructure &ss)#
void addResidueAtom(const std::string &name, const Atom &atom)#

Adds an atom to the residue class

std::vector<Atom> residueAtoms() const#
Returns:

a vector containing the atoms added to the residue

inline AtomNameMap &atomNameMap()#
Returns:

the atom map for the residue

void resolveResidueBonds(Molecule &mol)#

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

Atom getAtomByName(std::string name) const#
Returns:

the atom with the name specified (e.g., “CA”)

int getAtomicNumber(std::string name) const#
Returns:

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

std::string getAtomName(const Atom atom) const#
Returns:

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

std::string getAtomName(const Index index) const#
Returns:

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

bool hasAtomByIndex(Index index) const#
inline void setHeterogen(bool heterogen)#

Set whether this residue is a “HET” / “HETATOM” ligand

inline bool isHeterogen() const#
Returns:

is this residue a heterogen (HET / HETATM)

void setColor(const Vector3ub color)#

Set a custom color for this residue

Vector3ub color() const#
Returns:

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

Protected Attributes

std::string m_residueName#
Index m_residueId#
char m_chainId#
AtomNameMap m_atomNameMap#
bool m_heterogen#
Vector3ub m_color#
bool m_customColorSet#
SecondaryStructure m_secondaryStructure#