Bio.SVDSuperimposer软件包¶
模块内容¶
使用奇异值分解(SVD)比对将蛋白质结构与另一个蛋白质结构比对。
SVDSuperimposer找到最佳的旋转和平移,将两个点集叠加在一起(最小化RMSD)。这是艾格。对叠加晶体结构很有用。SVD代表奇异值分解,算法中使用了奇异值分解。
- class Bio.SVDSuperimposer.SVDSuperimposer¶
基类:
object
类来运行SVD对齐。
SVDSuperimposer找到最佳的旋转和平移,将两个点集叠加在一起(最小化RMSD)。这是艾格。对叠加晶体结构很有用。
SVD代表奇异值分解,用于计算叠加。
参考资料:
矩阵计算,第二版。Golub,G.&Van Loan,参考文献,约翰霍普金斯大学出版社,巴尔的摩,1989
从两个坐标集开始(Nx3数组-浮点)
>>> 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()
设置坐标y将在x上旋转和平移
>>> sup.set(x, y)
做LSQ拟合
>>> sup.run()
获取RMSD
>>> rms = sup.get_rms()
获得旋转(右乘!)和翻译
>>> rot, tran = sup.get_rotran()
在x上旋转y
>>> 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()¶
叠加坐标的均方根偏差。