reinitialize
import rotkit
fetch 1HP1, async=0
python
if 'PYMOL_GIT_MOD' in os.environ:
example_dir = os.path.join(os.path.split(os.environ['PYMOL_GIT_MOD'])[0],"files_for_examples")
cmd.load(os.path.join(example_dir,"Atto590.pdb"))
else:
cmd.load("Atto590.pdb")
python end
cmd.refresh()
protname = cmd.get_names()[0]
molname = cmd.get_names()[1]
protselectCB="%s and resi 308 and name CB"%protname
protnameselectCB="K308CB"
protselectCA="%s and resi 308 and name CA"%protname
protnameselectCA="K308CA"
molselect13="%s and id 13"%molname
molnameselect13="dyeatom13"
molselect12="%s and id 12"%molname
molnameselect12="dyeatom12"
cmd.select("%s"%protnameselectCB,"%s"%protselectCB)
cmd.select("%s"%protnameselectCA,"%s"%protselectCA)
cmd.select("%s"%molnameselect13,"%s"%molselect13)
cmd.label("%s"%molnameselect13,"13")
cmd.select("%s"%molnameselect12,"%s"%molselect12)
cmd.label("%s"%molnameselect12,"12")
cmd.show_as("cartoon","%s"%protname)
cmd.show("sticks","byres %s"%protnameselectCB)
set_view (\
0.377224118, 0.880101919, -0.288305759,\
0.661396861, -0.473919988, -0.581338286,\
-0.648268998, 0.028612033, -0.760871351,\
0.000000000, 0.000000000, -56.408561707,\
19.480533600, 34.572898865, 6.978204727,\
46.615653992, 66.201446533, -20.000001907 )
rotkit.printMat(cmd.get_object_matrix(molname))
diffvector = rotkit.vector("%s"%molselect13,"%s"%protnameselectCB)
move = rotkit.transmat(diffvector)
rotkit.printMat(move)
cmd.transform_selection("%s"%molname,move)
diffvector = rotkit.vector("%s"%protnameselectCA,"%s"%protnameselectCB)
uvector = rotkit.unitvector(diffvector)[0]
move = rotkit.transmat(uvector,3)
rotkit.printMat(move)
cmd.transform_selection("%s"%molname,move)
CBxyz = rotkit.getxyz("%s"%protnameselectCB)[0]
rmat = rotkit.rotmat(rotkit.radangle(40),uvector,CBxyz)
rotkit.printMat(rmat)
cmd.transform_selection("%s"%molname,rmat)
diffvector = rotkit.vector("%s"%molnameselect13,"%s"%molnameselect12)
uvector = rotkit.unitvector(diffvector)[0]
xyz12 = rotkit.getxyz("%s"%molnameselect12)[0]
rmat = rotkit.rotmat(rotkit.radangle(10),uvector,xyz12)
cmd.transform_selection("%s"%molname,rmat)
rotkit.rotateline("%s"%molnameselect13,"%s"%molnameselect12,180,"%s"%molname)
print("rotateline Pos1=%s, Pos2=%s, degangle=15, molecule=%s"%(molnameselect13, molnameselect12, molname))
python
anglerange = range(90,360,90)
for angle in anglerange:
molanglename="%s%s"%(molname,angle)
cmd.create(molanglename,molname)
cmd.label("%s and id 12"%molanglename,"12")
cmd.label("%s and id 13"%molanglename,"13")
rotkit.rotateline("%s"%protnameselectCB,"%s"%molnameselect13,angle,"%s"%molanglename)
python end
set_view (\
0.723298192, 0.467510879, 0.508201897,\
0.371686131, -0.883831143, 0.284063697,\
0.581970334, -0.016570913, -0.813038886,\
0.000000000, 0.000000000, -76.609786987,\
11.790571213, 64.992294312, 20.803859711,\
-31.181428909, 184.401092529, -20.000001907 )
rotkit.mutate(protname, chain="A", resi=513, target="CYS", mutframe=1)
cmd.refresh()
print("mutate %s, chain=%s, resi=%s, target=CYS, mutframe=1"%(protname, "A", 515))
protselectCBcys="%s and resi 513 and name CB"%protname
protnameselectCBcys="P513C_CB"
protselectCAcys="%s and resi 513 and name CA"%protname
protnameselectCAcys="P513C_CA"
cmd.select("%s"%protnameselectCBcys,"%s"%protselectCBcys)
cmd.select("%s"%protnameselectCAcys,"%s"%protselectCAcys)
rotkit.toline(protnameselectCAcys,protnameselectCBcys,molnameselect13,molname,3)
rotkit.rotateline(protnameselectCAcys,protnameselectCBcys,180,molname)
rotkit.rotateline(molnameselect13,molnameselect12,10,molname)
print("toline Pos1=%s, Pos2=%s, atom=%s, molecule=%s, dist=%s"%(protnameselectCAcys,protnameselectCBcys,molnameselect13,molname,3))
print("rotateline Pos1=%s, Pos2=%s, degangle=180, molecule=%s"%(protnameselectCAcys, protnameselectCBcys, molname))
print("rotateline Pos1=%s, Pos2=%s, degangle=10, molecule=%s"%(molnameselect13, molnameselect12, molname))
cmd.refresh()
molselect14="%s and id 14"%molname
molnameselect14="dyeatom14"
cmd.select("%s"%molnameselect14,"%s"%molselect14)
cmd.label("%s"%molnameselect14,"14")
cross = rotkit.crossprod(rotkit.vector(molselect13,molselect12),rotkit.vector(molselect13,molselect14))
unity_cross = rotkit.unitvector(cross)[0]
point_cross = rotkit.crosspoint(molselect13,cross)
rotkit.rotateline(molnameselect13,point_cross,180,molname)
print("rotateline Pos1=%s, Pos2=%s, degangle=10, molecule=%s"%(molnameselect13, point_cross, molname))