Bio.PDB.Chain module

Chain class, used in Structure objects.

class Bio.PDB.Chain.Chain(id)

Bases: Bio.PDB.Entity.Entity

Define Chain class.

Chain is an object of type Entity, stores residues and includes a method to access atoms from residues.

__init__(self, id)

Initialize the class.

__gt__(self, other)

Validate if id is greater than other.id.

__ge__(self, other)

Validate if id is greater or equal than other.id.

__lt__(self, other)

Validate if id is less than other.id.

__le__(self, other)

Validate if id is less or equal than other id.

__getitem__(self, id)

Return the residue with given id.

The id of a residue is (hetero flag, sequence identifier, insertion code). If id is an int, it is translated to (” “, id, ” “) by the _translate_id method.

Arguments:
  • id - (string, int, string) or int

__contains__(self, id)

Check if a residue with given id is present in this chain.

Arguments:
  • id - (string, int, string) or int

__delitem__(self, id)

Delete item.

Arguments:
  • id - (string, int, string) or int

__repr__(self)

Return the chain identifier.

get_unpacked_list(self)

Return a list of undisordered residues.

Some Residue objects hide several disordered residues (DisorderedResidue objects). This method unpacks them, ie. it returns a list of simple Residue objects.

has_id(self, id)

Return 1 if a residue with given id is present.

The id of a residue is (hetero flag, sequence identifier, insertion code).

If id is an int, it is translated to (” “, id, ” “) by the _translate_id method.

Arguments:
  • id - (string, int, string) or int

get_residues(self)

Return residues.

get_atoms(self)

Return atoms from residues.

atom_to_internal_coordinates(self, verbose: bool = False) → None

Create/update internal coordinates from Atom X,Y,Z coordinates.

Internal coordinates are bond length, angle and dihedral angles.

Parameters

bool (verbose) – default False describe runtime problems

internal_to_atom_coordinates(self, verbose: bool = False, start: Union[int, NoneType] = None, fin: Union[int, NoneType] = None)

Create/update atom coordinates from internal coordinates.

Parameters

bool (verbose) – default False describe runtime problems

Param

start, fin lists sequence position, insert code for begin, end of subregion to process

Raises

Exception – if any chain does not have .pic attribute