Bio.PDB.Residue module

Residue class, used by Structure objects.

class Bio.PDB.Residue.Residue(id, resname, segid)

Bases: Entity[Chain, Atom]

Represents a residue. A Residue object stores atoms.

__init__(id, resname, segid)

Initialize the class.

__repr__()

Return the residue full id.

strictly_equals(other: _ResidueT, compare_coordinates: bool = False) bool

Compare this residue to the other residue using a strict definition of equality.

The residues are equal if they have the same name, identifier, and their constituent atoms are strictly equal.

Parameters:
  • other (Residue) – The residue to compare this residue to

  • compare_coordinates (bool) – Whether to compare the coordinates of the atoms

Returns:

Whether the residues are strictly equal

Return type:

bool

add(atom)

Add an Atom object.

Checks for adding duplicate atoms, and raises a PDBConstructionException if so.

flag_disordered()

Set the disordered flag.

is_disordered()

Return 1 if the residue contains disordered atoms.

get_resname()

Return the residue name.

get_unpacked_list()

Return the list of all atoms, unpack DisorderedAtoms.

get_segid()

Return the segment identifier.

get_atoms()

Return atoms.

__orig_bases__ = (Bio.PDB.Entity.Entity[ForwardRef('Chain'), ForwardRef('Atom')],)
__parameters__ = ()
class Bio.PDB.Residue.DisorderedResidue(id)

Bases: DisorderedEntityWrapper

DisorderedResidue is a wrapper around two or more Residue objects.

It is used to represent point mutations (e.g. there is a Ser 60 and a Cys 60 residue, each with 50 % occupancy).

__init__(id)

Initialize the class.

__repr__()

Return disordered residue full identifier.

add(atom)

Add atom to residue.

sort()

Sort the atoms in the child Residue objects.

disordered_add(residue)

Add a residue object and use its resname as key.

Arguments:
  • residue - Residue object

disordered_remove(resname)

Remove a child residue from the DisorderedResidue.

Arguments:
  • resname - name of the child residue to remove, as a string.