Ejemplo n.º 1
0
    def testGetMoviePlaying(self):
        self.prep_movie()
        cmd.mplay()
        self.assertEquals(cmd.get_movie_playing(),1)

        cmd.mstop()
        self.assertEquals(cmd.get_movie_playing(),0)
Ejemplo n.º 2
0
    def testGetMoviePlaying(self):
        self.prep_movie()
        cmd.mplay()
        self.assertEquals(cmd.get_movie_playing(), 1)

        cmd.mstop()
        self.assertEquals(cmd.get_movie_playing(), 0)
Ejemplo n.º 3
0
 def testMtoggle(self):
     self.prep_movie()
     cmd.mstop()
     
     # toggle on
     cmd.mtoggle()
     self.assertEquals(cmd.get_movie_playing(),1)
     # toggle off
     cmd.mtoggle()
     self.assertEquals(cmd.get_movie_playing(),0)
Ejemplo n.º 4
0
    def testMtoggle(self):
        self.prep_movie()
        cmd.mstop()

        # toggle on
        cmd.mtoggle()
        self.assertEquals(cmd.get_movie_playing(), 1)
        # toggle off
        cmd.mtoggle()
        self.assertEquals(cmd.get_movie_playing(), 0)
Ejemplo n.º 5
0
 def electomo(self,cleanup=0):
     if not cleanup:
         cmd.feedback("disable","objectsurface","actions")
         cmd.set_session(self.get_sess("$PYMOL_DATA/big_demo/flagellar.pse"))
         cmd.set("sweep_mode",3)
         cmd.set("sweep_angle",3)
         cmd.rock()
         cmd.do("replace_wizard toggle, Electron Tomography")
     else:
         cmd.mstop()
         cmd.rock(0)
Ejemplo n.º 6
0
 def electomo(self,cleanup=0):
     if not cleanup:
         cmd.feedback("disable","objectsurface","actions")
         cmd.set_session(self.get_sess("$PYMOL_DATA/big_demo/flagellar.pse"))
         cmd.set("sweep_mode",3)
         cmd.set("sweep_angle",3)
         cmd.rock()
         cmd.do("replace_wizard toggle, Electron Tomography")
     else:
         cmd.mstop()
         cmd.rock(0)
Ejemplo n.º 7
0
 def convert_spin(self):
     '''spin the protein'''
     if self.argsLength > 1 and self.args[1] == 'off':
         cmd.mstop()
         cmd.mset()
         pymSpin = 'PyMOL: mstop; mset\n\n'
     else:
         cmd.mset('1 x180')
         util.mroll(1,180,1)
         cmd.mplay()
         pymSpin = 'PyMOL: mset 1 x180; util.mroll(1,180,1); mplay'
     print pymSpin
Ejemplo n.º 8
0
 def convert_spin(self):
     '''spin the protein'''
     if self.argsLength > 1 and self.args[1] == 'off':
         cmd.mstop()
         cmd.mset()
         pymSpin = 'PyMOL: mstop; mset\n\n'
     else:
         cmd.mset('1 x180')
         util.mroll(1, 180, 1)
         cmd.mplay()
         pymSpin = 'PyMOL: mset 1 x180; util.mroll(1,180,1); mplay'
     print pymSpin
Ejemplo n.º 9
0
 def animate(self,cleanup=0):
     if not cleanup:
         cmd.set("security",0)
         cmd.set_session(self.get_sess("$PYMOL_DATA/big_demo/animate.pse"))
         cmd.rock(1)
         cmd.set("field_of_view",23)
         cmd.rock(1)
         cmd.set("sweep_mode",3)
         cmd.set("sweep_angle",10)
         cmd.do("replace_wizard toggle, Molecular Animation")
     else:
         cmd.set("mesh_width",1)
         cmd.set("field_of_view",20)
         cmd.rock(0)
         cmd.mset()
         cmd.mstop()
