Difference between revisions of "Biochemistry student intro"

From PyMOLWiki
Jump to navigation Jump to search
Line 287: Line 287:
 
  set ray_trace_frames, 1
 
  set ray_trace_frames, 1
 
But note, this takes a '''looong''' time, so wait until you are SURE that you have the final movie
 
But note, this takes a '''looong''' time, so wait until you are SURE that you have the final movie
 +
 +
==== Collect images and create movie in "Windows Live Movie Maker"  ====
 +
# Add all images from folder
 +
# Ctrl+a to select all images
 +
# Click in tab "Edit", set Duration to: 0,03
 +
# Click in tab "Home", "Save movie", "Windows Phone (small)"
 +
You are done
 
[[Category:Tutorials]]
 
[[Category:Tutorials]]

Revision as of 16:13, 1 March 2013

Biochemistry course

This tutorial was written directly for biochemistry students at Copenhagen University, 2012/2013.

This is the very first introduction to the powerful molecular visualizer PyMOL.
We will only cover the very basic steps to get a image of your enzyme and put in your written student article.

If you want to read about PyMOL, then try this introduction Practical_Pymol_for_Beginners

Install PyMOL to your computer

You first want to install PyMOL.
Do this, by following this guide.
MAC Pre-compiled_PyMOL through brew or MAC Pre-compiled_PyMOL through fink
Windows Pre-compiled_PyMOL
You don't have to follow the steps of extending PyMOL, but if you are a little technical, and want to become friends with PyMOL over time, then consider it.

Find a suitable protein data file

We need to find a Protein Databank File (PDB), which describe the x,y,z coordinates of your enzyme.
These are stored at the homepage: http://www.rcsb.org
Find a suitable file by searching for: porcine kidney fructose 1,6-bisphosphatase
The PDB file "1lev", seems suitable.

Read more about your protein

There exist homepages, to get more info about your protein.
These homepages collect material from several sources, and present them in easy format.

http://www.proteopedia.org/wiki/index.php/1lev
http://pdbwiki.org/wiki/1lev

Background

This tutorial is designed to give you a basic working knowledge of making pretty and informative pictures of protein structures using PyMOL.
This tutorial does not cover all the functions of PyMol, but tries to focus on the most important ones.
A great resource for more advanced use is this wiki and the large number of good tutorials found online, which can be accessed via google.

When you open PyMOL you will see two windows opening.
The upper window entitled PyMOL Tcl/Tk GUI controls the general settings and functionalities of the program while the lower one entitled PyMOL viewer, contains the settings that are related to the current display of the molecule.
Each of these two windows contain a command line, where we can enter commands into the program.
One can, however, get really far without ever having to worry about writing any commands.

First, we will need to load a structure file into the program. Protein structures are deposited at www.pdb.org
There are several ways to open this file:
Either we can download the file from PDB and save it to our computer.
We can then open the PDB file using the menu File > Open.
We can also use the pdb loader service Plugin > PDB loader service and enter the PDB id,
or we can write: fetch followed by the PDB id in either of the two command lines.
The Viewer window should now contain the PDB file displayed with lines.

In the right hand side of the viewer window there is a selection menu that currently contains two lines:
all and the four character name of the PDB file, ex. 1lev.
Later on we will make new selections that will appear in this menu.
Each of the two lines have 5 buttons labeled A (Actions), S (Show), H (Hide), L (Label), C (Color)
. Press these buttons to see the options available in each menu.

Hide the line representation. Press H > everything in the all line. This will remove the line representation of the molecule.
Visualize the molecule in the cartoon representation by selecting S > cartoon.
Try also to show the molecule as ribbon, sticks or surface to get a feeling for the different representations.
The cartoon option gives us the best overview of the overall structure, so hide the other representations and show the protein only in cartoon mode.
Color everything white selecting C > grey > white.

