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() -> OEResidue

Default constructor.

OEResidue(rhs: OEResidue) -> OEResidue

Copy constructor.

operator bool

IsValid() -> bool

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

GetAlternateLocation

GetAlternateLocation() -> str

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

GetBFactor

GetBFactor() -> float

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

GetChainID() -> str

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

GetExtChainID() -> str

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

GetSubChainID() -> str

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

GetFragmentNumber() -> int

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

GetInsertCode() -> str

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

GetModelNumber() -> int

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

GetName() -> str

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

GetOccupancy

GetOccupancy() -> float

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

GetResidueNumber() -> int

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

GetEntityID

GetEntityID() -> str

Returns the ‘entity ID’ property of a residue. The ‘entity ID’ property may be set using the OEResidue.SetEntityID method.

GetSequenceID

GetSequenceID() -> int

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

GetSecondaryStructure() -> int

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

GetSerialNumber() -> int

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

IsHetAtom() -> bool

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

SetAlternateLocation(v: str) -> bool

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

SetBFactor(v: float) -> bool

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

SetChainID(v: str) -> bool

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

SetExtChainID(v: str) -> bool

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

SetSubChainID(v: str) -> bool

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

SetFragmentNumber(v: int) -> bool

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

SetHetAtom(v: bool) -> bool

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

SetInsertCode(v: str) -> bool

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

SetModelNumber(v: int) -> bool

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

SetName(v: str) -> bool

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

SetOccupancy(v: float) -> bool

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

SetResidueNumber(v: int) -> bool

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.

SetEntityID

SetEntityID(v: str) -> bool

Sets the ‘Entity ID’ property of a residue. The default value is a single space character, ' '. The ‘Entity ID’ property of a residue may be retrieved using the OEResidue.GetEntityID method.

SetSequenceID

SetSequenceID(v: int) -> bool

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

SetSecondaryStructure(v: int) -> bool

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

SetSerialNumber(v: int) -> bool

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.