-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathalign_test.py
26 lines (26 loc) · 1.05 KB
/
align_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
cmd.reinitialize
def rotate_sel_ligand(selection,axis,angle,zero):
position = get_pos(zero)
print(angle)
print(position)
if axis == "x":
if position[0][1] >= 0.0 and position[0][2] >= 0:
cmd.rotate("x",-(180-angle),selection,0,0,origin=[0,0,0])
print("Rotate selection "+str(selection)+" around "+ str(axis)+" axis by " + str(-angle)
+ " degree.")
return -angle
if position[0][1] < 0.0 and position[0][2] >= 0:
cmd.rotate("x",180-angle,selection,0,0,origin=[0,0,0])
print("Rotate selection "+str(selection)+" around "+ str(axis)+" axis by " + str(angle)
+ " degree.")
return angle
if position[0][1] < 0 and position[0][2] < 0:
cmd.rotate("x",angle,selection,0,0,origin=[0,0,0])
print("Rotate selection "+str(selection)+" around "+ str(axis)+" axis by " + str(angle)
+ " degree.")
return angle
if position[0][1] >= 0 and position[0][2] < 0:
cmd.rotate("x",-angle,selection,0,0,origin=[0,0,0])
print("Rotate selection "+str(selection)+" around "+ str(axis)+" axis by " + str(-angle)
+ " degree.")
return -angle