当前位置: 首页>>代码示例>>Python>>正文


Python Matrix.chimera_xform方法代码示例

本文整理汇总了Python中Matrix.chimera_xform方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.chimera_xform方法的具体用法?Python Matrix.chimera_xform怎么用?Python Matrix.chimera_xform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Matrix的用法示例。


在下文中一共展示了Matrix.chimera_xform方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: fit_map_in_map

# 需要导入模块: import Matrix [as 别名]
# 或者: from Matrix import chimera_xform [as 别名]
def fit_map_in_map(map1, map2,
		initial_map1_transform = None,
		map1_threshold = None,
		ijk_step_size_min = 0.01,		# Grid index units
		ijk_step_size_max = 1.5,		 # Grid index units
		max_steps = 10000,
		optimize_translation = True,
		optimize_rotation = True):

	# Files have to have file suffix indicating volume format.
	if initial_map1_transform:
		xf = Matrix.chimera_xform(initial_map1_transform)
		map1.surface_model().openState.globalXform(xf)
		
	use_threshold = (map1_threshold != None)
	points, point_weights = map_points_and_weights(map1, use_threshold)

	if len(points) == 0:
		if use_threshold:
			print 'No grid points above map threshold.'
		else:
			print 'Map has no non-zero values.'
		return

	move_tf, stats = motion_to_maximum(points, point_weights, map2, max_steps,
		ijk_step_size_min, ijk_step_size_max,
		optimize_translation, optimize_rotation)

	if initial_map1_transform:
		move_tf = Matrix.multiply_matrices(move_tf, initial_map1_transform)

	header = ('\nFit map %s in map %s using %d points\n'
		% (map1.name, map2.name, stats['points']) +
		'	correlation = %.4g, overlap = %.4g\n'
		% (stats['correlation'], stats['overlap']) +
		'	steps = %d, shift = %.3g, angle = %.3g degrees\n'
		% (stats['steps'], stats['shift'], stats['angle']))
	print header

	#tfs = Matrix.transformation_description(move_tf)
	#print tfs

	xf = Matrix.chimera_xform(move_tf)
	map1.surface_model().openState.globalXform(xf)
开发者ID:leschzinerlab,项目名称:myami-3.2-freeHand,代码行数:46,代码来源:apChimAlign.py

示例2: graph_event_cb

# 需要导入模块: import Matrix [as 别名]
# 或者: from Matrix import chimera_xform [as 别名]
 def graph_event_cb(event, v1=v1, axis=axis, center=center, cur_angle = [0]):
     if not event.button is None:
         angle = event.xdata
         if angle is None:
             angle = 0       # Click outside graph bounds
         import Matrix
         tf = Matrix.rotation_transform(axis, angle-cur_angle[0], center)
         xf = Matrix.chimera_xform(tf)
         v1.openState.localXform(xf)
         cur_angle[0] = angle
         ax.cur_position.set_xdata((angle,angle))
         ax.figure.canvas.draw()
开发者ID:davem22101,项目名称:semanticscience,代码行数:14,代码来源:measure.py

示例3: parameter_xform

# 需要导入模块: import Matrix [as 别名]
# 或者: from Matrix import chimera_xform [as 别名]
def parameter_xform(rotq, rotc, trans):

    import Matrix as m
    ttf = m.translation_matrix(trans)
    sa2 = m.norm(rotq[:3])
    ca2 = rotq[3]
    from math import atan2, pi
    angle = 2*atan2(sa2,ca2) * 180.0/pi
    axis = m.normalize_vector(rotq[:3])
    rtf = m.rotation_transform(axis, angle, rotc)
    tf = m.multiply_matrices(ttf, rtf)
    xf = m.chimera_xform(tf)
    return xf
开发者ID:davem22101,项目名称:semanticscience,代码行数:15,代码来源:fly.py

示例4: move_models_and_atoms

# 需要导入模块: import Matrix [as 别名]
# 或者: from Matrix import chimera_xform [as 别名]
def move_models_and_atoms(tf, models, atoms, move_whole_molecules, base_model):

    if move_whole_molecules:
        models = list(models) + list(set([a.molecule for a in atoms]))
        atoms = []
    global position_history
    position_history.record_position(models, atoms, base_model)
    import Matrix
    xf = Matrix.chimera_xform(tf)
    for os in set([m.openState for m in models]):
        os.globalXform(xf)
    for a in atoms:
        mxfinv = a.molecule.openState.xform.inverse()
        a.setCoord(mxfinv.apply(xf.apply(a.xformCoord())))
    position_history.record_position(models, atoms, base_model)
开发者ID:davem22101,项目名称:semanticscience,代码行数:17,代码来源:move.py


注:本文中的Matrix.chimera_xform方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。