def electro(self,cleanup=0):
     if not cleanup:
         cmd.set_session(self.get_sess("$PYMOL_DATA/big_demo/electro.pse"))
         cmd.do("replace_wizard toggle, Computational Chemistry (Electrostatics)")
         cmd.rock(1)
     else:
         cmd.rock(0)
 def electro(self,cleanup=0):
     if not cleanup:
         cmd.set_session(self.get_sess("$PYMOL_DATA/big_demo/electro.pse"))
         cmd.do("replace_wizard toggle, Computational Chemistry (Electrostatics)")
         cmd.rock(1)
     else:
         cmd.rock(0)
Exemple #3
0
def q5():
    '''
    DESCRIPTION

    Question 5:  How many axial stacks of helices does 
    the ribozyme have?
    
    The following commands created the scene for "q5": 
    
    delete all;fetch 3zp8, hammer, async=0;show cartoon, hammer;set_view (-0.5,0.18,-0.85,-0.17,-0.98,-0.11,-0.85,0.09,0.52,0.0,0.0,-167.2,-18.45,10.92,-12.11,126.37,208.02,-20.0);rock;

    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.
    '''
    cmd.reinitialize()
    cmd.fetch('3zp8', type='pdb', name= 'hammer', async='0')
    cmd.show_as('cartoon','hammer')
    cmd.rock()
    cmd.set_view('(-0.5,0.18,-0.85,-0.17,-0.98,-0.11,-0.85,0.09,0.52,0.0,0.0,-167.2,-18.45,10.92,-12.11,126.37,208.02,-20.0);')
    print('Enter "q5" to make the scene for question 5.')
    print('Enter "help q5" to see question 5 and the commands to make the scene.') 
Exemple #4
0
 def do_pymol(self):
     if "ray.pymol" in self.path: # send image
         self.send_response(200)
         self.send_header('Content-type',	'image/x-png')
         self.send_header('Cache-control', 'no-cache')
         self.send_header('Pragma', 'no-cache')
         self.end_headers()
         write_image(self.wfile,1)
     elif "draw.pymol" in self.path:
         self.send_response(200)
         self.send_header('Content-type',	'image/x-png')
         self.send_header('Cache-control', 'no-cache')
         self.send_header('Pragma', 'no-cache')
         self.end_headers()
         write_image(self.wfile)
     else:
         if "load" in self.path: # load a structure
             cmd.load("$TUT/1hpv.pdb")
             cmd.rock()
         self.send_response(200)
         self.send_header('Content-type',	'text/html')
         self.end_headers()
         if "status.pymol" in self.path:
             get_status(self.wfile)
         elif "monitor.pymol" in self.path:
             get_monitor(self.wfile)
         elif "quit.pymol" in self.path:
             self.wfile.write('<html><body><p>Quitting...</p></body></html>')
             self.wfile.flush()
             _shutdown()
         else: # start page
             get_start(self.wfile)
         self.wfile.flush()
Exemple #5
0
 def do_pymol(self):
     if "ray.pymol" in self.path:  # send image
         self.send_response(200)
         self.send_header('Content-type', 'image/x-png')
         self.send_header('Cache-control', 'no-cache')
         self.send_header('Pragma', 'no-cache')
         self.end_headers()
         write_image(self.wfile, 1)
     elif "draw.pymol" in self.path:
         self.send_response(200)
         self.send_header('Content-type', 'image/x-png')
         self.send_header('Cache-control', 'no-cache')
         self.send_header('Pragma', 'no-cache')
         self.end_headers()
         write_image(self.wfile)
     else:
         if "load" in self.path:  # load a structure
             cmd.load("$TUT/1hpv.pdb")
             cmd.rock()
         self.send_response(200)
         self.send_header('Content-type', 'text/html')
         self.end_headers()
         if "status.pymol" in self.path:
             get_status(self.wfile)
         elif "monitor.pymol" in self.path:
             get_monitor(self.wfile)
         elif "quit.pymol" in self.path:
             self.wfile.write(
                 '<html><body><p>Quitting...</p></body></html>')
             self.wfile.flush()
             _shutdown()
         else:  # start page
             get_start(self.wfile)
         self.wfile.flush()
 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)
 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)
