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.common.make_atom14_positions

View Source On Gitee
mindsponge.common.make_atom14_positions(aatype, all_atom_mask, all_atom_positions)[source]

The function of transforming sparse encoding method to densely encoding method.

Total coordinate encoding for atoms in proteins comes in two forms.

  • Sparse encoding, 20 amino acids contain a total of 37 atom types as shown in common.residue_constants.atom_types. So coordinates of atoms in protein can be encoded as a Tensor with shape (Nres,37,3).

  • Densely encoding. 20 amino acids contain a total of 14 atom types as shown in common.residue_constants.restype_name_to_atom14_names. So coordinates of atoms in protein can be encoded as a Tensor with shape (Nres,14,3).

Parameters
  • aatype (numpy.ndarray) – Protein sequence encoding. the encoding method refers to common.residue_constants.restype_order. Value range is [0,20]. 20 means the amino acid is unknown (UNK).

  • all_atom_mask (numpy.ndarray) – Mask of coordinates of all atoms in proteins. Shape is (Nres,37). If the corresponding position is 0, the amino acid does not contain the atom.

  • all_atom_positions (numpy.ndarray) – Coordinates of all atoms in protein. Shape is (Nres,37,3) .

Returns

  • numpy.array. Densely encoding, mask of all atoms in protein, including unknown amino acid atoms. Shape is (Nres,14).

  • numpy.array. Densely encoding, mask of all atoms in protein, excluding unknown amino acid atoms. Shape is (Nres,14).

  • numpy.array. Densely encoding, coordinates of all atoms in protein. Shape is (Nres,14,3).

  • numpy.array. Index of mapping sparse encoding atoms with densely encoding method. Shape is (Nres,14) .

  • numpy.array. Index of mapping densely encoding atoms with sparse encoding method. Shape is (Nres,37) .

  • numpy.array. Sparse encoding, mask of all atoms in protein, including unknown amino acid atoms. Shape is (Nres,37)

  • numpy.array. The atomic coordinates after chiral transformation for the atomic coordinates of densely encoding method. Shape is (Nres,14,3) .

  • numpy.array. Atom mask after chiral transformation. Shape is (Nres,14) .

  • numpy.array. Atom identifier of the chiral transformation. 1 is transformed and 0 is not transformed. Shape is (Nres,14) .

Symbol:
  • Nres - The number of amino acids in a protein, according to the sequence of the protein.

Supported Platforms:

Ascend GPU

Examples

>>> from mindsponge.common import make_atom14_positions
>>> from mindsponge.common import protein
>>> import numpy as np
>>> pdb_path = "YOUR_PDB_FILE"
>>> with open(pdb_path, 'r', encoding = 'UTF-8') as f:
>>>     prot_pdb = protein.from_pdb_string(f.read())
>>> result = make_atom14_positions(prot_pdb.aatype, prot_pdb.atom_mask.astype(np.float32),
>>>                                prot_pdb.atom_positions.astype(np.float32))
>>> for val in result:
>>>     print(val.shape)
(Nres, 14)
(Nres, 14)
(Nres, 14, 3)
(Nres, 14)
(Nres, 37)
(Nres, 37)
(Nres, 14, 3)
(Nres, 14)
(Nres, 14)