# Bio.SVDSuperimposer软件包¶

## 模块内容¶

SVDSuperimposer找到最佳的旋转和平移，将两个点集叠加在一起(最小化RMSD)。这是艾格。对叠加晶体结构很有用。SVD代表奇异值分解，算法中使用了奇异值分解。

class Bio.SVDSuperimposer.SVDSuperimposer

SVDSuperimposer找到最佳的旋转和平移，将两个点集叠加在一起(最小化RMSD)。这是艾格。对叠加晶体结构很有用。

SVD代表奇异值分解，用于计算叠加。

```>>> from Bio.SVDSuperimposer import SVDSuperimposer
>>> from numpy import array, dot, set_printoptions
>>>
>>> x = array([[51.65, -1.90, 50.07],
...      [50.40, -1.23, 50.65],
...      [50.68, -0.04, 51.54],
...      [50.22, -0.02, 52.85]], 'f')
>>>
>>> y = array([[51.30, -2.99, 46.54],
...      [51.09, -1.88, 47.58],
...      [52.36, -1.20, 48.03],
...      [52.71, -1.18, 49.38]], 'f')
```

```>>> sup = SVDSuperimposer()
```

```>>> sup.set(x, y)
```

```>>> sup.run()
```

```>>> rms = sup.get_rms()
```

```>>> rot, tran = sup.get_rotran()
```

```>>> y_on_x1 = dot(y, rot) + tran
```

```>>> y_on_x2 = sup.get_transformed()
```
```>>> set_printoptions(precision=2)
>>> print(y_on_x1)
[[  5.17e+01  -1.90e+00   5.01e+01]
[  5.04e+01  -1.23e+00   5.06e+01]
[  5.07e+01  -4.16e-02   5.15e+01]
[  5.02e+01  -1.94e-02   5.29e+01]]
>>> print(y_on_x2)
[[  5.17e+01  -1.90e+00   5.01e+01]
[  5.04e+01  -1.23e+00   5.06e+01]
[  5.07e+01  -4.16e-02   5.15e+01]
[  5.02e+01  -1.94e-02   5.29e+01]]
>>> print("%.2f" % rms)
0.00
```
__init__()

set(reference_coords, coords)

• REFERENCE_COORDS：NxDIM数组

• 坐标：NxDIM数组

Dim是点的尺寸，N是要叠加的点数。

run()

get_transformed()

get_rotran()

get_init_rms()

get_rms()