Difference between revisions of "Movit"

From PyMOLWiki
Jump to navigation Jump to search
(movit)
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
Hi everyone !
 
Hi everyone !
  
I wanted to see roughly if one protein could dock on another one, and could not find any mouse setting allowing to do that. Here is a script that does just that. Key bindings are:
+
I wanted to see roughly if one protein could dock on another one, and could not find any mouse setting allowing to do that. Here is a script that does just that.  
 +
 
 +
USAGE : movit <selection>
 +
 
 +
The selection can now be translated/rotated
 +
with the following keyboard shortcuts:
 +
 
 +
q,a : x translation
 +
 
 +
w,s : y translation
 +
 
 +
e,d : z translation
 +
 
 +
 
 +
r,f : x rotation
 +
 
 +
t,g : y rotation
 +
 
 +
y,h : z rotation
 +
 
  
q : translation  +x
 
a : translation  -x
 
w : translation  +y
 
s : translation  -y
 
w : translation  +z
 
s : translation  -z
 
r : rotation along x
 
f : rotation along x (the other way)
 
t : rotation along x
 
g : rotation along x (the other way)
 
y : rotation along x
 
h : rotation along x (the other way)
 
  
 
Use : run movit.py during startup. Then, 'movit ''selection'''.
 
Use : run movit.py during startup. Then, 'movit ''selection'''.
Line 20: Line 27:
 
It is not very practical, does anybody know how to do that with the mouse instead of just one step at a time like here ?
 
It is not very practical, does anybody know how to do that with the mouse instead of just one step at a time like here ?
  
<pymol>
+
<source lang="python">
 
from pymol import cmd
 
from pymol import cmd
  
Line 67: Line 74:
 
cmd.extend ("movit",movit)
 
cmd.extend ("movit",movit)
  
</pymol>
+
</source>
 +
 
 +
[[Category:Script_Library|Movit]]
 +
[[Category:UI_Scripts]]

Latest revision as of 12:22, 21 July 2009

Hi everyone !

I wanted to see roughly if one protein could dock on another one, and could not find any mouse setting allowing to do that. Here is a script that does just that.

USAGE : movit <selection>

The selection can now be translated/rotated with the following keyboard shortcuts:

q,a : x translation

w,s : y translation

e,d : z translation


r,f : x rotation

t,g : y rotation

y,h : z rotation


Use : run movit.py during startup. Then, 'movit selection'.

It is not very practical, does anybody know how to do that with the mouse instead of just one step at a time like here ?

from pymol import cmd

def movit(selection="all"):
    """USAGE : movit <selection>
               The selection can now be translated/rotated
               with the following keyboard shortcuts:

               q,a : x translation
               w,s : y translation
               e,d : z translation

               r,f : x rotation
               t,g : y rotation
               y,h : z rotation
    """

    line="translate [1,0,0],"+selection
    cmd.alias ('q',line)
    line="translate [0,1,0],"+selection
    cmd.alias ('w',line)
    line="translate [0,0,1],"+selection
    cmd.alias ('e',line)

    line="translate [-1,0,0],"+selection
    cmd.alias ('a',line)
    line="translate [0,-1,0],"+selection
    cmd.alias ('s',line)
    line="translate [0,0,-1],"+selection
    cmd.alias ('d',line)

    line="rotate x,5,"+selection
    cmd.alias ('r',line)
    line="rotate y,5,"+selection    
    cmd.alias ('t',line)
    line="rotate z,5,"+selection
    cmd.alias ('y',line)

    line="rotate x,-5,"+selection
    cmd.alias ('f',line)
    line="rotate y,-5,"+selection
    cmd.alias ('g',line)
    line="rotate z,-5,"+selection
    cmd.alias ('h',line)

cmd.extend ("movit",movit)