Ejemplo n.º 10
0
def highlight_chains():
    cmd.mstop()
    cmd.mclear()
    cmd.mset()
    glb.update()

    colors = ['blue', 'orange', 'silver', 'green', 'yellow',
                     'purple', 'brightorange', 'lightblue', 'lightorange',
                     'pink', 'forest', 'firebrick', 'paleyellow', 'salmon',
                     'ruby', 'wheat', 'lightmagenta', 'nitblue']
    
    chains = []
    numChains = 0
    objects = cmd.get_names('all')
    for obj in objects:
        split = obj.split('Chain-')
        if len(split) == 2:
            chains.append(split[1])
            numChains += 1
    numFrames = (numChains*200)+70
    cmd.mset('1', numFrames)
    cmd.mdo(1,'color red, all; hide cartoon, all')
    cmd.orient()
    cmd.mview('store', '1')
    
    colorCount = 0
    frameCount = 1

    for i in chains:
        cmd.orient('chain ' + i)
        cmd.mview('store', frameCount+59)
        cmd.mview('store', frameCount+115)
        flash_chain(i, frameCount+59, 'red', colors[colorCount])
        cmd.orient()
        cmd.turn('x', '270')
        cmd.turn('y', '180')
        cmd.mview('store', frameCount+150)
        cmd.mview('store', frameCount+170)
        colorCount += 1
        frameCount += 200
        if(frameCount > numFrames-100):
            cmd.orient()
        cmd.mdo(numFrames,'mstop')
    cmd.mview('store', (numChains*200)+70)
    cmd.mview('interpolate')
    cmd.show('ribbon')
    cmd.color('red', 'all')
Ejemplo n.º 11
0
 def animate(self,cleanup=0):
     if not cleanup:
         cmd.set("security",0)
         cmd.set_session(self.get_sess("$PYMOL_DATA/big_demo/animate.pse"))
         cmd.rock(1)
         cmd.set("field_of_view",23)
         cmd.rock(1)
         cmd.set("sweep_mode",3)
         cmd.set("sweep_angle",10)
         cmd.set("sphere_mode",5)
         cmd.do("replace_wizard toggle, Molecular Animation")
     else:
         cmd.set("mesh_width",1)
         cmd.set("field_of_view",20)
         cmd.rock(0)
         cmd.mset()
         cmd.mstop()
Ejemplo n.º 12
0
 def ray(self,cleanup=0):
     if not cleanup:
         cmd.set("suspend_updates",1,quiet=1)
         cmd.disable()
         cmd.delete("ray")
         cmd.set("sphere_scale",1.0)
         cmd.load("$PYMOL_DATA/demo/il2.pdb","ray")
         cmd.remove("(ray and hydro)")
         cmd.hide("lines","ray")
         cmd.show("spheres","ray")
         cmd.orient("ray")
         cmd.turn("x",90)
         util.ray_shadows('heavy')
         cmd.mstop()
         cmd.rock(0)
         cmd.set("suspend_updates",0,quiet=1)
         cmd.refresh()
         cmd.do("ray")
     else:
         cmd.delete("ray")
Ejemplo n.º 13
0
 def ray(self,cleanup=0):
     if not cleanup:
         cmd.set("suspend_updates",1,quiet=1)
         cmd.disable()
         cmd.delete("ray")
         cmd.set("sphere_mode",5)
         cmd.set("sphere_scale",1.0)
         cmd.load("$PYMOL_DATA/demo/il2.pdb","ray")
         cmd.remove("(ray and hydro)")
         cmd.hide("lines","ray")
         cmd.show("spheres","ray")
         cmd.orient("ray")
         cmd.turn("x",90)
         util.ray_shadows('heavy')
         cmd.mstop()
         cmd.rock(0)
         cmd.set("suspend_updates",0,quiet=1)
         cmd.refresh()
         cmd.do("ray")
     else:
         cmd.delete("ray")
