Constants
=========

.. toctree::
   :hidden:

   constant/atom_order
   constant/atom_types
   constant/chi_angles_atoms
   constant/chi_angles_mask
   constant/chi_groups_for_atom
   constant/chi_pi_periodic
   constant/HHBLITS_AA_TO_ID
   constant/ID_TO_HHBLITS_AA
   constant/order_restype_with_x
   constant/residue_atoms
   constant/residue_atom_renaming_swaps
   constant/resnames
   constant/resname_to_idx
   constant/restypes
   constant/restypes_with_x
   constant/restypes_with_x_and_gap
   constant/restype_1to3
   constant/restype_3to1
   constant/restype_atom14_mask
   constant/restype_atom14_rigid_group_positions
   constant/restype_atom14_to_rigid_group
   constant/restype_atom37_mask
   constant/restype_atom37_rigid_group_positions
   constant/restype_atom37_to_rigid_group
   constant/restype_name_to_atom14_names
   constant/restype_order
   constant/restype_order_with_x
   constant/restype_rigid_group_default_frame
   constant/rigid_group_atom_positions
   constant/van_der_waals_radius

HHBLITS Mapping to Amino Acid Type
----------------------------------

+----------------------------------+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+
| Name                             | Type  | Description                                                                                                                                                           | Value                                                                                                   |
+==================================+=======+=======================================================================================================================================================================+=========================================================================================================+
| HHBLITS_AA_TO_ID                 | dict  | Use the hhblits convention to map amino acids to corresponding numbers. Map B to D. Map J and O to X. Map U to C. Map Z to E. other letters are numbered in sequence. | `HHBLITS_AA_TO_ID <https://www.mindspore.cn/mindsponge/docs/en/master/constant/HHBLITS_AA_TO_ID.html>`_ |
+----------------------------------+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+
| ID_TO_HHBLITS_AA                 | dict  | Inverse mapping of `HHBLITS_AA_TO_ID`, mapping the number to the amino acid type.                                                                                     | `ID_TO_HHBLITS_AA <https://www.mindspore.cn/mindsponge/docs/en/master/constant/ID_TO_HHBLITS_AA.html>`_ |
+----------------------------------+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+
| MAP_HHBLITS_AATYPE_TO_OUR_AATYPE | tuple | Mapping table from hhblits convention number to standard amino acid number, where the standard number is the alphabetical order of amino acids with three characters. | (0, 4, 3, 6, 13, 7, 8, 9, 11, 10, 12, 2, 14, 5, 1, 15, 16, 19, 17, 18, 20, 21)                          |
+----------------------------------+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+

The obtained MSA is converted from a letter to a number through `HHBLITS_AA_TO_ID` , and then converted to a restype id through `MAP_HHBLITS_AATYPE_TO_OUR_AATYPE` when it is sent to the network, consistent with other amino acid numbers in the network.

Amino Acid Correlation Constants
--------------------------------

