residue#

biotite.structure.info.residue(res_name, allow_missing_coord=False)[source]#

Get an atom array, representing the residue with the given name.

This atom array includes proper values for the residue_name, hetero, atom_name, element and charge annotation arrays and bonds and coordinates.

Parameters:
res_namestr

The up to 3-letter name of the residue.

allow_missing_coordbool, optional

Whether to allow missing coordinate values in the residue. If True, these will be represented as nan values. If False, a ValueError is raised when missing coordinates are encountered.

Returns:
atom_arrayAtomArray

The atom array described by res_name.

Examples

>>> alanine = residue("ALA")
>>> # Atoms and geometry
>>> print(alanine)
            0  ALA N      N        -0.966    0.493    1.500
            0  ALA CA     C         0.257    0.418    0.692
            0  ALA C      C        -0.094    0.017   -0.716
            0  ALA O      O        -1.056   -0.682   -0.923
            0  ALA CB     C         1.204   -0.620    1.296
            0  ALA OXT    O         0.661    0.439   -1.742
            0  ALA H      H        -1.383   -0.425    1.482
            0  ALA H2     H        -0.676    0.661    2.452
            0  ALA HA     H         0.746    1.392    0.682
            0  ALA HB1    H         1.459   -0.330    2.316
            0  ALA HB2    H         0.715   -1.594    1.307
            0  ALA HB3    H         2.113   -0.676    0.697
            0  ALA HXT    H         0.435    0.182   -2.647
>>> # Bonds
>>> print(alanine.atom_name[alanine.bonds.as_array()[:,:2]])
[['N' 'CA']
 ['N' 'H']
 ['N' 'H2']
 ['CA' 'C']
 ['CA' 'CB']
 ['CA' 'HA']
 ['C' 'O']
 ['C' 'OXT']
 ['CB' 'HB1']
 ['CB' 'HB2']
 ['CB' 'HB3']
 ['OXT' 'HXT']]