Ok, now we are going to try to move the molecule around.
Try to move the mouse around while pressing the left mouse button. This will rotate the molecule.
Try to move it around holding the middle button (moves the view) or the right button (zooms in and out).
If you have a one or two button mouse you can change the mode in the Mouse menu in the Tcl/Tk GUI window.
The box in the lower right corner will show how to move and rotate the molecule in this case.

Start your PyMOL

Start your shortcut to PyMOL "C:\Python27\PyMOL\PyMOL.exe"

Now click and do the following:

  1. Top Menu: Plugin -> PDB Loader Service -> 1lev OK
  2. Right Menu: -> 1lev -> "A" -> preset -> Publication
  3. Top Menu: Display -> Sequence
  4. Top Menu: Display -> Sequence Mode -> Chains
  5. In Sequence, select so all "F" is marked.
  6. Right Menu: -> (sele) -> "A" -> remove atoms
  7. Top Menu: Display -> Sequence Mode -> Residue Codes
  8. In Sequence, select so only substrate (F6P) is marked (A/338)
  9. Right Menu: -> (sele) -> "A" -> zoom
  10. Right Menu: -> (sele) -> "A" -> rename selection -> f6p
  11. Right Menu: -> (f6p) -> "C" -> by element -> Select to Carbon is not green
  12. Right Menu: -> (f6p) -> "A" -> find polar contacts -> to others excluding solvent
  13. In Sequence, select so only MN is marked (A/340)
  14. Right Menu: -> (sele) -> "A" -> rename selection -> mn
  15. Right Menu: -> (mn) -> "S" -> spheres
  16. Write in console: select act_site, byres f6p around 3.5
  17. Right Menu: -> (act_site) -> "S" -> sticks
  18. Right Menu: -> (act_site) -> "L" -> residues
  19. Find a good view, and push "Ray" in the top right of the grey command console.
  20. Top Menu: File -> Save Image As -> PNG
  21. Put it into your student article

The "Faster" way

The real power of PyMOL, comes into power, when your write a PyMOL command file.
Here you write which commands pymol should execute, and so it only take 1 second to get the same.
The commands are stored in a ".pml" file.

Open Notepad, and then: File->Save as->All files-> C:\Users\YOU\pymol\1lev.pml

# Best to restart PyMOL every time from fresh
reinitialize
cd C:\Users\DIG\pymol

fetch 1lev, async=0
preset.publication(selection='all')
remove chain F
select substrates, organic
select f6p, id 4770-4785
zoom f6p
util.cbac('f6p')

select act_site, byres f6p around 3.5
distance pol_cont, f6p, act_site, mode=2

select cli, /1lev//A/CLI
select mn, name MN
show spheres, mn

show sticks, act_site
label act_site and name CB, resn+resi

zoom pol_cont
viewport 1024,768
ray
png 1lev.png
  1. "#" Line starting with hashes is not read by PyMOL. Use a comment field.
  2. Best to restart PyMOL every time from fresh
  3. Go to your working directory
  4. Get the pdb file from the RCSB server. async=0 makes sure it waits for completion of download before continuing.

Then you just open the .pml file with PyMOL.
Or start PyMOL, and write in command: @1lev.pml
Or start PyMOL, top menu -> File -> Run... -> C:\Users\YOU\pymol\1lev.pml

Movie of Epidermal Growth Factor

Lets make a movie of the Molecule of the month on RCSB.org.
Let's take a membrane protein, 1nql@rcsb, pdbwiki, proteopedia
June 2010 Molecule of the Month by David Goodsell

Open Notepad, and then: File->Save as->All files-> C:\Users\YOU\pymol\1nql.pml

reinitialize

fetch 1nql, type=pdb1, multiplex=1,async=0

# So we get buttons for scenes
set scene_buttons, 1
viewport 1280,800
bg_color white
set fog_start, 0.60

#### Scene 1, publication ####
show_as cartoon, all
preset.publication(selection='all')