+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| Name                         | Type   | Description                                                                                                                                                                                                                       | Value                                                                                                                           |
+==============================+========+===================================================================================================================================================================================================================================+=================================================================================================================================+
| residue_atom_renaming_swaps  | dict   | Four of the 20 amino acids have partial atoms that are symmetrical. This dict records the mapping information of atomic pairs with symmetric invariance in each amino acid.                                                       | `residue_atom_renaming_swaps <https://www.mindspore.cn/mindsponge/docs/en/master/constant/residue_atom_renaming_swaps.html>`_   |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| residue_atoms                | dict   | 20 types of amino acids correspond to their atom types.                                                                                                                                                                           | `residue_atoms <https://www.mindspore.cn/mindsponge/docs/en/master/constant/residue_atoms.html>`_                               |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| restype_name_to_atom14_names | dict   | Atom types each amino acid contains. If there are fewer than 14, use empty type "''" to make up for it. The actual atoms are of the same type as `residue_atoms` .                                                                | `restype_name_to_atom14_names <https://www.mindspore.cn/mindsponge/docs/en/master/constant/restype_name_to_atom14_names.html>`_ |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| restype_1to3                 | dict   | The mapping information of amino acids represented by one characters with amino acids represented by three characters. Key is amino acids represented by one characters and value is amino acids represented by three characters. | `restype_1to3 <https://www.mindspore.cn/mindsponge/docs/en/master/constant/restype_1to3.html>`_                                 |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| restype_3to1                 | dict   | The mapping information of amino acids represented by three characters with amino acids represented by one characters. Key is amino acids represented by three characters and value is amino acids represented by one characters. | `restype_3to1 <https://www.mindspore.cn/mindsponge/docs/en/master/constant/restype_3to1.html>`_                                 |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| restype_atom14_mask          | array  | Mask of densely encoding of 21 types of amino acid (20 amino acid types and 1 unknown amino acid `UNK` ).                                                                                                                         | `restype_atom14_mask <https://www.mindspore.cn/mindsponge/docs/en/master/constant/restype_atom14_mask.html>`_                   |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| restype_atom37_mask          | array  | Mask of sparse encoding of 21 types of amino acid (20 amino acid types and 1 unknown amino acid `UNK` ).                                                                                                                          | `restype_atom37_mask <https://www.mindspore.cn/mindsponge/docs/en/master/constant/restype_atom37_mask.html>`_                   |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| restype_num                  | scalar | Total number of amino acid type, excluding unknown amino acid `UNK` .                                                                                                                                                             | 20                                                                                                                              |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| resnames                     | list   | List of amino acid types represented by three characters, including 20 types of amino acid and one type of unknown amino acid represented by `UNK` .                                                                              | `resnames <https://www.mindspore.cn/mindsponge/docs/en/master/constant/resnames.html>`_                                         |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| resname_to_idx               | dict   | Index of the amino acid types represented by three characters. Order is the same as the order of amino acids in the list of `resnames`.                                                                                           | `resname_to_idx <https://www.mindspore.cn/mindsponge/docs/en/master/constant/resname_to_idx.html>`_                             |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| restypes                     | list   | List of amino acids, including a total of 20 amino acids, excluding `UNK`.                                                                                                                                                        | `restypes <https://www.mindspore.cn/mindsponge/docs/en/master/constant/restypes.html>`_                                         |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| restype_order                | dict   | The index of amino acid. Order is consistent with the order of amino acid in the list of `restypes` .                                                                                                                             | `restype_order <https://www.mindspore.cn/mindsponge/docs/en/master/constant/restype_order.html>`_                               |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| restypes_with_x              | list   | List of amino acids including 'UNK'. 'UNK' means unknown amino acid and is represented by 'X'. Totally (20 + 1) types of amino acid are in the list.                                                                              | `restypes_with_x <https://www.mindspore.cn/mindsponge/docs/en/master/constant/restypes_with_x.html>`_                           |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| restype_order_with_x         | dict   | Index of the amino acid types represented by one characters. Order is the same as the order of amino acids in the list of `restypes_with_x`.                                                                                      | `restype_order_with_x <https://www.mindspore.cn/mindsponge/docs/en/master/constant/restype_order_with_x.html>`_                 |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| order_restype_with_x         | dict   | Index corresponds to the amino acid. Order is the same as the order of amino acids in `restypes` , where '20' represents the unknown amino acid number.                                                                           | `order_restype_with_x <https://www.mindspore.cn/mindsponge/docs/en/master/constant/order_restype_with_x.html>`_                 |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| restypes_with_x_and_gap      | list   | List of amino acid including `GAP` and `UNK` . `GAP` is represented by `-` . `UNK` means unknown amino acid and is represented by `X`. Totally (20 + 1 + 1) types of amino acid are in the list.                                  | `restypes_with_x_and_gap <https://www.mindspore.cn/mindsponge/docs/en/master/constant/restypes_with_x_and_gap.html>`_           |
+------------------------------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+

