Document feedback

Question document fragment

When a question document fragment contains a formula, it is displayed as a space.

Submission type
issue

It's a little complicated...

I'd like to ask someone.

PR

Just a small problem.

I can fix it online!

Please select the submission type

Problem type
Specifications and Common Mistakes

- Specifications and Common Mistakes:

- Misspellings or punctuation mistakes,incorrect formulas, abnormal display.

- Incorrect links, empty cells, or wrong formats.

- Chinese characters in English context.

- Minor inconsistencies between the UI and descriptions.

- Low writing fluency that does not affect understanding.

- Incorrect version numbers, including software package names and version numbers on the UI.

Usability

- Usability:

- Incorrect or missing key steps.

- Missing main function descriptions, keyword explanation, necessary prerequisites, or precautions.

- Ambiguous descriptions, unclear reference, or contradictory context.

- Unclear logic, such as missing classifications, items, and steps.

Correctness

- Correctness:

- Technical principles, function descriptions, supported platforms, parameter types, or exceptions inconsistent with that of software implementation.

- Incorrect schematic or architecture diagrams.

- Incorrect commands or command parameters.

- Incorrect code.

- Commands inconsistent with the functions.

- Wrong screenshots.

- Sample code running error, or running results inconsistent with the expectation.

Risk Warnings

- Risk Warnings:

- Lack of risk warnings for operations that may damage the system or important data.

Content Compliance

- Content Compliance:

- Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions.

- Copyright infringement.

Please select the type of question

Problem description

Describe the bug so that we can quickly locate the problem.

mindsponge.data_transform.atom37_to_torsion_angles

View Source On Gitee
mindsponge.data_transform.atom37_to_torsion_angles(aatype: np.ndarray, all_atom_pos: np.ndarray, all_atom_mask: np.ndarray, alt_torsions=False, is_multimer=False)[source]

This function calculates the seven torsion angles of each residue and encodes them in sine and cosine. The order of the seven torsion angles is [pre_omega, phi, psi, chi_1, chi_2, chi_3, chi_4] Here, pre_omega represents the twist angle between a given amino acid and the previous amino acid. The phi represents twist angle between C-CA-N-(C+1), psi represents twist angle between (N-1)-C-CA-N.

Parameters
  • aatype (numpy.array) – Amino acid type with shape (batch_size,Nres).

  • all_atom_pos (numpy.array) – Atom37 representation of all atomic coordinates with shape (batch_size,Nres,37,3).

  • all_atom_mask (numpy.array) – Atom37 representation of the mask on all atomic coordinates with shape (batch_size,Nres).

  • alt_torsions (bool) – Indicates whether to set the sign angle of shielding torsion to zero. Default: False.

  • is_multimer (bool) – It will be True when multimer is used. Default: False.

Returns

Dict containing

  • torsion_angles_sin_cos (numpy.array), with shape (Nres,7,2) where the final 2 dimensions denote sin and cos respectively. If is_multimer is True, the shape will be (Nseq,Nres,7,2) .

  • alt_torsion_angles_sin_cos (numpy.array), same as 'torsion_angles_sin_cos', but with the angle shifted by pi for all chi angles affected by the naming ambiguities. shape is (Nres,7,2). If is_multimer is True, the shape will be (Nseq,Nres,7,2) .

  • torsion_angles_mask (numpy.array), Mask for which chi angles are present. shape is (Nres,7) . If is_multimer is True, the shape will be (Nseq,Nres,7,2) .

Supported Platforms:

Ascend GPU CPU

Examples

>>> import numpy as np
>>> from mindsponge.data.data_transform import atom37_to_torsion_angles
>>> n_res = 16
>>> bs = 1
>>> aatype = np.random.randn(bs, n_res).astype(np.int32)
>>> all_atom_pos = np.random.randn(bs, n_res, 37, 3).astype(np.float32)
>>> all_atom_mask = np.random.randn(bs, n_res, 37).astype(np.float32)
>>> angle_label_feature = atom37_to_torsion_angles(aatype, all_atom_pos, all_atom_mask)
>>> print(angle_label_feature.keys())
dict_keys(['torsion_angles_sin_cos', 'alt_torsion_angles_sin_cos', 'torsion_angles_mask'])