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, 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.
Notes
The returned values are cached for faster access in subsequent calls.
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} -> {BondType(bond_type_int).name}") C + O -> DOUBLE C + OXT -> SINGLE C + CA -> SINGLE CA + CB -> SINGLE CA + HA -> SINGLE CB + CG -> SINGLE CB + HB2 -> SINGLE CB + HB3 -> SINGLE CD1 + CE1 -> AROMATIC_SINGLE CD1 + HD1 -> SINGLE CD2 + CE2 -> AROMATIC_DOUBLE CD2 + HD2 -> SINGLE CE1 + CZ -> AROMATIC_DOUBLE CE1 + HE1 -> SINGLE CE2 + CZ -> AROMATIC_SINGLE CE2 + HE2 -> SINGLE CD1 + CG -> AROMATIC_DOUBLE CD2 + CG -> AROMATIC_SINGLE CZ + HZ -> SINGLE CA + N -> SINGLE H + N -> SINGLE H2 + N -> SINGLE HXT + OXT -> SINGLE