biotite.structure.info.bonds_in_residue

biotite.structure.info.bonds_in_residue(res_name)[source]

Get a dictionary containing all atoms inside a given residue that form a bond.

Parameters
res_namestr

The up to 3-letter name of the residue to get the bonds for.

Returns
bondsdict (str -> int)

A dictionary that maps tuples of two atom names to their respective bond types (represented as integer). Empty, if the residue is unknown to the chemical components dictionary.

Warning

Treat the returned dictionary as immutable. Modifying the dictionary may lead to unexpected behavior. In other functionalities throughout Biotite that uses this function.

Examples

>>> bonds = bonds_in_residue("PHE")
>>> for atoms, bond_type_int in sorted(bonds.items()):
...     atom1, atom2 = sorted(atoms)
...     print(f"{atom1:3} + {atom2:3} -> {str(BondType(bond_type_int))}")
C   + O   -> BondType.DOUBLE
C   + OXT -> BondType.SINGLE
C   + CA  -> BondType.SINGLE
CA  + CB  -> BondType.SINGLE
CA  + HA  -> BondType.SINGLE
CB  + CG  -> BondType.SINGLE
CB  + HB2 -> BondType.SINGLE
CB  + HB3 -> BondType.SINGLE
CD1 + CE1 -> BondType.AROMATIC_SINGLE
CD1 + HD1 -> BondType.SINGLE
CD2 + CE2 -> BondType.AROMATIC_DOUBLE
CD2 + HD2 -> BondType.SINGLE
CE1 + CZ  -> BondType.AROMATIC_DOUBLE
CE1 + HE1 -> BondType.SINGLE
CE2 + CZ  -> BondType.AROMATIC_SINGLE
CE2 + HE2 -> BondType.SINGLE
CD1 + CG  -> BondType.AROMATIC_DOUBLE
CD2 + CG  -> BondType.AROMATIC_SINGLE
CZ  + HZ  -> BondType.SINGLE
CA  + N   -> BondType.SINGLE
H   + N   -> BondType.SINGLE
H2  + N   -> BondType.SINGLE
HXT + OXT -> BondType.SINGLE