Ejemplo n.º 14
0
def surface_cartoon():
    glb.update()
    cmd.mstop()
    cmd.mclear()
    cmd.mset('1', '60')
    cmd.hide('everything')
    objects = cmd.get_names('all')
    glb.procolor(None,show_all=('cartoon','surface'))
    cmd.set("cartoon_fancy_helices", "1")
    cmd.set("cartoon_fancy_sheets", "1")
    cmd.mdo(1,'set transparency = 0.75, all;')
    cmd.mdo(2,'set transparency = 0.7, all;')
    cmd.mdo(3,'set transparency = 0.65, all;')
    cmd.mdo(4,'set transparency = 0.6, all;')
    cmd.mdo(5,'set transparency = 0.55, all;')
    cmd.mdo(6,'set transparency = 0.5, all;')
    cmd.mdo(7,'set transparency = 0.45, all;')
    cmd.mdo(8,'set transparency = 0.4, all;')
    cmd.mdo(9,'set transparency = 0.35, all;')
    cmd.mdo(10,'set transparency = 0.3, all;')
    cmd.mdo(11,'set transparency = 0.25, all;')
    cmd.mdo(12,'set transparency = 0.2, all;')
    cmd.mdo(13,'set transparency = 0.15, all;')
    cmd.mdo(14,'set transparency = 0.1, all;')
    cmd.mdo(15,'set transparency = 0.05, all;')
    cmd.mdo(16,'set transparency = 0, all;')
    cmd.mdo(17,'set transparency = 0, all;')
    cmd.mdo(19,'set transparency = 0, all;')
    cmd.mdo(20,'set transparency = 0, all;')
    cmd.mdo(21,'set transparency = 0, all;')
    cmd.mdo(22,'set transparency = 0, all;')
    cmd.mdo(23,'set transparency = 0, all;')
    cmd.mdo(24,'set transparency = 0, all;')
    cmd.mdo(25,'set transparency = 0, all;')
    cmd.mdo(26,'set transparency = 0, all;')
    cmd.mdo(27,'set transparency = 0, all;')
    cmd.mdo(28,'set transparency = 0, all;')
    cmd.mdo(29,'set transparency = 0.05, all;')
    cmd.mdo(30,'set transparency = 0.1, all;')
    cmd.mdo(31,'set transparency = 0.15, all;')
    cmd.mdo(32,'set transparency = 0.2, all;')
    cmd.mdo(33,'set transparency = 0.25, all;')
    cmd.mdo(34,'set transparency = 0.3, all;')
    cmd.mdo(35,'set transparency = 0.35, all;')
    cmd.mdo(36,'set transparency = 0.4, all;')
    cmd.mdo(37,'set transparency = 0.45, all;')
    cmd.mdo(38,'set transparency = 0.5, all;')
    cmd.mdo(39,'set transparency = 0.55, all;')
    cmd.mdo(40,'set transparency = 0.6, all;')
    cmd.mdo(41,'set transparency = 0.65, all;')
    cmd.mdo(42,'set transparency = 0.7, all;')
    cmd.mdo(43,'set transparency = 0.75, all;')
    cmd.mdo(44,'set transparency = 0.8, all;')
    cmd.mdo(45,'set transparency = 0.85, all;')
    cmd.mdo(46,'set transparency = 0.9, all;')
    cmd.mdo(47,'set transparency = 0.9, all;')
    cmd.mdo(48,'set transparency = 0.9, all;')
    cmd.mdo(49,'set transparency = 0.85, all;')
    cmd.mdo(50,'set transparency = 0.85, all;')
    cmd.mdo(51,'set transparency = 0.85, all;')
    cmd.mdo(52,'set transparency = 0.85, all;')
    cmd.mdo(53,'set transparency = 0.85, all;')
    cmd.mdo(54,'set transparency = 0.85, all;')
    cmd.mdo(55,'set transparency = 0.85, all;')
    cmd.mdo(56,'set transparency = 0.85, all;')
    cmd.mdo(57,'set transparency = 0.85, all;')
    cmd.mdo(58,'set transparency = 0.85, all;')
    cmd.mdo(59,'set transparency = 0.85, all;')
    cmd.mdo(60,'set transparency = 0.8, all;')
