SWISS-MODEL & PyMOL
Hands-on prediction and visualization of protein structure
Please note that the prediction of protein structure is generally very difficult and depends much on the amount of data of similar proteins stored in PDB (Protein Data Bank).
Predict the structure of protein of your interest by SWISS-MODEL.
Visualize it by PyMOL.
SWISS-MODEL
Requirements: Amino acid sequence of the protein of your interest.
- Go to SWISS-MODEL and start modelling.
- Copy and paste the sequence into the window, fill in the project name and your email (optional; if you want) and start "Search For Templates".
- Then it starts searching for templates.
- Then it generates the result. It lists similar proteins that are possibly useful for predicting your protein. Choose the best (top) one and click "Build Models". Here are some explanation about the meaning of each score.
- The predicted model has been made now. You can download the pdb file.
PyMOL
Requirements: Python3, .pdb
file generated above
- You can install the
pymol
byconda
. If you haven't installedconda
yet, you can download the zipped file from here.
$ conda install -c schrodinger pymol-bundle
- Learn how to code pymol commands referring to here (Eng) or here (Jap). Here are some example scripts I made, which may be helpful to understand how it works.
1_visualize_model.py
which visualizes the model and hightlight some regions and residues of interest by different colors.
$ python3 1_visualize_model.py model VMAT1 130 136 180 30 -100
import time import re import pymol import sys # sys.argv[1]: the name of the input model (pdb file) # sys.argv[2]: the name of output figure (png) # sys.argv[3]: the location of a residue interested # sys.argv[4]: the location of a residue interested # sys.argv[5]: the angle of x # sys.argv[6]: the angle of y # sys.argv[7]: the angle of z # python3 1_visualize_model.py model VMAT1 130 136 180 30 -100 pymol_argv = ['pymol', '-qc'] pdb_file = '%s.pdb' % sys.argv[1] #input pdb file out_png = '%s.png' % sys.argv[2] #output figure name ## Launch pymol pymol.finish_launching() pymol.cmd.load(pdb_file) pymol.cmd.enable(pdb_file) ## Some visual settings of protein structure pymol.cmd.show('cartoon') #shown by cartoon pymol.cmd.do('bg_color white') #make the background color transparent pymol.cmd.do('set ray_shadow, off') #remove shadow pymol.cmd.do('select tm1, (resi 19:48)') #select the region of interest and set its name as tm1 pymol.cmd.do('color skyblue, tm1') #change the color of tm1 to skyblue. You can check available colors here: https://pymolwiki.org/index.php/Color_Values pymol.cmd.do('select tm2, (resi 136:163)') #select the second region of interest and set its name as tm2 pymol.cmd.do('color paleyellow, tm2') #change the color of tm2 to paleyellow pymol.cmd.do('color white, not tm1 and not tm2') #change color of the other regions to white pymol.cmd.do('color red, resi %i' % int(sys.argv[3])) #change the color of residue of interest set above pymol.cmd.do('color red, resi %i' % int(sys.argv[4])) #change the color of another residue of interest set above pymol.cmd.do('turn x, %i' % int(sys.argv[5])) #set the x angle pymol.cmd.do('turn y, %i' % int(sys.argv[6])) #set the y angle pymol.cmd.do('turn z, %i' % int(sys.argv[7])) #set the z angle time.sleep(5) pymol.cmd.do('ray 2000, 2000') #set the resolution. When using png as output, I recommend to set as much resolution as possible, though it takes a while. pymol.cmd.png(out_png) pymol.cmd.refresh() pymol.cmd.quit()
2_zoomin.py
which zooms in the residues of interest (and mutates the residue if desired) and shows its side chain by sticks.
$ python3 2_zoomin.py model VMAT1_130Glu 130 GLU 180 30 -100
import time import re import pymol import sys # sys.argv[1]: name of the model (pdb file) # sys.argv[2]: the name of output figure (png) # sys.argv[3]: the location of a residue interested # sys.argv[4]: the residue to be mutated (must be capital letters) # sys.argv[5]: the angle of x # sys.argv[6]: the angle of y # sys.argv[7]: the angle of z # python3 2_zoomin.py model VMAT1_130Glu 130 GLU 180 30 -100 pymol_argv = ['pymol', '-qc'] pdb_file = '%s.pdb' % sys.argv[1] #input pdb file out_png = '%s.png' % sys.argv[2] #output figure name ## Launch pymol pymol.finish_launching() pymol.cmd.load(pdb_file) pymol.cmd.enable(pdb_file) ## Some visual settings of protein structure pymol.cmd.show('cartoon') #shown by cartoon pymol.cmd.do('bg_color white') #make the background color transparent pymol.cmd.do('set ray_shadow, off') #remove shadow pymol.cmd.do('set cartoon_color, white') # let's mutate residue 130 to GLU pymol.cmd.wizard("mutagenesis") pymol.cmd.refresh_wizard() pymol.cmd.get_wizard().do_select('%s/' % str(sys.argv[3])) pymol.cmd.get_wizard().set_mode('%s' % str(sys.argv[4])) pymol.cmd.get_wizard().apply() pymol.cmd.set_wizard() pymol.cmd.do('set stick_radius = 0.15') pymol.cmd.do('set sphere_scale = 0.15') pymol.cmd.do('select ri, byres (resi %s around 4)' % str(sys.argv[3])) #set the region of interest (here it covers 4 amino acids around the residue of interest) pymol.cmd.do('show stick, resi %s' % str(sys.argv[3])) #show stick pymol.cmd.do('set cartoon_transparency, 0.4') #set the cartoon transparent pymol.cmd.do('zoom ri') #zoom in around the residue of interest pymol.cmd.do('turn x, %i' % int(sys.argv[5])) pymol.cmd.do('turn y, %i' % int(sys.argv[6])) pymol.cmd.do('turn z, %i' % int(sys.argv[7])) ## Generate output time.sleep(5) pymol.cmd.do('ray 2000, 2000') pymol.cmd.png(out_png) ## Finish pymol pymol.cmd.refresh() pymol.cmd.quit()