Exemple #8
0
def q6():
    '''
    DESCRIPTION

    Question 6:  What is the average distance of the Na1044
    ligand bonds? Give the residue numbers of the RNA
    nucleotides and the sodium to identify them. How many
    ligands are from RNA?
   
    The following commands created the scene for "q6":
     
    delete all;fetch 3zp8, hammer, async=0; rock;preset.ball_and_stick("all");distance ligand1, i. 1044, c. A and i. 22 and n. N7;distance ligand2, i. 1044, c. A and i. 21 and n. OP2;distance ligand3, i. 1044, i. 2121;distance ligand4, i. 1044, i. 2120;distance ligand5, i. 1044, i. 2122;distance ligand6, i. 1044, i. 2130;set_view (-0.87,0.18,-0.46,-0.39,-0.81,0.44,-0.29,0.56,0.78,-0.0,0.0,-20.47,-18.05,14.02,-18.89,17.47,23.47,-20.0);

    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.
    '''
    cmd.reinitialize()
    cmd.fetch('3zp8', type='pdb', name='hammer', async='0')
    cmd.rock()
    cmd.do('preset.ball_and_stick("all")')
    cmd.distance('Sodiumligand1', ' resi 1044', 'chain A and i. 22 and n. N7')
    cmd.distance('Sodiumligand2', 'resi 1044', 'chain A and i. 21 and n. OP2')
    cmd.distance('Sodiumligand3', 'resi 1044', 'resi 2121')
    cmd.distance('Sodiumligand4', 'resi 1044', 'resi 2120')
    cmd.distance('Sodiumligand5', 'resi 1044', 'resi 2122')
    cmd.distance('Sodiumligand6', 'resi 1044', 'resi 2130')
    cmd.do('set label_size, -0.4')
    cmd.set_view(
        '(-0.87,0.18,-0.46,-0.39,-0.81,0.44,-0.29,0.56,0.78,-0.0,0.0,-20.47,-18.05,14.02,-18.89,17.47,23.47,-20.0);'
    )
    print('Enter "q6" to make the scene for question 6.')
    print(
        'Enter "help q6" to see question 6 and the commands to make the scene.'
    )
Exemple #9
0
def q8():
    '''
    DESCRIPTION

    Question 8:  Find the unusual base pair between A21 and
    G36. What is the length of the H-bonds between the bases
    (ignore the H atoms in the distance measurement)? List
    the distance with the residue name, residue number, and
    atom name. What additional H-bond occurs between a base
    in this base pair and a ribose ring of one of the two
    nucleotides in this base pair? 
   
    The following commands created the scene for "q8": 
    
    fetch 3zp8, hammer, async=0;hide everything;show ribbon;show sticks, resi 21 or resi 36;set_view (-0.9,-0.19,0.39,0.39,-0.74,0.55,0.19,0.65,0.74,0.0,0.0,-37.58,-21.66,15.71,-23.32,35.42,39.74,-20.0);rock; 

    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.
    '''
    cmd.reinitialize()
    cmd.fetch('3zp8', type='pdb', name='hammer', async='0')
    cmd.show_as('ribbon', 'hammer')
    cmd.rock()
    cmd.hide('everything')
    cmd.show_as('ribbon', 'all')
    cmd.show_as('sticks', 'resi 21 or resi 36')
    cmd.set_view(
        '(-0.9,-0.19,0.39,0.39,-0.74,0.55,0.19,0.65,0.74,0.0,0.0,-37.58,-21.66,15.71,-23.32,35.42,39.74,-20.0);'
    )
    print('Enter "q8" to make the scene for question 8.')
    print(
        'Enter "help q8" to see question 8 and the commands to make the scene.'
    )
Exemple #10
0
 def testRock(self):
     cmd.rock(1)
     self.assertTrue(cmd.get_setting_int('rock'))
     cmd.rock(0)
     self.assertFalse(cmd.get_setting_int('rock'))
     cmd.rock(-1)
     self.assertTrue(cmd.get_setting_int('rock'))
     cmd.rock(-1)
     self.assertFalse(cmd.get_setting_int('rock'))
Exemple #11
0
 def testRock(self):
     cmd.rock(1)
     self.assertTrue(cmd.get_setting_int('rock'))
     cmd.rock(0)
     self.assertFalse(cmd.get_setting_int('rock'))
     cmd.rock(-1)
     self.assertTrue(cmd.get_setting_int('rock'))
     cmd.rock(-1)
     self.assertFalse(cmd.get_setting_int('rock'))
