OEResidue

class OEResidue

The OEResidue class is used to attach biopolymer information to each OEAtomBase object. This class contains a number of fields specific to processing macromolecules, such as proteins and nucleic acids. Each atom may be annotated with a unique OEResidue, hence OEResidue objects are not shared between different atoms. If the fields of an OEResidue associated with a single atom are updated, only that atom is affected. To adapt to the change for mmCIF where a chainID can now contain multiple characters, the chainID is now stored as an string. The existing GetChainID() function will return just the first character of the chain ID. We encourage users to switch to use GetExtChainID() which will return the string.

See also

Note

See section Biopolymer Residues for a detailed description of the data stored in an OEResidue.

Constructors

OEResidue()

Default constructor.

OEResidue(const OEResidue &rhs)

Copy constructor.

operator=

OEResidue &operator=(const OEResidue &rhs)

Assignment operator that copies the data of the ‘rhs’ OEResidue object into the right-hand side OEResidue object.

operator bool

operator bool() const

Determines whether any field of an OEResidue has a non-default value.

Comparison Operators

bool operator==(const OEResidue &rhs) const
bool operator!=(const OEResidue &rhs) const
bool operator<(const OEResidue &rhs) const
bool operator<=(const OEResidue &rhs) const
bool operator>(const OEResidue &rhs) const
bool operator>=(const OEResidue &rhs) const

The comparison operators compare properties of two OEResidue objects. Two residues are considered equal if all their properties are equal. The <, <=, >, and >= operators consider the residue properties in the following order: model number, chain ID, fragment number, residue number, insertion code, and residue name.

Because of the existence of the < operator, it is possible to sort containers by residue, and also to create std::map containers using OEResidue as a key. The residue sorting order produced by the < operator is the same as that produced by OEPDBOrderAtoms.

GetAlternateLocation

char GetAlternateLocation() const

Returns the ‘alternate location’ property of an atom in a residue. The ‘alternate location’ property may be set using the OEResidue::SetAlternateLocation method.

GetBFactor

float GetBFactor() const

Returns the crystallographic ‘b-factor’ property of an atom in a residue. The ‘b-factor’ property may be set using the OEResidue::SetBFactor method.

GetChainID

char GetChainID() const

This method is deprecated and should no longer be used. Instead, use OEResidue::GetExtChainID. Returns the first character of the ‘chain identifier’ property of the residue. The ‘chain identifier’ property may be set using the OEResidue::SetExtChainID method.

GetExtChainID

string GetExtChainID() const

Returns the ‘chain identifier’ property of the residue. The ‘chain identifier’ property may be set using the OEResidue::SetExtChainID method. If reading from mmCIF, this property is auth_asym_id field from the mmCIF spec.

GetSubChainID

string GetSubChainID() const

Returns the ‘subchain identifier’ property of the residue. The ‘subchain identifier’ property may be set using the OEResidue::SetSubChainID method. When reading from PDB, this is default to a space character. When reading from mmCIF, these are now a further subdivision of the chain identifier based on connected components. If reading from mmCIF, this property is label_asym_id field from the mmCIF spec.

GetFragmentNumber

int GetFragmentNumber() const

Returns the ‘fragment number’ property of a residue. Fragment numbers are integer indices that define connected components of a macromolecule. When reading from a PDB file, the first atom is placed in fragment number 1. Each time a TER, END or ENDM record is encountered within a single connection table, the fragment number is incremented. Similarly, when writing a PDB file, a TER record is written between any consecutive pair of atoms with different fragment numbers. The fragment number property may be set using the OEResidue::SetFragmentNumber number property.

GetInsertCode

char GetInsertCode() const

Returns the ‘insertion code’ of a residue. Insertion codes are single character suffixes used to distinguish insertions when using a standardized residue numbering system. By default, this property contains a single space character, ' '. The insertion code property of a residue may be set using the OEResidue::SetInsertCode method.

GetModelNumber

int GetModelNumber() const

Returns the ‘model number’ property of a residue. For NMR or molecular dynamics files, the model number contains the index of the NMR model or dynamics time-step within a file. When reading from mmCIF, the model numbers start from 1. The ‘model number’ property may be set using the OEResidue::SetModelNumber method.

GetName

const char *GetName() const

Returns the ‘residue name’ property of a residue. The ‘residue name’ property may be set using the OEResidue::SetName method.

GetOccupancy

float GetOccupancy() const

Returns the crystallographic ‘occupancy’ property of an atom in a residue. The default value is 1.0. The ‘occupancy’ property may be set using the OEResidue::SetOccupancy method.

GetResidueNumber

int GetResidueNumber() const

Returns the ‘residue number’ property of a residue. The ‘residue number’ property may be set using the OEResidue::SetResidueNumber method.

GetSequenceID

int GetSequenceID() const

Returns the ‘sequence id’ property of a residue, if set by reading an mmCIF file. The ‘sequence id’ property may be set using the OEResidue::SetSequenceID method. The number of typically sequential starting from 1, contrary to the ‘residue number’ which typically follows the biological sequence numbering. If reading from mmCIF, this property is label_seq_id field from the mmCIF spec.