Ejemplo n.º 15
0
def Ligand_Pull():
    glb.update()
    cmd.mstop()
    cmd.mclear()
    cmd.mset('1', '442')
    cmd.hide('everything')
    cmd.remove('resn HOH')
    cmd.color('green', 'all')
    objects = cmd.get_names('all')
    if 'ligands' in objects:
        cmd.set('stick_radius', '0.3')
        glb.procolor('ligands around 6','sticks','cpk','cartoon')
        glb.procolor('ligands','spheres','orange',None)
        cmd.set("cartoon_fancy_helices", "1")
        cmd.set("cartoon_fancy_sheets", "1")
        cmd.set('cartoon_transparency', '0.5')
        cmd.zoom()
        cmd.orient()
        cmd.mdo(1,'orient')
        cmd.mdo(2,'translate [2,0,0],ligands;')
        cmd.mdo(3,'translate [2,0,0],ligands;')
        cmd.mdo(4,'translate [2,0,0],ligands;')
        cmd.mdo(5,'translate [2,0,0],ligands;')
        cmd.mdo(6,'translate [2,0,0],ligands;')
        cmd.mdo(7,'translate [2,0,0],ligands;')
        cmd.mdo(8,'translate [2,0,0],ligands;')
        cmd.mdo(9,'translate [2,0,0],ligands;')
        cmd.mdo(10,'translate [2,0,0],ligands;')
        cmd.mdo(11,'translate [2,0,0],ligands;')
        cmd.mdo(12,'translate [2,0,0],ligands;')
        cmd.mdo(13,'translate [2,0,0],ligands;')
        cmd.mdo(14,'translate [2,0,0],ligands;')
        cmd.mdo(15,'translate [2,0,0],ligands;')
        cmd.mdo(16,'translate [2,0,0],ligands;')
        cmd.mdo(17,'translate [2,0,0],ligands;')
        cmd.mdo(18,'translate [2,0,0],ligands;')
        cmd.mdo(19,'translate [2,0,0],ligands;')
        cmd.mdo(20,'translate [2,0,0],ligands;')
        cmd.mdo(21,'translate [2,0,0],ligands;')
        cmd.mdo(22,'translate [2,0,0],ligands;')
        cmd.mdo(23,'translate [2,0,0],ligands;')
        cmd.mdo(24,'translate [2,0,0],ligands;')
        cmd.mdo(25,'translate [2,0,0],ligands;')
        cmd.mdo(26,'translate [2,0,0],ligands;')
        cmd.mdo(27,'translate [2,0,0],ligands;')
        cmd.mdo(28,'translate [2,0,0],ligands;')
        cmd.mdo(29,'translate [2,0,0],ligands;')
        cmd.mdo(30,'translate [2,0,0],ligands;')
        cmd.mdo(31,'translate [2,0,0],ligands;')
        cmd.mdo(32,'translate [2,0,0],ligands;')
        cmd.mdo(33,'translate [2,0,0],ligands;')
        cmd.mdo(34,'translate [2,0,0],ligands;')
        cmd.mdo(35,'translate [2,0,0],ligands;')
        cmd.mdo(36,'translate [2,0,0],ligands;')
        cmd.mdo(37,'translate [2,0,0],ligands;')
        cmd.mdo(38,'translate [2,0,0],ligands;')
        cmd.mdo(39,'translate [2,0,0],ligands;')
        cmd.mdo(40,'translate [2,0,0],ligands;')
        cmd.mdo(41,'translate [2,0,0],ligands;')
        cmd.mdo(42,'orient')
        cmd.util.mroll('42','222','1')
        cmd.mdo(223,'translate [-2,0,0],ligands;')
        cmd.mdo(224,'translate [-2,0,0],ligands;')
        cmd.mdo(225,'translate [-2,0,0],ligands;')
        cmd.mdo(226,'translate [-2,0,0],ligands;')
        cmd.mdo(227,'translate [-2,0,0],ligands;')
        cmd.mdo(228,'translate [-2,0,0],ligands;')
        cmd.mdo(229,'translate [-2,0,0],ligands;')
        cmd.mdo(230,'translate [-2,0,0],ligands;')
        cmd.mdo(231,'translate [-2,0,0],ligands;')
        cmd.mdo(232,'translate [-2,0,0],ligands;')
        cmd.mdo(233,'translate [-2,0,0],ligands;')
        cmd.mdo(234,'translate [-2,0,0],ligands;')
        cmd.mdo(235,'translate [-2,0,0],ligands;')
        cmd.mdo(236,'translate [-2,0,0],ligands;')
        cmd.mdo(237,'translate [-2,0,0],ligands;')
        cmd.mdo(238,'translate [-2,0,0],ligands;')
        cmd.mdo(239,'translate [-2,0,0],ligands;')
        cmd.mdo(240,'translate [-2,0,0],ligands;')
        cmd.mdo(241,'translate [-2,0,0],ligands;')
        cmd.mdo(242,'translate [-2,0,0],ligands;')
        cmd.mdo(243,'translate [-2,0,0],ligands;')
        cmd.mdo(244,'translate [-2,0,0],ligands;')
        cmd.mdo(245,'translate [-2,0,0],ligands;')
        cmd.mdo(246,'translate [-2,0,0],ligands;')
        cmd.mdo(247,'translate [-2,0,0],ligands;')
        cmd.mdo(248,'translate [-2,0,0],ligands;')
        cmd.mdo(249,'translate [-2,0,0],ligands;')
        cmd.mdo(250,'translate [-2,0,0],ligands;')
        cmd.mdo(251,'translate [-2,0,0],ligands;')
        cmd.mdo(252,'translate [-2,0,0],ligands;')
        cmd.mdo(253,'translate [-2,0,0],ligands;')
        cmd.mdo(254,'translate [-2,0,0],ligands;')
        cmd.mdo(255,'translate [-2,0,0],ligands;')
        cmd.mdo(256,'translate [-2,0,0],ligands;')
        cmd.mdo(257,'translate [-2,0,0],ligands;')
        cmd.mdo(258,'translate [-2,0,0],ligands;')
        cmd.mdo(259,'translate [-2,0,0],ligands;')
        cmd.mdo(260,'translate [-2,0,0],ligands;')
        cmd.mdo(261,'translate [-2,0,0],ligands;')
        cmd.mdo(262,'translate [-2,0,0],ligands;')
        cmd.mdo(263,'orient')
        cmd.util.mroll('264','442','1')
    else:
        showinfo('No ligands','There are no ligands in this PDB.')