Exemple #12
0
def q4():
    '''
    DESCRIPTION

    Question 4:  What the dihedral angle about the disulfide
    bond between MRG81 of chain F and Cys258 of chain C?
    This is a cross link between the protein and the DNA. Is
    this a cis or trans conformation of the bonds about the
    S--S bond? Is this conformation energetically favorable
    or unfavorable? 
    
    The following commands created the scene for "q4": 
 
    delete all; fetch 3v6d, HIVrt, async=0;preset.ball_and_stick("(c. C and i. 258) or (c. F and i. 817 )");set_view (0.21,-0.91,0.34,-0.84,0.01,0.54,-0.5,-0.4,-0.77,0.0,-0.0,-38.82,-39.67,-55.1,10.96,36.31,41.34,-20.0); 

    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.
    '''
    cmd.reinitialize()
    cmd.fetch('3v6d', type='pdb', name='HIVrt', async='0')
    cmd.do(
        "preset.ball_and_stick(selection='(chain C and resi 258) or (chain F and resi 817 )')"
    )
    cmd.set_view(
        '(0.21,-0.91,0.34,-0.84,0.01,0.54,-0.5,-0.4,-0.77,0.0,-0.0,-38.82,-39.67,-55.1,10.96,36.31,41.34,-20.0);'
    )
    cmd.rock()
    print('Enter "q4" to make the scene for question 4.')
    print(
        'Enter "help q4" to see question 4 and the commands to make the scene.'
    )
Exemple #13
0
def q6():
    '''
    DESCRIPTION

    Question 6:  What is the average distance of the Na1044
    ligand bonds? Give the residue numbers of the RNA
    nucleotides and the sodium to identify them. How many
    ligands are from RNA?
   
    The following commands created the scene for "q6":
     
    delete all;fetch 3zp8, hammer, async=0; rock;preset.ball_and_stick("all");distance ligand1, i. 1044, c. A and i. 22 and n. N7;distance ligand2, i. 1044, c. A and i. 21 and n. OP2;distance ligand3, i. 1044, i. 2121;distance ligand4, i. 1044, i. 2120;distance ligand5, i. 1044, i. 2122;distance ligand6, i. 1044, i. 2130;set_view (-0.87,0.18,-0.46,-0.39,-0.81,0.44,-0.29,0.56,0.78,-0.0,0.0,-20.47,-18.05,14.02,-18.89,17.47,23.47,-20.0);

    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.
    '''
    cmd.reinitialize()
    cmd.fetch('3zp8', type='pdb', name= 'hammer', async='0')
    cmd.rock()
    cmd.do('preset.ball_and_stick("all")')
    cmd.distance('Sodiumligand1',' resi 1044', 'chain A and i. 22 and n. N7')
    cmd.distance('Sodiumligand2', 'resi 1044', 'chain A and i. 21 and n. OP2')
    cmd.distance('Sodiumligand3', 'resi 1044', 'resi 2121')
    cmd.distance('Sodiumligand4', 'resi 1044', 'resi 2120')
    cmd.distance('Sodiumligand5', 'resi 1044', 'resi 2122')
    cmd.distance('Sodiumligand6', 'resi 1044', 'resi 2130')
    cmd.do('set label_size, -0.4')
    cmd.set_view('(-0.87,0.18,-0.46,-0.39,-0.81,0.44,-0.29,0.56,0.78,-0.0,0.0,-20.47,-18.05,14.02,-18.89,17.47,23.47,-20.0);')   
    print('Enter "q6" to make the scene for question 6.')
    print('Enter "help q6" to see question 6 and the commands to make the scene.') 
Exemple #14
0
def q8():
    '''
    DESCRIPTION

    Question 8:  Find the unusual base pair between A21 and
    G36. What is the length of the H-bonds between the bases
    (ignore the H atoms in the distance measurement)? List
    the distance with the residue name, residue number, and
    atom name. What additional H-bond occurs between a base
    in this base pair and a ribose ring of one of the two
    nucleotides in this base pair? 
   
    The following commands created the scene for "q8": 
    
    fetch 3zp8, hammer, async=0;hide everything;show ribbon;show sticks, resi 21 or resi 36;set_view (-0.9,-0.19,0.39,0.39,-0.74,0.55,0.19,0.65,0.74,0.0,0.0,-37.58,-21.66,15.71,-23.32,35.42,39.74,-20.0);rock; 

    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.
    '''
    cmd.reinitialize()
    cmd.fetch('3zp8', type='pdb', name= 'hammer', async='0')
    cmd.show_as('ribbon', 'hammer')
    cmd.rock()
    cmd.hide('everything')
    cmd.show_as( 'ribbon','all') 
    cmd.show_as('sticks', 'resi 21 or resi 36')
    cmd.set_view('(-0.9,-0.19,0.39,0.39,-0.74,0.55,0.19,0.65,0.74,0.0,0.0,-37.58,-21.66,15.71,-23.32,35.42,39.74,-20.0);')
    print('Enter "q8" to make the scene for question 8.')
    print('Enter "help q8" to see question 8 and the commands to make the scene.') 
