예제 #1
0
def chainbow_obj(selection="(all)"):
    """DESCRIPTION

    Colors each chain as a rainbow from N (blue) to C (red)

USAGE

    chainbow_obj [selection]

ARGUMENTS

    selection = the objects to be colored

NOTES

    Any objects present in the selection will be recolored completely. There is no
    way to color only part of an object.

EXAMPLES

AUTHOR

    Spencer Bliven
"""

    for object in cmd.get_object_list(selection):
        util.chainbow(object)
예제 #2
0
 def anime(self, cleanup=0):
     self.interrupt = cleanup
     suspend_undo = self.cmd.get("suspend_undo")
     self.cmd.set("suspend_undo", 1, updates=0)
     if not cleanup:
         try:
             self.cmd.set("suspend_updates", 1, quiet=1)
             self.cmd.disable()
             self.cmd.load("$TUT/1hpv.pdb")
             util.chainbow("1hpv", _self=self.cmd)
             self.cmd.hide("everything", "1hpv")
             self.cmd.show("cartoon", "1hpv")
             self.cmd.show("sticks", "1hpv///200/")
             self.cmd.create("1hpv_a", "1hpv//A//")
             self.cmd.set("cartoon_smooth_loops", 0, "1hpv_a")
             self.cmd.create("1hpv_b", "1hpv//B//")
             self.cmd.set("cartoon_smooth_loops", 0, "1hpv_b")
             self.cmd.create("1hpv_l", "1hpv///200/")
             util.cbay("1hpv_l", _self=self.cmd)
             self.cmd.delete("1hpv")
             self.cmd.set_view ((\
       0.374249548,   -0.517475128,    0.769516647,\
       -0.214397043,   -0.855623126,   -0.471108317,\
       0.902203023,    0.011330833,   -0.431161582,\
       -0.000023194,   -0.000007302, -125.089942932,\
       11.953758240,   20.323493958,    8.406080246,\
       75.304412842,  189.396347046,    0.000000000 ))
             self.cmd.translate([-20, 0, 0], object="1hpv_a")
             self.cmd.translate([20, 0, 0], object="1hpv_b")
             self.cmd.zoom("center", 30)
             self.cmd.translate([0, 10, 00], object="1hpv_l")
         finally:
             self.cmd.set("suspend_updates", 0, quiet=1)
         self.cmd.refresh()
         for a in range(1, 21):
             if self.interrupt:
                 break
             try:
                 self.cmd.set("suspend_updates", 1, quiet=1)
                 self.cmd.translate([1, 0, 0], object="1hpv_a")
                 self.cmd.translate([-1, 0, 0], object="1hpv_b")
                 self.cmd.translate([0, -0.5, 0], object="1hpv_l")
             finally:
                 self.cmd.set("suspend_updates", 0, quiet=1)
             self.cmd.refresh()
         for a in range(1, 62):
             if self.interrupt:
                 break
             self.cmd.turn("y", 6)
             self.cmd.move('z', 2)
             self.cmd.move('y', -0.12)
             self.cmd.refresh()
     else:
         self.cmd.delete("1hpv_*")
     self.cmd.set("suspend_undo", suspend_undo, updates=0)
예제 #3
0
파일: demo.py 프로젝트: Almad/pymol
 def anime(self,cleanup=0):
     if not cleanup:
         try:
             self.cmd.set("suspend_updates",1,quiet=1)
             self.cmd.disable()
             self.cmd.load("$TUT/1hpv.pdb")
             util.chainbow("1hpv",_self=self.cmd)
             self.cmd.hide("everything","1hpv")
             self.cmd.show("cartoon","1hpv")
             self.cmd.show("sticks","1hpv///200/")
             self.cmd.create("1hpv_a","1hpv//A//")
             self.cmd.set("cartoon_smooth_loops",0,"1hpv_a")
             self.cmd.create("1hpv_b","1hpv//B//")
             self.cmd.set("cartoon_smooth_loops",0,"1hpv_b")
             self.cmd.create("1hpv_l","1hpv///200/")
             util.cbay("1hpv_l",_self=self.cmd)
             self.cmd.delete("1hpv")
             self.cmd.set_view ((\
       0.374249548,   -0.517475128,    0.769516647,\
       -0.214397043,   -0.855623126,   -0.471108317,\
       0.902203023,    0.011330833,   -0.431161582,\
       -0.000023194,   -0.000007302, -125.089942932,\
       11.953758240,   20.323493958,    8.406080246,\
       75.304412842,  189.396347046,    0.000000000 ))
             self.cmd.translate([-20,0,0],object="1hpv_a")
             self.cmd.translate([20,0,0],object="1hpv_b")
             self.cmd.zoom("center",30)
             self.cmd.translate([0,10,00],object="1hpv_l")
         finally:
             self.cmd.set("suspend_updates",0,quiet=1)
         self.cmd.refresh()
         for a in range(1,21):
             try:
                 self.cmd.set("suspend_updates",1,quiet=1)
                 self.cmd.translate([1,0,0],object="1hpv_a")
                 self.cmd.translate([-1,0,0],object="1hpv_b")
                 self.cmd.translate([0,-0.5,0],object="1hpv_l")
             finally:
                 self.cmd.set("suspend_updates",0,quiet=1)
             self.cmd.refresh()
         for a in range(1,62):
             self.cmd.turn("y",6)
             self.cmd.move('z',2)
             self.cmd.move('y',-0.12)
             self.cmd.refresh()
                             
     else:
         self.cmd.delete("1hpv_*")