mindsponge.data.atom37_to_frames

mindsponge.data.atom37_to_frames(aatype, all_atom_positions, all_atom_mask, is_affine=False)[source]

Computes the torsion angle of up to 8 rigid groups for each residue, shape is \([N_{res}, 8, 12]\), where 8 is indicates that each residue can be divided into up to 8 rigid groups according to the dependence of the atom on the torsion angle, there are 1 backbone frame and 7 side-chain frames. For the meaning of 12 ,the first 9 elements are the 9 components of rotation matrix, the last 3 elements are the 3 component of translation matrix.

Parameters
  • aatype (numpy.array) – Amino acid sequence, \([N_{res}]\) .

  • all_atom_positions (numpy.array) – The coordinates of all atoms, presented as atom37, \([N_{res}, 37, 3]\).

  • all_atom_mask (numpy.array) – Mask of all atomic coordinates, \([N_{res}, 37]\).

  • is_affine (bool) – Whether to perform affine, the default value is False.

Returns

Dictionary, the specific content is as follows.

  • rigidgroups_gt_frames (numpy.array) - The torsion angle of the 8 rigid body groups for each residue, \([N_{res}, 8, 12]\).

  • rigidgroups_gt_exists (numpy.array) - The mask of rigidgroups_gt_frames denoting whether the rigid body group exists according to the experiment, \([N_{res}, 8]\).

  • rigidgroups_group_exists (numpy.array) - Mask denoting whether given group is in principle present for given amino acid type, \([N_{res}, 8]\) .

  • rigidgroups_group_is_ambiguous (numpy.array) - Indicates that the position is chiral symmetry, \([N_{res}, 8]\) .

  • rigidgroups_alt_gt_frames (numpy.array) - 8 Frames with alternative atom renaming corresponding to ‘all_atom_positions’ represented as flat 12 dimensional array \([N_{res}, 8, 12]\) .

  • backbone_affine_tensor (numpy.array) - The translation and rotation of the local coordinates of each amino acid relative to the global coordinates, \([N_{res}, 7]\) , for the last dimension, the first 4 elements are the affine tensor which contains the rotation information, the last 3 elements are the translations in space.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import numpy as np
>>> from mindsponge.data import atom37_to_frames
>>> from mindspore import dtype as mstype
>>> from mindspore import Tensor
>>> aatype = np.ones(193,dtype=np.int32)
>>> all_atom_positions = np.ones((193,37,3),dtype=np.float32)
>>> all_atom_mask = np.ones((193,37),dtype=np.int32)
>>> result = atom37_to_frames(aatype,all_atom_positions,all_atom_mask)
>>> for key in result.keys():
>>>     print(key,result[key].shape)
rigidgroups_gt_frames (193, 8, 12)
rigidgroups_gt_exists (193, 8)
rigidgroups_group_exists (193, 8)
rigidgroups_group_is_ambiguous (193, 8)
rigidgroups_alt_gt_frames (193, 8, 12)