Exemple #15
0
def q7():
    '''
    DESCRIPTION

    Question 7:  Measure the longest dimension and the
    shortest dimension of the ribozyme. Enter "rock" to 
    stop the rocking motion. What is the ratio of
    the longest dimension to the shortest dimension? Is it
    globular like a protein?  
    
    The following commands created the scene for "q7": 

    delete all;fetch 3zp8, hammer, async=0;show ribbon, hammer;set_view (0.62,0.14,0.78,0.13,-0.99,0.07,0.78,0.05,-0.63,-0.0,-0.0,-169.8,-16.43,9.44,-9.63,143.54,196.05,-20.0); rock;

    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.
    '''
    cmd.reinitialize()
    cmd.fetch('3zp8', type='pdb', name='hammer', async='0')
    cmd.show_as('ribbon', 'hammer')
    cmd.rock()
    cmd.set_view(
        '(0.62,0.14,0.78,0.13,-0.99,0.07,0.78,0.05,-0.63,-0.0,-0.0,-169.8,-16.43,9.44,-9.63,143.54,196.05,-20.0);'
    )
    print('Enter "q7" to make the scene for question 7.')
    print(
        'Enter "help q7" to see question 7 and the commands to make the scene.'
    )
 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")
Exemple #17
0
def q3():
    '''
    DESCRIPTION

    Question 3: In which groove of the DNA 
    is the protein making the most contacts? 
    Is this unusual? 
    
    The following commands created the scene for "q3": 
    
    delete all; fetch 3v6d, HIVrt, async=0; show cartoon, c. A or c. B;hide lines, c. A or c. B;set_view (0.53,-0.06,-0.84,0.82,-0.21,0.53,-0.21,-0.98,-0.07,-0.0,-0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);rock;

    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.
    '''
    cmd.reinitialize()
    cmd.fetch('3v6d', type='pdb', name='HIVrt', async='0')
    cmd.show_as("cartoon", "c. A or c. B")
    cmd.hide("lines", "c. A or c. B")
    cmd.rock()
    cmd.set_view(
        '(0.53,-0.06,-0.84,0.82,-0.21,0.53,-0.21,-0.98,-0.07,-0.0,-0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);'
    )
    print('Enter "q3" to make the scene for question 3.')
    print(
        'Enter "help q3" to see question 3 and the commands to make the scene.'
    )
 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")
Exemple #19
0
def q2():
    '''
    DESCRIPTION

    Question 2: Look along the helical axis of the DNA. 
    Is the DNA helix bent?
    
    The following commands created the scene for "q2": 

    delete all; fetch 3v6d, HIVrt, async=0; rock;show cartoon, c. P or c. T;set_view (0.61,0.29,-0.73,0.78,-0.37,0.51,-0.12,-0.88,-0.45,-0.0,-0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);  
    
    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.

    '''
    cmd.reinitialize()
    cmd.fetch('3v6d', type='pdb', name='HIVrt', async='0')
    cmd.rock()
    cmd.show_as("cartoon", "chain P or chain T")
    cmd.set_view(
        '(0.61,0.29,-0.73,0.78,-0.37,0.51,-0.12,-0.88,-0.45,-0.0, 0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);'
    )
    print('Enter "q2" to make the scene for question 2.')
    print(
        'Enter "help q2" to see question 2 and the commands to make the scene.'
    )