Ejemplo n.º 16
0
    def reps(self, cleanup=0):
        rep_list = [
            "lines", "sticks", "spheres", "surface", "mesh", "dots", "ribbon",
            "cartoon"
        ]
        try:
            if not cleanup:
                cmd.disable()
                cmd.set("suspend_updates", 1, quiet=1)
                cmd.load("$PYMOL_DATA/demo/pept.pdb", "rep1")
                cmd.alter("rep1///1-5+8-13/", "ss='S'")
                cmd.cartoon("auto")
                cmd.hide("everything", "rep1")
                for a in range(2, 9):
                    cmd.create("rep%d" % a, "rep1")
                for x, y in enumerate(rep_list, 1):
                    cmd.show(x, "rep%d" % y)
                cmd.reset()
                cmd.zoom("rep1", 24)
                util.cbay("rep2")
                util.cbac("rep3")
                util.cbas("rep4")
                util.cbab("rep5")
                util.cbaw("rep6")
                util.cbay("rep8")

                cmd.set("suspend_updates", 0, quiet=1)
                scale = 0.5
                for b in range(1, 20):
                    cmd.set("suspend_updates", 0, quiet=1)
                    cmd.refresh()
                    cmd.set("suspend_updates", 1, quiet=1)
                    xt = -3.2
                    yt = 1.6
                    for a in range(1, 5):
                        cmd.translate([xt * scale, yt * scale, 0],
                                      object="rep%d" % a,
                                      camera=0)
                        xt = xt + 2
                    yt = -yt
                    xt = -3.2
                    for a in range(5, 9):
                        cmd.translate([xt * scale, yt * scale, 0],
                                      object="rep%d" % a,
                                      camera=0)
                        xt = xt + 2
                for a in range(1, 9):
                    cmd.origin("rep%d" % a, object="rep%d" % a)
                cmd.mset("1")
                st = ' '.join(
                    map(
                        lambda x, y: "rotate angle=-3,object=rep%d,axis=%s;" %
                        (x, y), list(range(1, 9)),
                        ['x', 'y', 'x', 'y', 'x', 'y', 'x', 'y']))
                cmd.mdo(1, st)
                cmd.set("suspend_updates", 0, quiet=1)
                cmd.mplay()

                cgo = []
                axes = [[4.5, 0.0, 0.0], [0.0, 3.0, 0.0], [0.0, 0.0, 3.0]]

                c = 1
                for a in rep_list:
                    ext = cmd.get_extent("rep%d" % c)
                    pos = [(ext[0][0] + ext[1][0]) / 2,
                           (ext[0][1] + ext[1][1]) / 2 + 14,
                           (ext[0][2] + ext[1][2]) / 2]
                    c = c + 1
                    pos[0] = pos[0] - (measure_text(plain, a, axes) / 2)
                    wire_text(cgo, plain, pos, a, axes)
                cmd.set("cgo_line_width", 1.5)
                cmd.set("auto_zoom", 0)
                cmd.load_cgo(cgo, 'reps')
                cmd.set("auto_zoom", 1)
            else:
                cmd.delete("rep*")
                cmd.mset()
                cmd.mstop()
        except:
            traceback.print_exc()
