Constants
=========

.. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.2/resource/_static/logo_source.svg
    :target: https://gitee.com/mindspore/mindscience/blob/r0.5/MindSPONGE/docs/api/api_python/constant.rst
    :alt: 查看源文件


.. 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映射至氨基酸类型
-----------------------

+----------------------------------+-------+-------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| 变量名                           | 类型  | 说明                                                                                                                          | 值                                                                                                         |
+==================================+=======+===============================================================================================================================+============================================================================================================+
| HHBLITS_AA_TO_ID                 | dict  | 使用hhblits约定,将氨基酸映射到对应编号,其中 B映射到D,J和O映射到X,U映射到C,Z映射到E。除此之外,其余氨基酸按字母顺序排序。 | `HHBLITS_AA_TO_ID <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/HHBLITS_AA_TO_ID.html>`_ |
+----------------------------------+-------+-------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| ID_TO_HHBLITS_AA                 | dict  | HHBLITS_AA_TO_ID的逆映射,将编号映射为氨基酸种类                                                                              | `ID_TO_HHBLITS_AA <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/ID_TO_HHBLITS_AA.html>`_ |
+----------------------------------+-------+-------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| MAP_HHBLITS_AATYPE_TO_OUR_AATYPE | tuple | 氨基酸按照hhblits约定编号到氨基酸标准编号映射表 ,其中标准编号即按照字母顺序对三字符的氨基酸进行排序。                        | (0, 4, 3, 6, 13, 7, 8, 9, 11, 10, 12, 2, 14, 5, 1, 15, 16, 19, 17, 18, 20, 21)                             |
+----------------------------------+-------+-------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+

其中检索得到的MSA先经过HHBLITS_AA_TO_ID从字母转换为编号,送进网络中时再通过 MAP_HHBLITS_AATYPE_TO_OUR_AATYPE转换为restype id,与网络中其他氨基酸编号保持一致。

氨基酸相关常量
--------------

+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| 变量名                       | 类型   | 说明                                                                                                                       | 值                                                                                                                                 |
+==============================+========+============================================================================================================================+====================================================================================================================================+
| residue_atom_renaming_swaps  | dict   | 20种氨基酸中有四种氨基酸的部分原子具有对称性。本表记录了每种氨基酸中具有对称性的原子映射信息。键为氨基酸类型,值为原子对。 | `residue_atom_renaming_swaps <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/residue_atom_renaming_swaps.html>`_   |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| residue_atoms                | dict   | 20种氨基酸对应原子种类,键是三字符的氨基酸名称,值为所包含的原子类型。                                                     | `residue_atoms <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/residue_atoms.html>`_                               |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| restype_name_to_atom14_names | dict   | 每种氨基酸最多包含14种原子类型,键是三字符的氨基酸名称,值为14种原子类型,不足14种用"''"补齐。                             | `restype_name_to_atom14_names <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/restype_name_to_atom14_names.html>`_ |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| restype_1to3                 | dict   | 氨基酸单字符对应的三字符表示,以单字符为键,三字符为值。                                                                   | `restype_1to3 <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/restype_1to3.html>`_                                 |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| restype_3to1                 | dict   | 氨基酸三字符对应的单字符表示,以三字符为键,单字符为值。                                                                   | `restype_3to1 <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/restype_3to1.html>`_                                 |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| restype_atom14_mask          | array  | 21种氨基酸(20种氨基酸与未知氨基酸 `UNK` )稠密编码的掩码。                                                                  | `restype_atom14_mask <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/restype_atom14_mask.html>`_                   |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| restype_atom37_mask          | array  | 21种氨基酸(20种氨基酸与未知氨基酸 `UNK` )稀疏编码的掩码。                                                                  | `restype_atom37_mask <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/restype_atom37_mask.html>`_                   |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| restype_num                  | scalar | 氨基酸种类总数,不包含未知氨基酸 `UNK` 。                                                                                  | 20                                                                                                                                 |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| resnames                     | list   | 氨基酸种类列表,使用三字符表示,共包含20种氨基酸和 `UNK` 表示的未知氨基酸。                                                | `resnames <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/resnames.html>`_                                         |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| resname_to_idx               | dict   | 氨基酸种类列表使用三字符表示下对应序号,顺序与 `resnames` 列表内氨基酸顺序一致,键为氨基酸三字符表示,值为序号。           | `resname_to_idx <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/resname_to_idx.html>`_                             |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| restypes                     | list   | 氨基酸种类列表,使用单字符表示,共包含20种氨基酸,不包含未知氨基酸。                                                       | `restypes <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/restypes.html>`_                                         |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| restype_order                | dict   | 氨基酸种类列表使用单字符表示下对应序号,顺序与 `restypes` 列表内氨基酸顺序一致,键为氨基酸单字符表示,值为序号。           | `restype_order <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/restype_order.html>`_                               |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| restypes_with_x              | list   | 氨基酸种类列表,使用单字符表示,共包含20种氨基酸和 `UNK` 表示的未知氨基酸。                                                | `restypes_with_x <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/restypes_with_x.html>`_                           |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| restype_order_with_x         | dict   | 氨基酸种类列表使用单字符表示下对应序号,顺序与 `restypes_with_x` 列表内氨基酸顺序一致,键为氨基酸单字符表示,值为序号。    | `restype_order_with_x <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/restype_order_with_x.html>`_                 |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| order_restype_with_x         | dict   | 序号对应使用单字符表示下氨基酸种类列表,顺序与 `restypes_with_x` 列表内氨基酸顺序一致,键为序号,值为氨基酸单字符表示。    | `order_restype_with_x <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/order_restype_with_x.html>`_                 |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+
| restypes_with_x_and_gap      | list   | 氨基酸种类列表,使用单字符表示,共包含20种氨基酸, `UNK` 表示的未知氨基酸和gap表示的不在列表内的氨基酸。                   | `restypes_with_x_and_gap <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/restypes_with_x_and_gap.html>`_           |
+------------------------------+--------+----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+