Exemple #20
0
def q4():
    '''
    DESCRIPTION

    Question 4:  What the dihedral angle about the disulfide
    bond between MRG81 of chain F and Cys258 of chain C?
    This is a cross link between the protein and the DNA. Is
    this a cis or trans conformation of the bonds about the
    S--S bond? Is this conformation energetically favorable
    or unfavorable? 
    
    The following commands created the scene for "q4": 
 
    delete all; fetch 3v6d, HIVrt, async=0;preset.ball_and_stick("(c. C and i. 258) or (c. F and i. 817 )");set_view (0.21,-0.91,0.34,-0.84,0.01,0.54,-0.5,-0.4,-0.77,0.0,-0.0,-38.82,-39.67,-55.1,10.96,36.31,41.34,-20.0); 

    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.
    '''
    cmd.reinitialize()
    cmd.fetch('3v6d',type='pdb',name='HIVrt',async='0')
    cmd.do("preset.ball_and_stick(selection='(chain C and resi 258) or (chain F and resi 817 )')")
    cmd.set_view('(0.21,-0.91,0.34,-0.84,0.01,0.54,-0.5,-0.4,-0.77,0.0,-0.0,-38.82,-39.67,-55.1,10.96,36.31,41.34,-20.0);')
    cmd.rock()
    print('Enter "q4" to make the scene for question 4.')
    print('Enter "help q4" to see question 4 and the commands to make the scene.') 
Exemple #21
0
def q5():
    '''
    DESCRIPTION

    Question 5:  How many axial stacks of helices does 
    the ribozyme have?
    
    The following commands created the scene for "q5": 
    
    delete all;fetch 3zp8, hammer, async=0;show cartoon, hammer;set_view (-0.5,0.18,-0.85,-0.17,-0.98,-0.11,-0.85,0.09,0.52,0.0,0.0,-167.2,-18.45,10.92,-12.11,126.37,208.02,-20.0);rock;

    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.
    '''
    cmd.reinitialize()
    cmd.fetch('3zp8', type='pdb', name='hammer', async='0')
    cmd.show_as('cartoon', 'hammer')
    cmd.rock()
    cmd.set_view(
        '(-0.5,0.18,-0.85,-0.17,-0.98,-0.11,-0.85,0.09,0.52,0.0,0.0,-167.2,-18.45,10.92,-12.11,126.37,208.02,-20.0);'
    )
    print('Enter "q5" to make the scene for question 5.')
    print(
        'Enter "help q5" to see question 5 and the commands to make the scene.'
    )
Exemple #22
0
def q7():
    '''
    DESCRIPTION

    Question 7:  Measure the longest dimension and the
    shortest dimension of the ribozyme. Enter "rock" to 
    stop the rocking motion. What is the ratio of
    the longest dimension to the shortest dimension? Is it
    globular like a protein?  
    
    The following commands created the scene for "q7": 

    delete all;fetch 3zp8, hammer, async=0;show ribbon, hammer;set_view (0.62,0.14,0.78,0.13,-0.99,0.07,0.78,0.05,-0.63,-0.0,-0.0,-169.8,-16.43,9.44,-9.63,143.54,196.05,-20.0); rock;

    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.
    '''
    cmd.reinitialize()
    cmd.fetch('3zp8', type='pdb', name= 'hammer', async='0')
    cmd.show_as('ribbon', 'hammer')
    cmd.rock()
    cmd.set_view('(0.62,0.14,0.78,0.13,-0.99,0.07,0.78,0.05,-0.63,-0.0,-0.0,-169.8,-16.43,9.44,-9.63,143.54,196.05,-20.0);')
    print('Enter "q7" to make the scene for question 7.')
    print('Enter "help q7" to see question 7 and the commands to make the scene.') 
Exemple #23
0
def q3():
    '''
    DESCRIPTION

    Question 3: In which groove of the DNA 
    is the protein making the most contacts? 
    Is this unusual? 
    
    The following commands created the scene for "q3": 
    
    delete all; fetch 3v6d, HIVrt, async=0; show cartoon, c. A or c. B;hide lines, c. A or c. B;set_view (0.53,-0.06,-0.84,0.82,-0.21,0.53,-0.21,-0.98,-0.07,-0.0,-0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);rock;

    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.
    '''
    cmd.reinitialize()
    cmd.fetch('3v6d', type='pdb', name= 'HIVrt', async='0')
    cmd.show_as("cartoon","c. A or c. B") 
    cmd.hide("lines","c. A or c. B") 
    cmd.rock()
    cmd.set_view('(0.53,-0.06,-0.84,0.82,-0.21,0.53,-0.21,-0.98,-0.07,-0.0,-0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);')
    print('Enter "q3" to make the scene for question 3.')
    print('Enter "help q3" to see question 3 and the commands to make the scene.') 