Ejemplo n.º 17
0
    def reps(self,cleanup=0):
        rep_list = [ "lines","sticks","spheres","surface","mesh","dots","ribbon","cartoon" ]
        try:
            if not cleanup:
                cmd.disable()
                cmd.set("suspend_updates",1,quiet=1)
                cmd.load("$PYMOL_DATA/demo/pept.pdb","rep1")
                cmd.alter("rep1///1-5+8-13/","ss='S'")
                cmd.cartoon("auto")
                cmd.hide("everything","rep1")
                for a in range(2,9):
                    cmd.create("rep%d"%a,"rep1")
                for x, y in enumerate(rep_list, 1):
                    cmd.show(x, "rep%d" % y)
                cmd.reset()
                cmd.zoom("rep1",24)
                util.cbay("rep2")
                util.cbac("rep3")
                util.cbas("rep4")
                util.cbab("rep5")
                util.cbaw("rep6")            
                util.cbay("rep8")


                cmd.set("suspend_updates",0,quiet=1)
                scale=0.5
                for b in range(1,20):
                    cmd.set("suspend_updates",0,quiet=1)
                    cmd.refresh()
                    cmd.set("suspend_updates",1,quiet=1)
                    xt=-3.2
                    yt=1.6
                    for a in range(1,5):
                        cmd.translate([xt*scale,yt*scale,0],object="rep%d"%a,camera=0)
                        xt=xt+2
                    yt=-yt
                    xt=-3.2
                    for a in range(5,9):
                        cmd.translate([xt*scale,yt*scale,0],object="rep%d"%a,camera=0)
                        xt=xt+2
                for a in range(1,9):
                    cmd.origin("rep%d"%a,object="rep%d"%a)
                cmd.mset("1")
                st = ' '.join(map(lambda x,y:"rotate angle=-3,object=rep%d,axis=%s;"%(x,y),list(range(1,9)),
                                            ['x','y','x','y','x','y','x','y']))
                cmd.mdo(1,st)
                cmd.set("suspend_updates",0,quiet=1)
                cmd.mplay()

                cgo = []
                axes = [[4.5,0.0,0.0],[0.0,3.0,0.0],[0.0,0.0,3.0]]

                c = 1
                for a in rep_list:
                    ext = cmd.get_extent("rep%d"%c)
                    pos = [(ext[0][0]+ext[1][0])/2,
                             (ext[0][1]+ext[1][1])/2+14,
                             (ext[0][2]+ext[1][2])/2]
                    c = c + 1
                    pos[0]=pos[0]-(measure_text(plain,a,axes)/2)
                    wire_text(cgo,plain,pos,a,axes)
                cmd.set("cgo_line_width",1.5)
                cmd.set("auto_zoom",0)
                cmd.load_cgo(cgo,'reps')
                cmd.set("auto_zoom",1)
            else:
                cmd.delete("rep*")
                cmd.mset()
                cmd.mstop()
        except:
            traceback.print_exc()