GetSecondaryStructure

int GetSecondaryStructure() const

Returns the protein ‘secondary structure’ property of a residue. The default value is zero. The ‘secondary structure’ property of a residue may be set using the OEResidue::SetSecondaryStructure method.

GetSerialNumber

int GetSerialNumber() const

Returns the ‘atom serial number’ property of an atom in a residue. The ‘atom serial number’ property may be set using the OEResidue::SetSerialNumber method.

IsHetAtom

bool IsHetAtom() const

Returns the ‘hetero atom’ property of an atom in a residue. The ‘hetero atom’ property may be set using the OEResidue::SetHetAtom method.

Note

A ‘hetero atom’ is distinguished from a ‘standard atom’ in a PDB file by using the record type HETATM rather than ATOM.

SetAlternateLocation

bool SetAlternateLocation(char v)

Sets the ‘alternate location’ property of an atom in a residue. The default value is a space character. The ‘alternate location’ property of an atom in a residue may be retrieved using the OEResidue::GetAlternateLocation method.

SetBFactor

bool SetBFactor(float v)

Sets the crystallographic ‘b-factor’ property of an atom in a residue. The default value is 0.0. The ‘b-factor’ property of an atom in a residue may be retrieved using the OEResidue::GetBFactor method.

SetChainID

bool SetChainID(char v)

This method is deprecated and should no longer be used. Instead, use OEResidue::SetExtChainID. Sets the ‘chain identifier’ property of a residue. This sets the same property as OEResidue::SetExtChainID The default value is a space character. The ‘chain identifier’ property of a residue may be retrieved using the OEResidue::GetExtChainID method.

SetExtChainID

bool SetExtChainID(string v)

Sets the ‘chain identifier’ property of a residue. The default value is a space character. The ‘chain identifier’ property of a residue may be retrieved using the OEResidue::GetExtChainID method.

SetSubChainID

bool SetSubChainID(string v)

Sets the ‘subchain identifier’ property of a residue. The default value is a space character. The ‘subchain identifier’ property of a residue may be retrieved using the OEResidue::GetSubChainID method.

SetFragmentNumber

bool SetFragmentNumber(int v)

Sets the fragment number property of a residue. Fragment numbers are integer indices that define the connected components of a macromolecule. When reading from a PDB file, the first atom is placed in fragment number 1. Each time a TER, END or ENDM record is encountered within a single connection table, the fragment number is incremented. Similarly, when writing a PDB file, a TER record is written between any consecutive pair of atoms with different fragment numbers. When reading from an mmCIF file, this number is read directly from the input as it is defined in that file spec. The default value is zero. The ‘fragment number’ property of a residue may be retrieved using the OEResidue::GetFragmentNumber method.

SetHetAtom

bool SetHetAtom(bool v)

Set the ‘hetero atom’ property of an atom in a residue. The default value is false. The ‘hetero atom’ property of an atom in a residue may be retrieved using the OEResidue::IsHetAtom method.

SetInsertCode

bool SetInsertCode(char v)

Sets the ‘insertion code’ of a residue. Insertion codes are single character suffices used to distinguish insertions when using a standardized residue numbering system. By default, this property contains a single space character ' '. The ‘insertion code’ property of a residue may be retrieved using the OEResidue::GetInsertCode method.

SetModelNumber

bool SetModelNumber(int v)

Sets the model number property of a residue. For NMR or molecular dynamics files, the model number contains the index of the NMR model or dynamics time-step within a file. The default value is 0. The ‘model number’ property of a residue may be retrieved using the OEResidue::GetModelNumber method.

SetName

bool SetName(const char *v)
bool SetName(const std::string &v)

Sets the ‘residue name’ property of a residue. The default value is MOL. The ‘residue name’ property of a residue may be retrieved using the OEResidue::GetName method.

SetOccupancy

bool SetOccupancy(float v)

Sets the crystallographic ‘occupancy’ property of an atom in a residue. The default value is 1.0. The ‘occupancy’ property of an atom in a molecule may be retrieved using the OEResidue::GetOccupancy method.

SetResidueNumber

bool SetResidueNumber(int v)

Sets the ‘residue number’ property of a residue. The default value is 1. The ‘residue number’ property of a residue may be retrieved using the OEResidue::GetResidueNumber method.

SetSequenceID

bool SetSequenceID(int v)

Sets the ‘sequence id’ property of a residue. The default value is -1. The ‘sequence id’ property of a residue may be retrieved using the OEResidue::GetSequenceID method.

SetSecondaryStructure

bool SetSecondaryStructure(int v)

Sets the protein ‘secondary structure’ property of a residue. The default value is 0. The ‘secondary structure’ property of a residue may be retrieved using the OEResidue::GetSecondaryStructure method.

SetSerialNumber

bool SetSerialNumber(int v)

Sets the ‘atom serial number’ property of an atom in a residue. The default value is 0. The ‘atom serial number’ property may be retrieved using the OEResidue::GetSerialNumber method.