Exemple #24
0
def q1():
    '''
    DESCRIPTION

    Question 1: Explain how AZT terminates extension of the DNA chain. 
    
    The following commands created the scene for "q1": 
    
    delete all; fetch 3v6d, HIVrt, async=0; rock;preset.ball_and_stick("c. P and i. 822");set_view (-0.99,-0.1,0.06,0.09,-0.39,0.92,-0.07,0.92,0.39,0.0,0.0,-29.2,-10.56,24.72,39.27,23.02,35.38,-20.0); 

    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.
    '''
    cmd.reinitialize()
    cmd.fetch('3v6d', type='pdb', name='HIVrt',async='0')
    cmd.rock()
    preset.ball_and_stick('c. P and i. 822')
    cmd.set_view('(-0.99,-0.1,0.06,0.09,-0.39,0.92,-0.07,\
    0.92,0.39,0.0,0.0,-29.2,-10.56,24.72,39.27,\
    23.02,35.38,-20.0)') 
    print('Enter "q1" to set scene for question 1.')
    print('Enter "help q1" for more information.') 
Exemple #25
0
def q2():
    '''
    DESCRIPTION

    Question 2: Look along the helical axis of the DNA. 
    Is the DNA helix bent?
    
    The following commands created the scene for "q2": 

    delete all; fetch 3v6d, HIVrt, async=0; rock;show cartoon, c. P or c. T;set_view (0.61,0.29,-0.73,0.78,-0.37,0.51,-0.12,-0.88,-0.45,-0.0,-0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);  
    
    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.

    '''
    cmd.reinitialize()
    cmd.fetch('3v6d',type='pdb',name='HIVrt',async='0')
    cmd.rock()
    cmd.show_as("cartoon","chain P or chain T")
    cmd.set_view('(0.61,0.29,-0.73,0.78,-0.37,0.51,-0.12,-0.88,-0.45,-0.0, 0.0,-192.99,-29.84,8.42,47.76,178.27,207.7,-20.0);')
    print('Enter "q2" to make the scene for question 2.')    
    print('Enter "help q2" to see question 2 and the commands to make the scene.')
Exemple #26
0
def q1():
    '''
    DESCRIPTION

    Question 1: Explain how AZT terminates extension of the DNA chain. 
    
    The following commands created the scene for "q1": 
    
    delete all; fetch 3v6d, HIVrt, async=0; rock;preset.ball_and_stick("c. P and i. 822");set_view (-0.99,-0.1,0.06,0.09,-0.39,0.92,-0.07,0.92,0.39,0.0,0.0,-29.2,-10.56,24.72,39.27,23.02,35.38,-20.0); 

    To reuse of parts or all of the above commands, copy and paste the commands 
    onto the command line or into a plain text file. 
      
    These commands are sufficient for most editing tasks:  
    To edit code, positon cursor on command line with left mouse button.  
    Control-e moves the cursor to the end of the line, even when it is out of view.
    Control-a moves the cursor to the beginning of the line, even when it is out of view.    
    Up arrow key recalls last line of commands for editing.

    These commands may not be available on all systems:
    Shift-control-a selects everything from the right of the cursor to the end of the line.
    Shift-control-e selects everything to the left of the cursor to the end of the line.
    Command-f moves the cursor to the end of the current word.   
    Command-b moves the cursor to the begining of the current word.
    Control-f moves the cursor to the right by one character.   
    Control-b moves the cursor to the left by one character.
    '''
    cmd.reinitialize()
    cmd.fetch('3v6d', type='pdb', name='HIVrt', async='0')
    cmd.rock()
    preset.ball_and_stick('c. P and i. 822')
    cmd.set_view('(-0.99,-0.1,0.06,0.09,-0.39,0.92,-0.07,\
    0.92,0.39,0.0,0.0,-29.2,-10.56,24.72,39.27,\
    23.02,35.38,-20.0)')
    print('Enter "q1" to set scene for question 1.')
    print('Enter "help q1" for more information.')
 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()
 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()
Exemple #29
0
# 

# full blown threading stability test - low event rate
#
# The user should make it a point of interacting with the GUI
# while this test is running, including using menus in both the
# external and internal guis, issuing commands, and of course
# terminating the script when it is done.
      
import threading
import time
import random
from pymol import cmd

cmd.rock()

def load_save1():
   while 1:
      time.sleep(random.random())
      cmd.delete("obj1")
      cmd.load("dat/pept.pdb","obj1")
      time.sleep(random.random())
      cmd.save("tmp/T01a.pdb","obj1")
      
t = threading.Thread(target=load_save1)
t.setDaemon(1)
t.start()
   
def bg_rgb():
   while 1:
      time.sleep(random.random()*5)