Ejemplo n.º 18
0
def stop():
    cmd.mstop()
Ejemplo n.º 19
0
def surface_stick():
    '''surface over stick movie'''
    glb.update()
    cmd.mstop()
    cmd.mclear()
    cmd.mset()
    cmd.mset('1', '60')
    glb.procolor(None,show_all=('sticks','surface'))
    cmd.mdo(1,'set transparency = 0.75, all;')
    cmd.mdo(2,'set transparency = 0.7, all;')
    cmd.mdo(3,'set transparency = 0.65, all;')
    cmd.mdo(4,'set transparency = 0.6, all;')
    cmd.mdo(5,'set transparency = 0.55, all;')
    cmd.mdo(6,'set transparency = 0.5, all;')
    cmd.mdo(7,'set transparency = 0.45, all;')
    cmd.mdo(8,'set transparency = 0.4, all;')
    cmd.mdo(9,'set transparency = 0.35, all;')
    cmd.mdo(10,'set transparency = 0.3, all;')
    cmd.mdo(11,'set transparency = 0.25, all;')
    cmd.mdo(12,'set transparency = 0.2, all;')
    cmd.mdo(13,'set transparency = 0.15, all;')
    cmd.mdo(14,'set transparency = 0.1, all;')
    cmd.mdo(15,'set transparency = 0.05, all;')
    cmd.mdo(16,'set transparency = 0, all;')
    cmd.mdo(17,'set transparency = 0, all;')
    cmd.mdo(19,'set transparency = 0, all;')
    cmd.mdo(20,'set transparency = 0, all;')
    cmd.mdo(21,'set transparency = 0, all;')
    cmd.mdo(22,'set transparency = 0, all;')
    cmd.mdo(23,'set transparency = 0, all;')
    cmd.mdo(24,'set transparency = 0, all;')
    cmd.mdo(25,'set transparency = 0, all;')
    cmd.mdo(26,'set transparency = 0, all;')
    cmd.mdo(27,'set transparency = 0, all;')
    cmd.mdo(28,'set transparency = 0, all;')
    cmd.mdo(29,'set transparency = 0.05, all;')
    cmd.mdo(30,'set transparency = 0.1, all;')
    cmd.mdo(31,'set transparency = 0.15, all;')
    cmd.mdo(32,'set transparency = 0.2, all;')
    cmd.mdo(33,'set transparency = 0.25, all;')
    cmd.mdo(34,'set transparency = 0.3, all;')
    cmd.mdo(35,'set transparency = 0.35, all;')
    cmd.mdo(36,'set transparency = 0.4, all;')
    cmd.mdo(37,'set transparency = 0.45, all;')
    cmd.mdo(38,'set transparency = 0.5, all;')
    cmd.mdo(39,'set transparency = 0.55, all;')
    cmd.mdo(40,'set transparency = 0.6, all;')
    cmd.mdo(41,'set transparency = 0.65, all;')
    cmd.mdo(42,'set transparency = 0.7, all;')
    cmd.mdo(43,'set transparency = 0.75, all;')
    cmd.mdo(44,'set transparency = 0.8, all;')
    cmd.mdo(45,'set transparency = 0.85, all;')
    cmd.mdo(46,'set transparency = 0.9, all;')
    cmd.mdo(47,'set transparency = 0.9, all;')
    cmd.mdo(48,'set transparency = 0.9, all;')
    cmd.mdo(49,'set transparency = 0.85, all;')
    cmd.mdo(50,'set transparency = 0.85, all;')
    cmd.mdo(51,'set transparency = 0.85, all;')
    cmd.mdo(52,'set transparency = 0.85, all;')
    cmd.mdo(53,'set transparency = 0.85, all;')
    cmd.mdo(54,'set transparency = 0.85, all;')
    cmd.mdo(55,'set transparency = 0.85, all;')
    cmd.mdo(56,'set transparency = 0.85, all;')
    cmd.mdo(57,'set transparency = 0.85, all;')
    cmd.mdo(58,'set transparency = 0.85, all;')
    cmd.mdo(59,'set transparency = 0.85, all;')
    cmd.mdo(60,'set transparency = 0.8, all;')