Constants Associated with Atoms in Amino Acids
----------------------------------------------

+---------------+--------+-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+
| Name          | Type   | Description                                                                                           | Value                                                                                       |
+===============+========+=======================================================================================================+=============================================================================================+
| atom_order    | dict   | The name of all atoms of the amino acid and their index. Key is the atom name and value is its index. | `atom_order <https://www.mindspore.cn/mindsponge/docs/en/master/constant/atom_order.html>`_ |
+---------------+--------+-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+
| atom_type_num | scalar | The total number of atoms in an amino acid.                                                           | 37                                                                                          |
+---------------+--------+-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+
| atom_types    | list   | List of names of all atoms of amino acid, including 37 types of atom.                                 | `atom_types <https://www.mindspore.cn/mindsponge/docs/en/master/constant/atom_types.html>`_ |
+---------------+--------+-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+

Empirical Constants Related to Amino Acid Bond Length and Bond Angle
--------------------------------------------------------------------

+------------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------+
| Name                               | Type   | Description                                                                                                                                                                                        | Value             |
+====================================+========+====================================================================================================================================================================================================+===================+
| between_res_bond_length_c_n        | list   | Amino acid peptide bond length. Unit is Å. The first value indicates the peptide bond length of amino acids other than proline, and the second value indicates the peptide bond length of proline. | [1.329, 1.341]    |
+------------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------+
| between_res_bond_length_stddev_c_n | list   | Standard deviation of amino acid peptide bond length. Unit is Å. The first value represents amino acids other than proline, and the second represents proline.                                     | [0.014, 0.016]    |
+------------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------+
| between_res_cos_angles_c_n_ca      | list   | The cosine of the dihedral Angle formed between amino acids :math:`C-N-C\alpha-(C+1)` , The first value is the mean of the cosine, and the second value is the standard deviation of the cosine.   | [-0.5203, 0.0353] |
+------------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------+
| between_res_cos_angles_ca_c_n      | list   | The cosine of the dihedral Angle formed between amino acids :math:`N-C\alpha-C-(N-1)` , The first value is the mean of the cosine, and the second value is the standard deviation of the cosine.   | [-0.4473, 0.0311] |
+------------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------+
| ca_ca                              | scalar | The distance between adjacent amino acids :math:`C\alpha-C\alpha`. Unit is Å.                                                                                                                      | 3.80209737096     |
+------------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------+

Van der Waals Atomic Radius
---------------------------

+----------------------+------+----------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+
| Name                 | Type | Description                                                          | Value                                                                                                           |
+======================+======+======================================================================+=================================================================================================================+
| van_der_waals_radius | dict | Van der Waals radius of atom `C`, atom `N` , atom `O` and atom `S` . | `van_der_waals_radius <https://www.mindspore.cn/mindsponge/docs/en/master/constant/van_der_waals_radius.html>`_ |
+----------------------+------+----------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+

Constants Associated with torsion angle
---------------------------------------

