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_transform_from_reference

View Source On Gitee
mindsponge.common.make_transform_from_reference(point_a, point_b, point_c)[source]

Using GramSchmidt process to construct rotation and translation from given points.

Calculate the rotation matrix and translation meets

  1. point_b is the original point.

  2. point_c is on the x_axis.

  3. the plane a-b-c is on the x-y plane.

v1=x3x2v2=x1x2e1=v1/||v1||u2=v2e1(e1Tv2)e2=u2/||u2||e3=e1×e2rotation=(e1,e2,e3)translation=(x2)
Parameters
  • point_a (float, tensor) -> (tensor) – Spatial location information of atom 'N', shape is [...,Nres,3] .

  • point_b (float, tensor) -> (tensor) – Spatial location information of atom 'CA', shape is [...,Nres,3] .

  • point_c (float, tensor) -> (tensor) – Spatial location information of atom 'C', shape is [...,Nres,3] .

Returns

  • Tuple, rots (xx,xy,xz,yx,yy,yz,zx,zy,zz) , the shape of every element is (...,Nres) .

  • Tuple, trans (x,y,z) , the shape of every element is (...,Nres) .

Supported Platforms:

Ascend GPU

Examples

>>> import numpy as np
>>> import mindspore as ms
>>> from mindspore import Tensor
>>> from mindsponge.common.geometry import make_transform_from_reference
>>> input_0 = Tensor(np.ones((4, 256, 3)), ms.float32)
>>> input_1 = Tensor(np.ones((4, 256, 3)), ms.float32)
>>> input_2 = Tensor(np.ones((4, 256, 3)), ms.float32)
>>> rots, trans = make_transform_from_reference(input_0, input_1, input_2)
>>> print(len(rots), rots[0].shape, len(trans), trans[0].shape)
9, (4, 256), 3, (4, 256)