Ejemplo n.º 20
0
def growProtein():
    cmd.mstop()
    cmd.mclear()
    cmd.mset()
    
    glb.update()
    
    objects = cmd.get_names('all')
    
    if 'protein' in objects:
        
        cmd.bg_color('black')
        
        # create the objects to be used in this movie
        cmd.create('helix', 'ss h and protein')
        cmd.create('sheets', 'ss s and protein')
        cmd.create('surface', objects[0])
        
        cmd.mset('1', '1400')
        
        # dna and rna will be represented as sticks
        # to make them stand out from the protein
        if 'dna' in objects:
            glb.procolor('dna','sticks','cpk',None)
        
        if 'rna' in objects:
            glb.procolor('rna','sticks','cpk',None)
        
        # coloring the protein and secondary structures
        cmd.color('white', 'protein')
        cmd.color('purple', 'helix')
        cmd.color('teal', 'sheets')
        
        cmd.cartoon('loop', 'protein')
        cmd.cartoon('automatic', 'helix')
        cmd.cartoon('automatic', 'sheets')
        cmd.hide('all')
        cmd.show('cartoon', 'protein')
        
        #cmd.mdo(1,'hide cartoon, helix; hide cartoon, sheets;')
        cmd.util.mrock('2', '200', '90', '1', '1')
        cmd.mdo(201,'show cartoon, helix;')
        cmd.util.mrock('202', '400', '90', '1', '1')
        cmd.mdo(401,'show cartoon, sheets;')
        cmd.util.mrock('402', '600', '90', '1', '1')
        if 'ligands' in objects:
            cmd.color('hotpink', 'ligands')
            cmd.mdo(600, 'show spheres, ligands; show sticks, ligands;'+
                ' set sphere_transparency = 0.5, ligands;')
        cmd.util.mroll('601', '800', '1', axis = "x")
        cmd.color('blue', 'surface')
        cmd.mview('store', '800')
        cmd.turn('z', 180)
        cmd.mview('store' , '1000')
        cmd.turn('z', 180)
        cmd.mdo(800, 'show surface, surface; '+
            'set transparency = 0.8, surface;')
        cmd.mdo(850,'set transparency = 0.7, surface;')
        cmd.mdo(900,'set transparency = 0.6, surface;')
        cmd.mdo(950,'set transparency = 0.5, surface;')
        cmd.mdo(1000,'set transparency = 0.4, surface;')
        cmd.mdo(1050,'set transparency = 0.3, surface;')
        cmd.mdo(1100,'set transparency = 0.2, surface;')
        cmd.mdo(1150,'set transparency = 0.1, surface;')
        cmd.mdo(1200,'set transparency = 0.0, surface;')
        cmd.mview('store', '1200')
        cmd.util.mrock('1201', '1399', '180', '1', '1')
        cmd.hide('everything', 'surface')
        cmd.hide('everything', 'helix')
        cmd.hide('everything', 'sheets')
        cmd.reset()
        cmd.orient()
        cmd.mdo(1400,'hide everything, all; show cartoon, protein;')
        cmd.mdo(1400,'mstop')
        cmd.mview('interpolate')
        cmd.rewind()
Ejemplo n.º 21
0
def rewind():
    cmd.mstop()
    cmd.rewind()