+---------------------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+
| Name                | Type | Description                                                                                                                                                                                                                                                                                                                       | Value                                                                                                         |
+=====================+======+===================================================================================================================================================================================================================================================================================================================================+===============================================================================================================+
| chi_angles_atoms    | dict | The name of the atomic group that determines the side chain torsion angle in amino acids. Each amino acid has a maximum of four side chain torsion angles, among which ALA and GLY have no side chain torsion angle. Each torsion angle is determined by the position of 4 atomic groups (Dihedral Angle).                        | `chi_angles_atoms <https://www.mindspore.cn/mindsponge/docs/en/master/constant/chi_angles_atoms.html>`_       |
+---------------------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+
| chi_angles_mask     | list | If there is a mask of corresponding torsion angle in the amino acid. A two-dimensional array, first dimension is 20, consistent with the order of 'restype_order'. The second dimension has a length of 4, with a value of 1.0 indicating the existence of the torsion angle and 0.0 indicating the absence of the torsion angle. | `chi_angles_mask <https://www.mindspore.cn/mindsponge/docs/en/master/constant/chi_angles_mask.html>`_         |
+---------------------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+
| chi_groups_for_atom | dict | Indexes of all atoms in amino acids in the corresponding side chain torsion angle encoding, where the side chain torsion angle encodings are shown in 'chi_angles_atoms'.                                                                                                                                                         | `chi_groups_for_atom <https://www.mindspore.cn/mindsponge/docs/en/master/constant/chi_groups_for_atom.html>`_ |
+---------------------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+
| chi_pi_periodic     | list | Whether torsion angles in amino acids is symmetric invariant, that is, rotating the corresponding torsion angle 180 degrees does not affect the overall three-dimensional structure.                                                                                                                                              | `chi_pi_periodic <https://www.mindspore.cn/mindsponge/docs/en/master/constant/chi_pi_periodic.html>`_         |
+---------------------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+

Constants Associated with Local Coordinate System in Amino Acids
----------------------------------------------------------------

+--------------------------------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
| Name                                 | Type  | Description                                                                                                                                                                                                                                                                  | Value                                                                                                                                           |
+======================================+=======+==============================================================================================================================================================================================================================================================================+=================================================================================================================================================+
| restype_atom14_rigid_group_positions | array | Densely encoding 21 amino acid types. Each amino acid contains the coordinates of the atoms in the local coordinate system of the rigid group to which it belongs. Shape is :math:`(21, 14, 3)` .                                                                            | `restype_atom14_rigid_group_positions <https://www.mindspore.cn/mindsponge/docs/en/master/constant/restype_atom14_rigid_group_positions.html>`_ |
+--------------------------------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
| restype_atom14_to_rigid_group        | array | Densely encoding 21 types of amino acid. Each amino acid contains the rigid group the atoms belong to. Shape is :math:`(21, 14)` .                                                                                                                                           | `restype_atom14_to_rigid_group <https://www.mindspore.cn/mindsponge/docs/en/master/constant/restype_atom14_to_rigid_group.html>`_               |
+--------------------------------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
| restype_atom37_rigid_group_positions | array | Sparse encoding 21 amino acid types. Each amino acid contains the coordinates of the atoms in the local coordinate system of the rigid group to which it belongs. Shape is :math:`(21, 37, 3)` .                                                                             | `restype_atom37_rigid_group_positions <https://www.mindspore.cn/mindsponge/docs/en/master/constant/restype_atom37_rigid_group_positions.html>`_ |
+--------------------------------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
| restype_atom37_to_rigid_group        | array | Sparse encoding 21 types of amino acid. Each amino acid contains the rigid group the atoms belong to. Shape is :math:`(21, 37)` .                                                                                                                                            | `restype_atom37_to_rigid_group <https://www.mindspore.cn/mindsponge/docs/en/master/constant/restype_atom37_to_rigid_group.html>`_               |
+--------------------------------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
| restype_rigid_group_default_frame    | array | Affine transformation matrix of each rigid group of 21 amino acids, that is, the coordinate transformation matrix from the local coordinate system of each rigid group to the local coordinate system of the previous adjacent rigid group. Shape is :math:`(21, 8, 4, 4)` . | `restype_rigid_group_default_frame <https://www.mindspore.cn/mindsponge/docs/en/master/constant/restype_rigid_group_default_frame.html>`_       |
+--------------------------------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
| rigid_group_atom_positions           | dict  | The coordinates of the atoms in each amino acid in the local coordinate system of rigid group to which the atom belongs.                                                                                                                                                     | `rigid_group_atom_positions <https://www.mindspore.cn/mindsponge/docs/en/master/constant/rigid_group_atom_positions.html>`_                     |
+--------------------------------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+