def testIsolevel(self): cmd.viewport(100, 100) cmd.fragment('gly', 'm1') cmd.set('gaussian_b_floor', 30) cmd.set('mesh_width', 5) cmd.map_new('map') cmd.delete('m1') # make mesh cmd.isodot('dot', 'map') cmd.isodot('dot', 'map', source_state=1, state=-2) ## check mesh presence by color meshcolor = 'red' cmd.color(meshcolor, 'dot') self.ambientOnly() self.assertImageHasColor(meshcolor) cmd.frame(2) self.assertEqual(cmd.get_state(), 2) self.assertImageHasColor(meshcolor) for contourlvl in range(7): cmd.isolevel('dot', contourlvl) self.assertImageHasColor(meshcolor) cmd.isolevel('dot', 10) self.assertImageHasNotColor(meshcolor)
def test(self): cmd.viewport(100,100) cmd.set('gaussian_b_floor', 20) cmd.set('ambient', 1) cmd.set('specular', 0) cmd.set('mesh_color', 'blue') cmd.set('dot_color', 'green') cmd.fragment('gly') cmd.map_new('map1') cmd.disable('*') cmd.isomesh('o1', 'map1') cmd.color('red', 'o1') cmd.show('cell') self._check_colors('red', 'blue') cmd.delete('o1') cmd.isodot('o1', 'map1') cmd.color('red', 'o1') self._check_colors('green') cmd.delete('o1') cmd.gradient('o1', 'map1') cmd.color('yellow', 'o1') self._check_colors('yellow') cmd.delete('o1')
def testIsodot(self): cmd.viewport(100, 100) cmd.fragment('gly', 'm1') cmd.set('gaussian_b_floor', 30) cmd.set('mesh_width', 5) cmd.map_new('map') cmd.delete('m1') # make mesh cmd.isodot('dot', 'map') cmd.isodot('dot', 'map', source_state=1, state=-2) ## check mesh presence by color meshcolor = 'red' cmd.color(meshcolor, 'dot') self.ambientOnly() self.assertImageHasColor(meshcolor) cmd.frame(2) self.assertEqual(cmd.get_state(), 2) self.assertImageHasColor(meshcolor) with testing.mktemp('.pse') as filename: cmd.save(filename) cmd.delete('*') self.assertImageHasNotColor(meshcolor) cmd.load(filename) self.assertImageHasColor(meshcolor) cmd.frame(2) self.assertEqual(cmd.get_state(), 2) self.assertImageHasColor(meshcolor)
def edot(event): delcrea() try: if len(nameit.get()) < 1: showinfo("Error", 'Enter a name for the object') interior.mainloop() elif len(pdbname.get()) < 1: showinfo('Error', "Enter the Map Filename") interior.mainloop() else: cmd.isodot(nameit.get(), pdbname.get(), contour1.get()) except: showinfo("Error", 'No map is present') interior.mainloop()
def edot1(event): delcrea() try: if len(nameit.get()) < 1: showinfo("Error", 'Enter a name for the object') interior.mainloop() elif len(pdbname.get()) < 1: showinfo('Error', "Enter the Map Filename") interior.mainloop() else: cmd.isodot(nameit.get(), pdbname.get(), contour1.get(), ('sele')) except: cmd.orient('all') showinfo("Error", 'No map is present\n Or there is no selection ("sele")') interior.mainloop()
def edot(*args): delcrea() try: cmd.isodot('map1','map', contour1.get()) except: try: cmd.set("suspend_updates",1,quiet=1) cmd.remove("hydro") cmd.enable('all') cmd.map_new('map',"gaussian","0.75", 'all') cmd.isodot("map1", "map", 9999.0, 'all') cmd.set("suspend_updates",0,quiet=1) cmd.refresh() cmd.isodot('map1','map', contour1.get()) except: showinfo("Error", 'No PDB is present') interior.mainloop()
def edot(*args): delcrea() try: cmd.isodot('map1', 'map', contour1.get()) except: try: cmd.set("suspend_updates", 1, quiet=1) cmd.remove("hydro") cmd.enable('all') cmd.map_new('map', "gaussian", "0.75", 'all') cmd.isodot("map1", "map", 9999.0, 'all') cmd.set("suspend_updates", 0, quiet=1) cmd.refresh() cmd.isodot('map1', 'map', contour1.get()) except: showinfo("Error", 'No PDB is present') interior.mainloop()
def edot1(event): delcrea() try: cmd.isodot('map1','map', contour1.get(), 'sele') except: try: cmd.set("suspend_updates",1,quiet=1) cmd.remove("hydro") cmd.enable('all') cmd.map_new('map',"gaussian","0.75", 'all') cmd.isodot("map1", "map", 9999.0, 'all') cmd.set("suspend_updates",0,quiet=1) cmd.refresh() cmd.isodot('map1','map', contour1.get(), 'sele') cmd.get_names('all') except: cmd.orient('all') showinfo("Error", 'No PDB is present\nOr there is no selection ('"sele"')') interior.mainloop()
def edot1(event): delcrea() try: cmd.isodot('map1', 'map', contour1.get(), 'sele') except: try: cmd.set("suspend_updates", 1, quiet=1) cmd.remove("hydro") cmd.enable('all') cmd.map_new('map', "gaussian", "0.75", 'all') cmd.isodot("map1", "map", 9999.0, 'all') cmd.set("suspend_updates", 0, quiet=1) cmd.refresh() cmd.isodot('map1', 'map', contour1.get(), 'sele') cmd.get_names('all') except: cmd.orient('all') showinfo( "Error", 'No PDB is present\nOr there is no selection (' "sele" ')') interior.mainloop()
def dot_sticks(): cmd.hide('everything') glb.update() cmd.map_new('map', "gaussian", "0.75", 'all') cmd.isodot("map1", "map", 9999.0, 'all') cmd.isodot('map1', 'map', '1')