氨基酸中相关原子常量
--------------------

+---------------+--------+------------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| 变量名        | 类型   | 说明                                                             | 值                                                                                             |
+===============+========+==================================================================+================================================================================================+
| atom_order    | dict   | 氨基酸所有原子名称及对应的索引编码,键是原子名称,值是索引编码。 | `atom_order <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/atom_order.html>`_ |
+---------------+--------+------------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| atom_type_num | scalar | 氨基酸所有原子数目。                                             | 37                                                                                             |
+---------------+--------+------------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| atom_types    | list   | 氨基酸所有原子名称。                                             | `atom_types <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/atom_types.html>`_ |
+---------------+--------+------------------------------------------------------------------+------------------------------------------------------------------------------------------------+

氨基酸相关键长键角经验常量
--------------------------

+------------------------------------+--------+---------------------------------------------------------------------------------------------------------------+-------------------+
| 变量名                             | 类型   | 说明                                                                                                          | 值                |
+====================================+========+===============================================================================================================+===================+
| between_res_bond_length_c_n        | list   | 氨基酸肽键长度,单位是埃(Å),第一个值表示除脯氨酸之外的其他氨基酸的肽键长度,第二个表示脯氨酸的肽键长度。   | [1.329, 1.341]    |
+------------------------------------+--------+---------------------------------------------------------------------------------------------------------------+-------------------+
| between_res_bond_length_stddev_c_n | list   | 氨基酸肽键长度的标准差,单位是埃(Å),第一个值表示表示除脯氨酸之外的其他氨基酸,第二个表示脯氨酸。           | [0.014, 0.016]    |
+------------------------------------+--------+---------------------------------------------------------------------------------------------------------------+-------------------+
| between_res_cos_angles_c_n_ca      | list   | 氨基酸 :math:`C-N-C\alpha-(C+1)` 之间形成的二面角的余弦值,第一个值是余弦值的均值,第二个值是余弦值的标准差。 | [-0.5203, 0.0353] |
+------------------------------------+--------+---------------------------------------------------------------------------------------------------------------+-------------------+
| between_res_cos_angles_ca_c_n      | list   | 氨基酸 :math:`N-C\alpha-C-(N-1)` 之间形成的二面角的余弦值,第一个值是余弦值的均值,第二个值是余弦值的标准差。 | [-0.4473, 0.0311] |
+------------------------------------+--------+---------------------------------------------------------------------------------------------------------------+-------------------+
| ca_ca                              | scalar | 相邻氨基酸 :math:`C\alpha-C\alpha` 之间的距离,单位是埃(Å)。                                                | 3.80209737096     |
+------------------------------------+--------+---------------------------------------------------------------------------------------------------------------+-------------------+

范德华原子半径
--------------

