-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPYMOL_Chartograph.html
400 lines (297 loc) · 15.3 KB
/
PYMOL_Chartograph.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
<!DOCTYPE html>
<html>
<head>
<title>Chartograph</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link href='http://fonts.googleapis.com/css?family=Rokkitt' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="http://www.chartograph.com/title/d3.js"></script>
<script type="text/javascript" src="http://www.chartograph.com/title/d3.geom.js"></script>
<script type="text/javascript" src="http://www.chartograph.com/title/d3.layout.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-52357311-1', 'auto');
ga('send', 'pageview');
</script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap-theme.min.css">
<style>
body { padding-top: 50px; }
</style>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Chartograph</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="http://www.chartograph.com/">Home</a></li>
<li><a href="http://www.chartograph.com/ms/index.html">MS</a></li>
<li><a href="http://www.chartograph.com/hplc/index.html">HPLC (beta)</a></li>
<li><a href="http://www.chartograph.com/chroma/index.html">Affinity Chromatography</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>Francis Group PyMOL Tutorial</h1>
<p>Matthew Francis and Richard Kwant, August 17, 2015</p>
<h3>Getting Files</h3>
<p>The Protein Data Bank (PDB, found at <a href="http://rcsb.org">rcsb.org</a>) is a central source for most protein structures.
In fact, most publications require upload of structures to the PDB as a condition of publication.
It is easiest to find structures on the PDB if you know their 4-character PDBID, but it's also possible to search a large number of fields to find a desired protein structure.
These fields include protein name, organism, enzyme classification, structural domains, resolution, and sequence level details.
Since there are many structures available, pay careful attention to which structure you choose.
It's usually best to select a high resolution structure with no mutations.
</p>
<p>To download a file, click the "download files" link in the top right of a structure page, and then select the text option. Alternatively, you can open Pymol and type
<code>fetch</code> followed by the PDBID to download the file and open it automatically.
</p>
<h3>Sessions, undo, and saving</h3>
<p>
You should not expect to be able to undo your actions in PyMOL. In some cases it is possible to undo actions, but the implementation is spotty and the results are inconsistent.
Instead, it's best to save the session, which saves both the structures that are open, the current selections, and all of the formatting.
To save a session, go to File → Save session as . . .
</p>
<h3>Pymol basics</h3>
<p>
Let's start by loading the structure of ubiquitin with PDBID 1UBQ. Type the following into the command prompt that starts with <code>PyMOL></code> at the bottom of the screen and press enter.
</p>
<p><code>fetch 1ubq</code></p>
<p>
This command retrieves the .pdb file from the PDB server and opens it.
If you look in the object pane on the right side of the window, you'll see 1UBQ listed.
Each object loaded into Pymol has has five menus associated with it.
They're shown as A, S, H, L, and C and stand for Actions, Show, Hide, Label and Color.
These buttons provide access to many of the common actions that you'll want to perform in Pymol, but you can also accomplish every action by typing its command in the command line at the bottom of the screen.
</p>
<p>
Let's start by removing the water molecules from the structure
</p>
<p><code>remove resn hoh</code></p>
<p>
This command removes every residue in the structure with the name HOH, a residue name reserved for waters.
You can also remove waters by showing the sequence (Display → Sequence), selecting the waters (shown as O) with your mouse, clicking the A next to <code>sele</code> in the object pane, and then clicking remove atoms.
The image below shows this process.
</p>
<p><img src="http://www.chartograph.com/assets/pymol_figures/remove_waters.png"></p>
<p>
Let's start by Hiding everything (1UBQ → H → everything).
Next, show the cartoon representation of the protein (1UBQ → S → Cartoon) and show the sticks (1UBQ → S → Sticks).
We can then color by atom type (1UBQ → C → by element).
Coloring by element is a great way to highlight certain sections of the protein without losing the element information.
We can accomplish this same sequence of manipulations by executing the following commands:
</p>
<p><code>
hide everything<br>
show cartoon<br>
show sticks<br>
util.cbab<br>
</code></p>
The <code>util.cbab</code> command is a function whose name stands for "color by atom blue."
To access other colors, you can change the last letter of the function (e.g. <code>util.cbag</code> for green, <code>util.cbac</code> for cyan, <code>util.cbam</code> for magenta, etc.). See <a href="http://www.pymolwiki.org/index.php/Advanced_Coloring#Coloring_by_atom_type">this wiki post</a> for more information.
To show off a certain part of the protein, we can click and drag along the sequence to select certain residues.
For example, in the sequence viewer, click and drag from residue 1 to residue 6 to show the N-terminus.
Alternatively, type the following into the terminal:</p>
<p><code>sele resi 1-6</code></p>
<p>
This selection is then saved as <code>sele</code> in the objects panel, and we can individually change the attributes of this selection through its menus.
For example, ((sele) → C → by element → yellow carbon) will highlight the selected amino acids. Alternatively, we can run the following command in the command line:
<p><code>
PyMOL> util.cbay sele
</code></p>
<p>You should not have something that looks like the following:</p>
<p><img src="http://www.chartograph.com/assets/pymol_figures/cbab.png"></p>
<p>You can save a selection through (sele → A → rename selection).
This selection will then be saved for the rest of the session. </p>
<p>In case you're curious, we can also save the commands that we typed into the command line.
To do so, copy and paste the commands into a text file, and save it with the file extension <code>.pml</code>.
As an example, we've save the following commands into a text file that you can download <a href="http://www.chartograph.com/assets/pymol_figures/intro.pml">here</a>.
To run the commands, go to File → Run . . . , and then select the file that you just created in the dialog that opens.
</p>
<h3>Selection logic</h3>
<p>
One of the most powerful features of PyMOL is the ability to make selections based on different criteria.
To get started, let's read the documentation for the select command.
Type <code>help select</code>, and then hit the escape key.
This will show the command window in the main window, and it will show the documentation for the <code>select</code> command.
The general syntax for the select command is <code>select selection_name, selection_criteria</code>, where <code>selection_name</code> is the name of the selection that we're creating, and <code>selection_criteria</code> defines how the selection is made.
</p>
<p>
Let's start by selecting all of the lysines
</p>
<p>
<code>
sel lysines, resn lys
</code>
</p>
<p>
This means that we want to make a new selection called <code>lysines</code> by selecting all residues with a name (<code>resn</code>) that is lysine (<code>lys</code>). We can make these lysines blue (lsysines → C → Blues → Blue).</p>
<p>
<code>
color blue, lysines
</code>
</p>
<p>
Let's also select the prolines as well</p>
<p><code>
sel prolines, resn pro
</code></p>
<p>
Before we continue, let's make the protein gray (<code>color gray</code>).
Now, let's make a compound selection by selecting aspartic and glutamic acids.
The syntax for making a selection that is either aspartic acid or glutamic acid is <code>asp+glu</code>.
</p>
<p><code>
sel acids, resn asp+glu
</code></p>
<p>We'll also select all of the bases</p>
<p><code>
sel acids, resn arg+lys+his
</code></p>
<p>We can select by attributes other than the type of residue. For example, we can select residues by their indices:</p>
<p><code>
sel Q31, resi 31<br>
</code></p>
<p>Here <code>resi</code> refers to residue index. Another useful selection type is <code>name</code>, which will select by the atom name of each element.
</p>
<code>
sel oxygens, name o
</code>
<p>
Before we move on, let's reinitialize PyMOL and load a new structure.
</p>
<p><code>
rein<br>
fetch 1nqh<br>
hide everything<br>
show cartoon<br>
color slate<br>
</code></p>
<p>You should have the following:</p>
<p><img src="http://www.chartograph.com/assets/pymol_figures/1nhq.png"></p>
<p>Now, let's show the sequence (Display → Sequence). If you notice, the first six amino acids are missing. It's likely that they were deleted because they had low resolution. Scroll all the way to the right in the sequence viewer.
There are also four residues with the name CA. These are calcium ions that were resolved during the crystallography. Let's show them:
</p>
<p>
<code>
select calciums, symbol ca<br>
show spheres, calciums<br>
color gray, calciums<br>
</code>
</p>
<p>
You'll also notice that there's a residue with the name CNC. This is vitamin B12. Let's show it and change it's color to show it off. In the objects pane, (sele → S → sticks) color the ligand yellow (C → by element → yellow). Let's highlight the cobalt ion
</p>
<p>
<code>
select b12, resn CNC<br>
show sticks, b12<br>
util.cbay b12<br>
</code>
</p>
<p>This ligand also has a cobalt ion at its center. </p>
<p>
<code>
select cobalt, symbol co<br>
show spheres, cobalt
</code>
</p>
<p>Once we've made a selection, we can modify that selection (A → modify → extend → ). We can extend the selection through covalent bonds or through space.
</p>
<code>
select b12, resn cnc<br>
select neighboring, byres b12 expand 5
</code>
<p>This will select every residue with any piece within 5 angstroms of the ligand.</p>
<h3>Surfaces</h3>
<p>Let's start by getting rid of everything and showing the surface</p>
<code>
hide everything<br>
show surface<br>
show sticks, b12<br>
</code>
<p>This will show a surface of the protein obtained by rolling a 4 angstrom ball over the protein surface. We can also see how the vitamin fits into the protein binding pocket. Let's also look at all of the lysines and the hydrophobic side chains.</p>
<code>
color green, resn lys
color gray, resn phe+trp+leu+ile+met
</code>
<p>
We can now see that there are two conspicuous regions of the protein, one with hydrophobic regions and one with hydrophobic residues. This suggests that this protein is membrane-associated. </p>
<p>
Sometimes showing surfaces will cause the program to crash. It's wise to save before showing surfaces, and by reducing the quality of the surface by changing the value of \texttt{surface\_quality}. The default is 0, but for large structures like MS2 and TMV the best value is usually -1 or -2. Changing \texttt{surface\_solvent} can help to make low-quality surfaces look better.</p>
<code>
set surface_quality, -1<br>
set surface_solvent, on
</code>
<p>Let's go back to normal, though. </p>
<code>
set surface_quality, 0<br>
set surface_solvent, off
</code>
<h3>Making figures</h3>
<p>The default pymol view is not very high resolution. During regular display, Pymol doesn't anti-alias the view (smooth blending). To make a better figure, we ray-trace the image to include high-resolution shadows and graphics.
</p>
<code>
ray
</code>
<p>We can then save the resulting image (File → Save image as). To explicitly indicate the image size to save, type the following
</p>
<code>
png ~/Desktop/image.png, width=10cm, dpi=300, ray=1
</code>
<p>Sometimes we also want a transparent background (Display → Background → Opaque). Now when we ray-trace, the background will be transparent. There are also a few settings to make the ray-traced figures look better.
</p>
<code>
set fog, 0<br>
set specular, 0<br>
set ray_shadow, 0<br>
set depth_cue, 0<br>
</code>
<p>We can also control the transparency of the surface </p>
<code>
set transparency, 0.5
</code>
<h3>Slabbing</h3>
<p>In order to look inside of proteins, we have to use the slab feature. Slabbing is controlled by the mouse wheel, or by whatever controls scrolling on your laptop.
In general Pymol doesn't do this very well. Chimera is much better at providing slices through the protein. </p>
<p>One hack is to hide the residues in the front. You can hold down shift while dragging the mouse to select a range of residues. Then you can hide the specific representations that you don't want to see. You can then complete the selection (sele → A → modify → complete → residues)</p>
<h3>Measurement</h3>
<p>Go to Wizard → Measurement. Click one atom and then another atom. Pymol will draw a line between the two with the distance in angstroms listed. When you're finished, click done.
</p>
<h3>Mutations</h3>
<p>Let's go to Wizard → mujjtagenesis. Click on the residue that you want to mutate. On the right, you should see a list of menus. Click on <code>No Mutagenesis</code> and select Cys. We also have to select the possible rotamers that could be here. On the bottom, there is a series of buttons for stepping through the possible conformations. When you find one you like, you can click Apply. </p>
h add
<p>Let's start by showing the sticks</p>
<code>
show sticks
</code>
</div>
</div>
</div> <!-- /container -->
<hr>
<footer>
<p>© Chartograph 2015</p>
</footer>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
</body>
</html>