# See http://pymolwiki.org/index.php/Single-word_Selectors
extract substrates, organic
util.cbac('substrates')
select others, inorganic
select water, solvent
# See http://pymolwiki.org/index.php/Selection_Macros
# Select organic molecules
select nag, ////NAG
select bma, ////BMA
disable bma
# Hide organic
hide everything, substrates

# Save scene 1

zoom 1nql
scene F1, store, Publication

#### Scene 2, show cysteines ####
# Select sulfurs, since they play a role
select sulf_cys, resn cys and not (name O or name N or name C)
disable sulf_cys
show sticks, sulf_cys
color sulfur, sulf_cys and elem S
set_view (\
     0.351475894,    0.052040517,    0.934747040,\
    -0.784766018,   -0.528064251,    0.324480295,\
     0.510492086,   -0.847605526,   -0.144762829,\
     0.000000000,    0.000000000, -258.137542725,\
    47.065788269,  -10.656063080,    0.561561584,\
   217.718627930,  298.556427002,  -20.000000000 )
scene F2, store, Cysteines

#### Scene 3, show organis ####
show sticks, substrates
set_view (\
    -0.350075662,   -0.229279995,   -0.908223689,\
     0.627038240,    0.662946343,   -0.409051389,\
     0.695891201,   -0.712693632,   -0.088314489,\
    -0.000047103,    0.000066929, -180.624176025,\
    29.827386856,   19.096229553,   14.554395676,\
   144.383483887,  216.888458252,  -20.000000000 )
scene F3, store, substrates

#### Scene 4, polar contacts ####
select prot_cont, byres substrates around 3.5
distance subs_bond, substrates, prot_cont, mode=2
show sticks, prot_cont
set_view (\
    -0.564916074,    0.749067366,    0.346062332,\
     0.049069319,   -0.388159811,    0.920283496,\
     0.823683023,    0.536867142,    0.182521686,\
     0.000190482,   -0.000248071,  -91.693801880,\
    25.880264282,   29.162174225,   10.565655708,\
    55.450801849,  127.955612183,  -20.000000000 )
scene F4, store, polar contacts

@movie.pml

Open Notepad, and then: File->Save as->All files-> C:\Users\YOU\pymol\movie.pml

set movie_panel, 1
mset 1 x1000

scene F1
python

f=1
cmd.frame(f)
cmd.mview("store",scene="F1")
f=f+99; print f
cmd.frame(f)
cmd.mview("store",scene="F1")

f=f+49; print f
cmd.frame(f)
cmd.mview("store",scene="F2")
f=f+99; print f
cmd.frame(f)
cmd.mview("store",scene="F2")

f=f+49; print f
cmd.frame(f)
cmd.mview("store",scene="F3")
f=f+99; print f
cmd.frame(f)
cmd.mview("store",scene="F3")

f=f+49; print f
cmd.frame(f)
cmd.mview("store",scene="F4")
f=f+99; print f
cmd.frame(f)
cmd.mview("store",scene="F4")

f=f+49; print f
cmd.frame(f)
cmd.turn('y',50)
cmd.mview("store")

f=f+99; print f
cmd.frame(f)
cmd.turn('y',-100)
cmd.mview("store")

f=f+49; print f
cmd.frame(f)
cmd.turn('y',50)
cmd.mview("store")

f=f+49; print f
cmd.frame(f)
cmd.mview("store",scene="F4")

python end

frame 1
mplay

Export movies

Write in command

frame 1

Then go to File->Save Movie As -> PNG Images

If you wan't to have a really nice movie, you want to have all images ray-traced. Then do

set ray_trace_frames, 1

But note, this takes a looong time, so wait until you are SURE that you have the final movie

Collect images and create movie in "Windows Live Movie Maker"

  1. Add all images from folder
  2. Ctrl+a to select all images
  3. Click in tab "Edit", set Duration to: 0,03
  4. Click in tab "Home", "Save movie", "Windows Phone (small)"

You are done