+----------------------+------+------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
| 变量名               | 类型 | 说明                                                                   | 值                                                                                                                 |
+======================+======+========================================================================+====================================================================================================================+
| van_der_waals_radius | dict | C原子,N原子,O原子和S原子的范德华半径,键为原子名称,值为范德华半径。 | `van_der_waals_radius <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/van_der_waals_radius.html>`_ |
+----------------------+------+------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+

扭转角相关常量
---------------

+---------------------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+
| 变量名              | 类型 | 说明                                                                                                                                                                                                 | 值                                                                                                               |
+=====================+======+======================================================================================================================================================================================================+==================================================================================================================+
| chi_angles_atoms    | dict | 氨基酸中所有原子在对应侧链扭转角编码中的索引,键为氨基酸原子对(tuple)如('ARG', 'N') ,值为该氨基酸中原子所对应侧链编码 `chi_angles_atoms` 中的二维数组索引。                                         | `chi_angles_atoms <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/chi_angles_atoms.html>`_       |
+---------------------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+
| chi_angles_mask     | list | 氨基酸中是否存在相应扭转角的掩码,二维数组,第一维长度20,代表20种不同的氨基酸,与 `restype_order` 的顺序一致;第二维长度4,每个氨基酸最多有四个侧链扭转角,值为1.0代表该扭转角存在,0.0代表不存在。 | `chi_angles_mask <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/chi_angles_mask.html>`_         |
+---------------------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+
| chi_groups_for_atom | dict | 氨基酸中所有原子在对应侧链扭转角编码中的索引。                                                                                                                                                       | `chi_groups_for_atom <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/chi_groups_for_atom.html>`_ |
+---------------------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+
| chi_pi_periodic     | list | 氨基酸相应扭转角中是否具有对称不变性,即对应扭转角旋转180度不影响整体三维结构。                                                                                                                      | `chi_pi_periodic <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/chi_pi_periodic.html>`_         |
+---------------------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+

氨基酸局部坐标系相关常量
------------------------

+--------------------------------------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| 变量名                               | 类型  | 说明                                                                                                                                                           | 值                                                                                                                                                 |
+======================================+=======+================================================================================================================================================================+====================================================================================================================================================+
| restype_atom14_rigid_group_positions | array | 21种氨基酸按照稠密编码方式,每种氨基酸中所包含原子在其所属的刚体变换组的局部坐标系中的坐标。shape为 :math:`(21, 37, 3)` 。                                     | `restype_atom14_rigid_group_positions <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/restype_atom14_rigid_group_positions.html>`_ |
+--------------------------------------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| restype_atom14_to_rigid_group        | array | 21种氨基酸按照稠密编码方式,每种氨基酸中所包含原子所属的刚体变换组, 每个原子所属的刚体变换组从 `rigid_group_atom_positions` 中获取。                          | `restype_atom14_to_rigid_group <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/restype_atom14_to_rigid_group.html>`_               |
+--------------------------------------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| restype_atom37_rigid_group_positions | array | 21种氨基酸按照稀疏编码方式,每种氨基酸中所包含原子在其所属的刚体变换组的局部坐标系中的坐标。shape为 :math:`(21, 37, 3)` 。                                     | `restype_atom37_rigid_group_positions <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/restype_atom37_rigid_group_positions.html>`_ |
+--------------------------------------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| restype_atom37_to_rigid_group        | array | 21种氨基酸按照稀疏编码方式,每种氨基酸中所包含原子所属的刚体变换组, 每个原子所属的刚体变换组从 `rigid_group_atom_positions` 中获取。                          | `restype_atom37_to_rigid_group <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/restype_atom37_to_rigid_group.html>`_               |
+--------------------------------------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| restype_rigid_group_default_frame    | array | 21种氨基酸的每个刚体变换组的仿射变换矩阵,即从各个刚体变换组的局部坐标系到之前相邻的刚体变换组的局部坐标系的坐标变换矩阵                                       | `restype_rigid_group_default_frame <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/restype_rigid_group_default_frame.html>`_       |
+--------------------------------------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| rigid_group_atom_positions           | dict  | 21种氨基酸中原子所属于的刚体变换组以及坐标,键为氨基酸三字符表示,值为每种氨基酸中所包含原子所属的刚体变换组,以及它在其所属的刚体变换组的局部坐标系中的坐标。 | `rigid_group_atom_positions <https://www.mindspore.cn/mindsponge/docs/zh-CN/master/constant/rigid_group_atom_positions.html>`_                     |
+--------------------------------------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+