├── PyMOL-1-GUI.docx ├── Tutorial-2-selection.txt ├── Tutorial-3-Images.txt ├── Tutorial-4-movies.txt ├── Tutorial-5-Building.txt └── Tutorial-6-FAQ.txt /PyMOL-1-GUI.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PyMOL-Ross/Pymol-Tutorials/543d5a4ae58cc5745f0678dca569ec5c1ec22d3f/PyMOL-1-GUI.docx -------------------------------------------------------------------------------- /Tutorial-2-selection.txt: -------------------------------------------------------------------------------- 1 | Before we start! 2 | ######################################### 3 | # A quick recap 4 | ######################################### 5 | fetch 3chb 6 | 7 | viewing mode 8 | L-click : Make selection 9 | M-click : Center Camera 10 | M-wheel : z-plane-clipping 11 | R-click : Open menu 12 | L-drag : Camera rotate 13 | M-drag : Camera translate 14 | R-drag : Camera zoom 15 | 16 | Don't forget sequence view! 17 | 18 | orient 19 | 20 | fetch 2chb 21 | editing mode 22 | L-click : Make pick 23 | M-click : Center Camera 24 | R-click : Open menu 25 | L-drag : Camera rotate 26 | M-drag : Camera translate 27 | R-drag : Camera zoom 28 | Shift_L-drag : Object rotate 29 | Shift_M-drag : Object xy-translate 30 | Shift_R-drag : Object z-translate 31 | as sticks 32 | control_L-drag : atom xy-translate 33 | control_R-drag : bond rotation 34 | 35 | rein 36 | 37 | ######################################### 38 | # Pymol Selection 39 | ######################################### 40 | 41 | https://pymolwiki.org/index.php/Selection_Algebra 42 | 43 | /object-name/segi-id/chain-id/resi-id/name-id 44 | object-name and segi and chain and resi-id and name-id 45 | & s. & c. & (r)i. & n. 46 | 47 | rein 48 | fetch 2chb 49 | remove solvent + inorganic 50 | orient 51 | 52 | ######################################### 53 | # Two ways to select 54 | ######################################### 55 | 56 | molecular obj select /2chb select 2chb 57 | molecule semi (sometimes) select /2chb/A select 2chb & segi A 58 | chain select /2chb//D select 2chb and chain D 59 | residue select /2chb//D/PRO select 2chb & c. D & i. 10 60 | residue select /2chb//D/PRO`53 select 2chb & c. D & i. 53 & r. PRO 61 | atom select /2chb//D/10/ca select 2chb & c. D & i. 10 & n. ca 62 | atom select ////PRO/ca select r. PRO & n. ca 63 | 64 | atom range select /2chb//D/10-12/ca select 2chb & c. D & i. 10-12 & n. ca 65 | atom range select /2chb//D/6+8/c+o select 2chb & c. D & i. 10+12 & n. ca 66 | 67 | select 2chb and chain D and resi 10+12 and not name ca 68 | select 2chb & c. D & i. 10+12 & ! n. n+o+c 69 | 70 | ######################################### 71 | # Explained .. 72 | ######################################### 73 | 74 | object 75 | selection 76 | segment - segi - s. 77 | chain - chain - c. 78 | residue number - resi - i. 79 | residue name - resn - r. 80 | atom name - name - n. 81 | subdivision - & 82 | not - ! 83 | or - | 84 | additional - + 85 | 86 | select 2chb & c. D & i. 4 & i. 7 # does not work, no i. 7 in i. 4 87 | 88 | select 2chb & c. D & i. 4 | i. 7 89 | select 2chb & c. D & i. 4 + i. 7 # these are eqivalent here. 90 | select 2chb & c. D & i. 4+7 # not eqivalent 91 | 92 | ### notice no spaces around '+' as addition selection 93 | ### notice spaces around ' + ' as seperate selection # will fail if incorrect 94 | 95 | ######################################### 96 | # Example : view the locations for NHS-ester linkage. 97 | ######################################### 98 | 99 | reinitialize 100 | fetch 2chb, type=pdb 101 | remove ! polymer.protein 102 | color grey50 103 | bg_color white 104 | orient 105 | 106 | select all lysines on chain D 107 | select lysines, c. D & r. lys 108 | show sticks, lysines 109 | show sphere, lysine & n. NZ 110 | color blue, lysine & n. NZ 111 | 112 | select n-terminus of chain D 113 | select nres, br. first c. D & n. N 114 | show sticks, nres 115 | show sphere, nres & n. N 116 | color blue, nres & n. N 117 | 118 | show surface 119 | set transparency, 0.2 120 | 121 | ######################################### 122 | # Example : view the ionic and hydrogen bonding potential of the protein 123 | ######################################### 124 | 125 | reinitialize 126 | fetch 2chb, type=pdb 127 | remove ! polymer.protein 128 | color grey50 129 | bg_color white 130 | orient 131 | 132 | #select charged residues 133 | select c. D & r. lys+arg 134 | show sticks, c. D & r. lys+arg+asp+glu 135 | color grey50 136 | color blue, c. D & r. lys+arg & ! n. c+ca+n+o+cb+cg+cd 137 | color red, c. D & r. asp+glu & ! n. c+ca+n+o+cb+cg 138 | show surface 139 | set transparency, 0.2 140 | 141 | #select hydrogen bond acceptors/doners 142 | color grey50 143 | color cyan, don. & c. D 144 | color magenta, acc. & c. D 145 | 146 | ######################################### 147 | 148 | ######################################### 149 | 150 | reinitialize 151 | fetch 2chb, type=pdb 152 | util.cbc 153 | util.cnc 154 | bg_color white 155 | orient 156 | 157 | select groups select all, 158 | select none, 159 | select r. HOH, 160 | select hetatm, 161 | select hetatm and not resn HOH 162 | select organic 163 | select hetatm & ! resn HOH 164 | 165 | select polymer 166 | select polymer.protein 167 | select polymer.nucleic 168 | select organic 169 | select solvent 170 | 171 | secondary struture ss (ss h+s+l(loop)) 172 | select ss h 173 | select ss s 174 | select polymer.protein & ! ss h+s # selects loop sections 175 | 176 | amino acid sequence select c. D & pepseq TEAK 177 | select c. D & ps. TEAK 178 | 179 | protein select sc. 180 | select bb. 181 | select don. 182 | select acc. 183 | 184 | expand selection byobject 185 | bysegi bs. 186 | bymolecule bm. 187 | bychain bc. 188 | byresidue br. 189 | 190 | 191 | ### Why should you get to know the selection syntax? 192 | 193 | ### all functions work with the selection algebra! 194 | 195 | showas as cartoon, all 196 | show show sticks, sc. + n. CA + r. PRO & n. N 197 | color color red, ss h 198 | show nb, solvent 199 | remove remove solvent 200 | as lines, organic 201 | zoom zoom bm. first organic 202 | dist dist temp, c. D & i. 4 & n. CA, c. E & i. 4 & n. CA 203 | dist temp, c. D & i. 4, c. E & i. 4 204 | extract extract chainF, c. F # creates a new object of selection 205 | delete delete chainF 206 | 207 | There are many 208 | https://pymol.org/pymol-command-ref.html 209 | ######################################### 210 | # Example 211 | ######################################### 212 | 213 | reinitialize 214 | fetch 2chb, async=0 215 | orient 2chb 216 | remove solvent + inorganic 217 | color grey80, all 218 | color firebrick, ss h 219 | show sticks, c. D & ps. TEAK 220 | color black, c. D & ps. TEAK 221 | bg_color white 222 | zoom c. D & ps. TEAK, 5 223 | util.cnc 224 | dist dist01, /2chb/A/D/VAL`82/CA, /2chb/A/D/ALA`75/CA 225 | color magenta, dist01 226 | 227 | extract lig-a, organic & c. D 228 | zoom lig-a, 20 229 | 230 | 231 | ######################################### 232 | # Examples 233 | ######################################### 234 | 235 | reinitialize 236 | fetch 2chb, async=0 237 | remove solvent + inorganic 238 | 239 | select bb, bb. 240 | select sc, sc. + n. CA + PRO/N 241 | util.cbc 242 | as cartoon, bb 243 | show sticks, sc 244 | color grey50, organic 245 | util.cnc 246 | bg_color white 247 | orient 248 | dist hbsc, organic, sc, mode=2 249 | dist hbbb, organic, bb, mode=2 250 | color black, hbsc 251 | color magenta, hbbb 252 | hide label 253 | 254 | # run as a script 255 | # why not try 1nqu? 256 | 257 | 258 | ########################################################################################################################### 259 | # Exercise 1 - making some nice coiled coil structure 260 | ########################################################################################################################### 261 | Problems and solutions 262 | 263 | Bruce wants a pretty picture of some coiled coils 264 | 3r4a 4dzl 4dzm 4dzn 4pn8 4pn9 4pna 265 | 266 | fetch 3r4a 4dzl 4dzm 4dzn 4pn8 4pn9 4pna 267 | 268 | ##################################### 269 | 270 | bg_color white 271 | as cartoon 272 | extra_fit n. ca, 3r4a, super 273 | set grid_mode 274 | 275 | # This doesn’t look good because of multiple models per asymmetric unit 276 | # This can be solved by generating the ‘biological unit’ commonly described in the pdb 277 | 278 | rein 279 | fetch 3r4a 4dzl 4dzm 4dzn 4pn8 4pn9 4pna, type=pdb1, async=0 280 | bg_color white 281 | as cartoon 282 | extra_fit n. ca, 3r4a, super 283 | set grid_mode 284 | 285 | # This is better but hasn’t fixed the problem with 4dzm, lets clean up 286 | # This pdb may have a problem with the biological unit descriptor, we can fix this manually 287 | 288 | split_states 4dzm 289 | delete 4dzm 290 | create new, 4dzm_0001 + 4dzm_0002 291 | 292 | # this does not look right, this is a common problem in pymol 293 | # all atom identifiers are identical, pymol cannot differentiate between identical atoms 294 | # we need to change the atom identifiers 295 | can change segment (s.) 296 | can chainge chain (c.) 297 | can change residue number (i.) 298 | 299 | delete new 300 | alter 4dzm_0002, segi="new0" 301 | create news, 4dzm_0001 + 4dzm_0002 302 | alter 4dzm_0002, chain="B" 303 | create newc, 4dzm_0001 + 4dzm_0002 304 | alter 4dzm_0002, resi=str(int(resi)+100) 305 | create newi, 4dzm_0001 + 4dzm_0002 306 | 307 | # ok lets align them 308 | create 4dzm, newc 309 | delete new* + 4dzm_* 310 | 311 | enable all 312 | set grid_mode 313 | extra_fit n. ca, 3r4a, super 314 | # go orthoscopic 315 | extra_fit n. ca, 3r4a, align 316 | extra_fit n. ca, 3r4a, cealign 317 | extra_fit n. ca, 3r4a, align 318 | ray 319 | -------------------------------------------------------------------------------- /Tutorial-3-Images.txt: -------------------------------------------------------------------------------- 1 | # When preparing images, write a script (copy and paste commands) to a 2 | # text file, to allow you to recreate the image again in the future!! 3 | 4 | reinitialize 5 | fetch 2chb, async=0 6 | run niceify2.pml 7 | 8 | dist hbsc, organic, sc, mode=2 9 | dist hbbb, organic, bb, mode=2 10 | color cyan, hbsc 11 | color magenta, hbbb 12 | hide labels 13 | 14 | # key command 15 | get_view 16 | 17 | set_view (\ 18 | -0.253887773, 0.819441199, 0.513858318,\ 19 | 0.903327703, 0.390773684, -0.176850557,\ 20 | -0.345724672, 0.419285655, -0.839441359,\ 21 | 0.000526633, -0.000106305, -72.495323181,\ 22 | 27.612598419, 45.513324738, 19.832817078,\ 23 | 54.909694672, 90.036903381, -20.000000000 ) 24 | 25 | draw # quick anti-aliasing 26 | get antialias 27 | set antialias, 2 28 | set antialias, 1 29 | 30 | set_view (\ 31 | 0.804116547, -0.290881038, 0.518437326,\ 32 | -0.557278991, -0.672452390, 0.487060457,\ 33 | 0.206952378, -0.680573046, -0.702836454,\ 34 | 0.000325076, 0.000658320, -103.680000305,\ 35 | -4.907163143, 35.938167572, 15.877665520,\ 36 | 72.554985046, 134.784973145, -20.000000000 ) 37 | ray # add shadows, white alpha-channel 38 | 39 | # ray will use your current window dimensions, however . . . 40 | ray x, y (pixels) 41 | ray 2400, 2400 42 | ray 1200, 2400 43 | ray 2400, 1200 44 | 45 | ##################################### 46 | 47 | https://pymolwiki.org/index.php/Publication_Quality_Images 48 | 49 | How do I create a X DPI image using PyMol's 'ray' command? 50 | ray 2400, 2400 51 | 52 | rayVal = inches * DPI 53 | therefore 54 | 55 | ray 576,576 # 8inch * 72dpi 56 | save ray576.png 57 | ray 800,800 # 8inch * 100dpi; or a 4inch * 200 DPI image; or 1x800. 58 | save ray800.png 59 | ray 2400,2400 # 8inch * 300dpi; 6"x400dpi, etc... 60 | save ray2400.png 61 | 62 | Then use graphics software to scale to an appropriate dimension 63 | I recommend the free software for image manipulation 64 | Gimp 65 | Inkscape 66 | Fiji (is just imageJ) 67 | 68 | ALTERNATIVELY 69 | https://pymolwiki.org/index.php/Png # however this is a little redundent 70 | 71 | ray first! 72 | png dpi150, dpi=150 73 | png dpi300, dpi=300 74 | png dpi600, dpi=600 75 | 76 | # combine both methods 77 | png dpi300-ex, width=2400, height=2400, dpi=300, ray=1 78 | 79 | ##################################### 80 | 81 | Blimey! my ray command takes a long time!! 82 | 83 | rein 84 | fetch 1nqu, type=pdb1 85 | split_states 1nqu 86 | bg_color white 87 | orient 88 | util.cbc 89 | remove ! polymer 90 | 91 | ray 92 | Ray: render time: 45.55 sec. = 79.0 frames/hour (258.18 sec. accum.). 93 | 94 | # use more memory for image processing? (make sure you don’t crash it!) 95 | get hash_max 96 | get: hash_max = 100 97 | 98 | set hash_max, 200 99 | ray 100 | Ray: render time: 15.56 sec. = 231.4 frames/hour (273.74 sec. accum.). 101 | 102 | set hash_max, 400 103 | ray 104 | Ray: render time: 12.10 sec. = 297.6 frames/hour (285.84 sec. accum.). 105 | 106 | set hash_max, 800 107 | ray 108 | Ray: render time: 15.51 sec. = 232.2 frames/hour (301.34 sec. accum.). 109 | 110 | 111 | 112 | ##################################### 113 | # Image options 114 | ##################################### 115 | reinitialize 116 | fetch 1nqu, async=0 117 | run ../0-Setup/niceify2.pml 118 | set hash_max, 400 119 | select none 120 | 121 | What are the defaults 122 | ray 123 | 124 | get spec_reflect 125 | get ray_shadows 126 | get ray_trace_color 127 | get ray_trace_fog 128 | get depth_cue 129 | get ray [tab] 130 | 131 | ray 132 | 133 | set spec_reflect, off 134 | set ray_shadows, off 135 | set ray_trace_color, black 136 | set ray_trace_fog, 0 137 | set ray_opaque_background, on 138 | 139 | ray 140 | 141 | ##################################### 142 | # Ray tracing modes 143 | ##################################### 144 | reinitialize 145 | fetch 1nqu, async=0 146 | run ../0-Setup/niceify2.pml 147 | set hash_max, 400 148 | select none 149 | 150 | get ray_trace_mode 151 | 152 | set ray_trace_mode, 0 153 | ray 154 | 155 | 156 | set ray_trace_mode, 1 # line thickness independent of magnification 157 | ray # this is nice when zoomed in, but thick lines at low mag 158 | ray 2400, 2400 # line thickness is dependent on resolution 159 | 160 | # want to tweek line thickness? 161 | get ray_trace_gain 162 | set ray_trace_gain, 1 # show example, dont mess too much! 163 | set ray_trace_gain, 0.12 164 | 165 | set ray_trace_mode, 2 166 | ray 167 | ray 2400, 2400 168 | 169 | set ray_trace_mode, 3 170 | ray 171 | ray 2400, 2400 172 | 173 | ########################### 174 | # Interested in sticks 175 | ########################### 176 | reinitialize 177 | fetch 1nqu, async=0 178 | run ../0-Setup/niceify2.pml 179 | set hash_max, 400 180 | select none 181 | 182 | 183 | get valence 184 | as sticks 185 | 186 | set valence, 0 187 | set valence, 1 188 | 189 | 190 | get stick_radius 191 | set stick_radius = 1 192 | 193 | set valence, 0 194 | util.cbc 195 | set stick_radius = 1.5 196 | set stick_radius = 2 197 | 198 | also available 199 | get sphere_scale 200 | 201 | ########################### 202 | # Interested in cartoons 203 | ########################### 204 | reinitialize 205 | fetch 1nqu, async=0 206 | run ../0-Setup/niceify2.pml 207 | set hash_max, 400 208 | select none 209 | 210 | as cartoon 211 | cartoon loop 212 | cartoon rect 213 | cartoon oval 214 | cartoon tube 215 | cartoon automatic 216 | 217 | # dependent on pymols internal validation of secondary structure 218 | # not always correct 219 | 220 | select c. C & i. 85-109 221 | alter c. C & i. 85-109, ss='L' 222 | as cartoon 223 | 224 | set cartoon_fancy_helices=1 225 | set cartoon_flat_sheets = 0 226 | set cartoon_smooth_loops = 1 227 | 228 | ########################### 229 | # Interested in topology 230 | ########################### 231 | as cartoon 232 | color red, ss h 233 | color marine, ss s 234 | color yellow, ss l+'' 235 | set cartoon_smooth_loops = 1 236 | set cartoon_flat_sheets = 0 237 | 238 | 239 | ########################### 240 | # Interested in surfaces 241 | ########################### 242 | 243 | reinitialize 244 | fetch 1nqu, async=0 245 | remove solvent + inorganic 246 | orient 247 | bg_color white 248 | color red, ss h 249 | color marine, ss s 250 | color yellow, ss l+'' 251 | as surface 252 | set_view (\ 253 | 0.545457602, -0.442487806, 0.711814880,\ 254 | -0.747303188, 0.127776876, 0.652082741,\ 255 | -0.379491985, -0.887624860, -0.260975480,\ 256 | -0.000065712, -0.000067554, -100.300979614,\ 257 | 140.149993896, 11.831371307, 127.861839294,\ 258 | 52.274650574, 148.330902100, -20.000000000 ) 259 | 260 | ##### get_view 261 | set hash_max, 400 262 | ray 263 | save 4-Images-RayTracing-surf-norm.png 264 | 265 | get spec_power 266 | set spec_power = 200 267 | ray 268 | save 4-Images-RayTracing-surf-sp200.png 269 | 270 | get spec_refl 271 | set spec_refl=1.5 272 | ray 273 | save 4-Images-RayTracing-surf-sr1.5.png 274 | 275 | get surface_quality 276 | set surface_quality, 2 277 | ray 278 | save 4-Images-RayTracing-surf-sq2.png 279 | 280 | # additionally 281 | set solvent_radius, 2.0 282 | set surface_solvent = on 283 | 284 | ########################################################################################### 285 | https://pymolwiki.org/index.php/Gallery 286 | ############################################# 287 | # Show hydrophobic 288 | ############################################# 289 | 290 | reinitialize 291 | fetch 1nqu 292 | orient 293 | bg_color white 294 | set hash_max, 400 295 | as cartoon,all 296 | color gray,all 297 | remove solvent 298 | 299 | select hydrophobes, (r. ala+gly+val+ile+leu+phe+met) 300 | show spheres, (hydrophobes and (!name c+n+o)) 301 | color orange,hydrophobes 302 | disable hydrophobes 303 | show surface, polymer 304 | set transparency, 0.5 305 | show sticks, organic 306 | color black, organic 307 | 308 | 309 | set_view (\ 310 | 0.663258672, 0.559077382, 0.497514009,\ 311 | -0.666870713, 0.743225574, 0.053842291,\ 312 | -0.339663506, -0.367489606, 0.865782797,\ 313 | 0.000000000, 0.000000000, -114.893775940,\ 314 | 161.621994019, 17.474000931, 137.559997559,\ 315 | 66.865669250, 162.921905518, -20.000000000 ) 316 | 317 | ray 318 | png shhy-ray 319 | 320 | get spec_power 321 | get spec_refl 322 | get surface_quality 323 | 324 | 325 | set spec_power = 1 326 | set spec_refl= 1 327 | set surface_quality, 0 328 | ray 329 | png shhy-ray110 330 | 331 | # 118 sec # DONT DO THIS ONE!! 332 | set spec_power = 200 333 | set spec_refl=1.5 334 | set surface_quality, 2 335 | set antialias, 2 336 | ray 2400 337 | png shhy-ray112 338 | 339 | ############################################# 340 | # Make Slices 341 | ############################################# 342 | 343 | reinitialize 344 | fetch 1nqu, async=0 345 | orient 346 | bg_color white 347 | remove solvent 348 | set hash_max, 400 349 | 350 | # must disable depth cue and shadows 351 | set depth_cue, 0 352 | set ray_shadows, 0 353 | set ray_trace_mode, 0 354 | 355 | # this controls the z depth of the slice plane 356 | # (sets it halfway between the clipping planes) 357 | fraction = 0.42 358 | view = cmd.get_view() 359 | near_dist = fraction*(view[16]-view[15]) 360 | far_dist = (view[16]-view[15]) - near_dist 361 | cmd.clip("near", -near_dist) 362 | 363 | # render opaque background image 364 | as surface 365 | set ray_interior_color, grey80 366 | set opaque_background 367 | set surface_color, white 368 | ray 369 | save Images-MakeSlices-image_back.png 370 | 371 | cmd.clip("near", near_dist) 372 | cmd.clip("far", far_dist) 373 | 374 | # render the foreground image 375 | as cartoon 376 | util.cbc 377 | unset opaque_background 378 | ray 379 | save Images-MakeSlices-image_front.png 380 | 381 | # open Images-MakeSlices* 382 | 383 | 384 | ############################################# 385 | # Binding Pocket representation 386 | ############################################# 387 | 388 | reinitialize 389 | fetch 1nqu, tmp, async=0 390 | bg_color white 391 | remove solvent 392 | set hash_max, 400 393 | 394 | extract prot, polymer 395 | extract lig, organic 396 | select bb, bb. 397 | select sc, sc. + n. ca + PRO/N 398 | as cartoon, bb 399 | show sticks, sc 400 | util.cbc 401 | color black, lig 402 | show sticks, lig 403 | util.cnc 404 | 405 | select lig1, lig & c. A 406 | 407 | set surface_carve_cutoff, 4.5 408 | set surface_carve_selection, lig1 409 | set surface_carve_normal_cutoff, -0.1 410 | 411 | show surface, prot within 8 of lig1 412 | set two_sided_lighting 413 | set transparency, 0.5 414 | orient lig1 415 | zoom lig1, 2 416 | 417 | set surface_color, white 418 | set surface_type, 2 419 | distance hbond, lig1, prot, mode=2 420 | color grey50, hbond 421 | set ray_shadows, 0 422 | ray 423 | png pocket1 424 | 425 | ##### a little further out? 426 | 427 | zoom lig1, 10 428 | select pocket2, br. lig1 expand 5 429 | select pocket, pocket2 & ! name c+o+n + /*//*/PRO`*/N 430 | delete pocket2 431 | hide sticks, sc 432 | hide lines, sc 433 | show sticks, pocket 434 | turn z, -45 435 | turn x, -90 436 | ray 437 | png pocket2 438 | 439 | ############################################# 440 | # QuteMol like images 441 | ############################################# 442 | 443 | reinitialize 444 | fetch 1nqu, async=0 445 | bg_color white 446 | remove solvent 447 | set hash_max, 400 448 | 449 | set_color oxygen, [1.0,0.4,0.4] 450 | set_color nitrogen, [0.5,0.5,1.0] 451 | as spheres 452 | util.cbaw 453 | bg white 454 | set light_count,8 455 | set spec_count,1 456 | set shininess, 10 457 | set specular, 0.25 458 | set ambient,0 459 | set direct,0 460 | set reflect,1.5 461 | set ray_shadow_decay_factor, 0.1 462 | set ray_shadow_decay_range, 2 463 | unset depth_cue 464 | # for added coolness 465 | # set field_of_view, 60 466 | ray 467 | 468 | ############################################# 469 | # David Goodsell like images 470 | ############################################# 471 | 472 | reinitialize 473 | fetch 1nqu, tmp, async=0 474 | bg_color white 475 | set hash_max, 400 476 | 477 | as sticks 478 | set valence, 0 479 | set stick_radius = 1.7 480 | 481 | color lightblue, not org 482 | color magenta, org 483 | remove solvent 484 | 485 | # set the view 486 | 487 | set_view (\ 488 | 0.855354905, 0.057524908, 0.514838457,\ 489 | -0.050117217, 0.998342931, -0.028284293,\ 490 | -0.515611708, -0.001608965, 0.856820703,\ 491 | 0.000006188, -0.000014648, -238.717636108,\ 492 | 153.867889404, 1.374834061, 136.634002686,\ 493 | 208.820083618, 268.618896484, -20.000000000 ) 494 | 495 | # set the lights, ray tracing setttings 496 | # to get the Goodsell-like rendering 497 | 498 | unset specular 499 | set ray_trace_gain, 0 500 | set ray_trace_mode, 3 501 | bg_color white 502 | set ray_trace_color, black 503 | unset depth_cue 504 | ray 505 | 506 | 507 | -------------------------------------------------------------------------------- /Tutorial-4-movies.txt: -------------------------------------------------------------------------------- 1 | Lets make a movie! 2 | 3 | Additional software 4 | 5 | OPTIONAL - For complicated image compilations use ffmpeg 6 | This software turns images into movies (ffmpeg is commandline) 7 | ffmpeg -r 25 -i img%04d.png -f mp4 -q:v 0 -vcodec mpeg4 myVideo.mp4 8 | 9 | REQUIRED - Pymol makes BIG movie files. 10 | This software compresses files without losing resolution (nice GUI) 11 | Handbrake using RF 24 12 | 13 | Links 14 | https://www.pymolwiki.org/index.php/MovieSchool 15 | Good but old! (pymol v1.2) 16 | 17 | PART 1 18 | 19 | ########################################################## 20 | # USING THE GUI TO MAKE A MOVIE 21 | ########################################################## 22 | rein 23 | fetch 2chb, async=0 24 | remove hydrogen 25 | hide all 26 | bg_color white 27 | 28 | select lig, organic 29 | select bb, bb. 30 | select sc, polymer & ! bb + name ca + /*//*/PRO`*/N 31 | 32 | as cartoon, bb 33 | show sticks, sc + lig 34 | util.cbc 35 | color black, lig 36 | util.cnc 37 | orient bb 38 | select none 39 | 40 | dist hbbb, org, bb, mode=2 41 | dist hbsc, org, sc, mode=2 42 | color grey20, hbbb 43 | color grey80, hbsc 44 | hide labels 45 | 46 | ok, now we can us the GUI 47 | 48 | Movie > Program > Camera loop > Nutate > 30deg.4sec 49 | Movie > Program > Camera loop > X-roll > 8s 50 | Movie > Append > 4s 51 | Movie > FrameRate > 5fps 52 | 53 | Movie > Reset 54 | 55 | ########################################################## 56 | 57 | Appending multiple gui camera controls that look good! 58 | 59 | orient 60 | Movie > Program > Camera loop >Nutate > 30deg.4sec 61 | Movie > Update last program # if required 62 | Movie > append > 2s 63 | 64 | orient c. D 65 | Movie > Program > Camera loop > Nutate > 30deg.4sec 66 | Movie > append > 2s 67 | 68 | orient c. D & org 69 | Movie > Program > Camera loop > Nutate > 30deg.4sec 70 | Movie > append > 2s 71 | 72 | 73 | ########################################################## 74 | 75 | HEY!! I want to cycle through my NMR/MD/morph/other states!! 76 | 77 | ok, we can use 78 | 79 | rein 80 | fetch 2adt, async=0 81 | as sticks 82 | Movies > Program > state loop > Full speed 83 | *** Actually, you can just save as movie, as states are present. 84 | 85 | HEY!! I want my states to cycle while i move around the structure 86 | 87 | Well, you can’t do that in the GUI, sorry! (at least i dont know how) 88 | 89 | ########################################################## 90 | 91 | GUI scenes # scenes are amazing! 92 | 93 | make scenes with 94 | Scene > Store > F? 95 | Movie > Program > Scene loop > Nutate > 30deg.4sec 96 | 97 | Can be a bit clunky to use but your creative skills can get around this. 98 | 99 | 100 | 101 | 102 | PART 2 103 | 104 | ########################################################## 105 | Movies on the command line 106 | ########################################################## 107 | 108 | what is a state? 109 | what is a frame? 110 | 111 | # what is mset 112 | mset 1 x200 (x[num]) gives appended frames at given state 113 | 114 | # if you have states too 115 | mset 1 -200 (-[num]) gives movement between states (while moving between frames) 116 | mset 1 200 ([num]) moves straight to numbered state 117 | 118 | So, you can make some fancy movies of MD simulations, NMR, morphs! 119 | 120 | ################################################### 121 | # what is mview 122 | https://pymolwiki.org/index.php/Mview 123 | 124 | ### Ligand zoom 125 | 126 | rein 127 | fetch 1rx1, async=0 128 | as cartoon 129 | as sticks, organic 130 | 131 | mset 1 x150 132 | 133 | orient 134 | mview store, 1 135 | mview store, 50 136 | orient organic 137 | mview store, 100 138 | mview store, 150 139 | 140 | mplay 141 | 142 | # commands don't have to be in sequencial order. 143 | 144 | rein 145 | fetch 1rx1, async=0 146 | as cartoon 147 | as sticks, organic 148 | 149 | mset 1 x150 150 | 151 | orient 152 | mview store, 1 153 | mview store, 150 154 | orient organic 155 | mview store, 50 156 | mview store, 100 157 | 158 | mplay 159 | 160 | ### 360° rotation 161 | 162 | rein 163 | fetch 1rx1, async=0 164 | as cartoon 165 | as sticks, organic 166 | 167 | mset 1 x180 168 | mview store, 1 169 | mview store, 180 170 | turn y, 120 171 | mview store, 60, power=1.0 172 | turn y, 120 173 | mview store, 120, power=1.0 174 | 175 | mplay 176 | 177 | 178 | ################################################### 179 | Moving through states while moving the camera 180 | 181 | rein 182 | load structures.pse # load a file with states for this one. 183 | remove hydrogen 184 | hide all 185 | bg_color white 186 | 187 | select lig, organic 188 | select bb, bb. 189 | select sc, sc. + name ca + /*//*/PRO`*/N 190 | 191 | as cartoon, bb 192 | set cartoon_gap_cutoff, 0 193 | show sticks, sc + lig 194 | util.cbc 195 | color black, lig 196 | util.cnc 197 | orient bb 198 | select none 199 | 200 | dss 201 | 202 | #reset the movie! 203 | 204 | mview reset 205 | orient 206 | mset 1 x30 -150 x20 207 | mview interpolate 208 | mview smooth 209 | 210 | mview store, 1 211 | turn x, -90 212 | mview store, 50 213 | 214 | mview store, 198 215 | 216 | ################################################### 217 | a little more involved 218 | 219 | mview and mset together 220 | 221 | mview reset 222 | orient 223 | mset 1 x50 -500 x50 224 | mview interpolate 225 | mview smooth 226 | 227 | mview store, 1 228 | turn x, -90 229 | mview store, 50 230 | 231 | mview store, 150 232 | turn x, 90 233 | mview store, 250 234 | 235 | mview store, 350 236 | turn y, 90 237 | mview store, 450 238 | mview store, 550 239 | 240 | 241 | 242 | ridiculous mset 243 | mset 1 x200 -78 -2 -78 x200 79 -156 157 x200 -234 235 x400 244 | # mset 1 x200 makes the first state last for 200 frames 245 | # -78 -2 takes us FROM state 1 to 78, then back to frame 2. 246 | # I've repeated this for dramatic effect. 247 | # Then we pause at 78 for 200 frames, 248 | # then go from 79-156 and pause at 157 for 200 frames, etc. 249 | 250 | You MUST have the full number of mset frames declared utilised via mview! 251 | Otherwise the interpolation will move back to the beggining at the end of the video 252 | Alternatively, if you are making a looping video, you may want to allow this to happen. 253 | 254 | PART 3 255 | 256 | ################################################### 257 | Movies on the command line with state control and morph 258 | ################################################### 259 | 260 | 'morph' - available on pymol-2.x - transitions between structures 261 | 262 | 'create' seperates and merges objects and states 263 | 264 | rein 265 | load reduced.pdb # load a file with states for this one. 266 | remove hydrogen 267 | hide all 268 | bg_color white 269 | 270 | select lig, organic 271 | select bb, polymer & name c+o+n+ca 272 | select sc, sc. + name ca + /*//*/PRO`*/N 273 | 274 | as cartoon, bb 275 | show sticks, sc + lig 276 | util.cbc 277 | color black, lig 278 | util.cnc 279 | orient bb 280 | select none 281 | 282 | dss 283 | 284 | create pent1, reduced, 1, 1 285 | create mono1, reduced & s. PROA, 1, 1 286 | create mono2, reduced & s. PROB, 1, 1 287 | create mono3, reduced & s. PROC, 1, 1 288 | create mono4, reduced & s. PROD, 1, 1 289 | create mono5, reduced & s. PROE, 1, 1 290 | 291 | 292 | Move and denature 293 | 294 | extract pent2, mono* 295 | delete mono* 296 | 297 | morph morphname, pent2, pent1, refinement=1, steps=100 298 | 299 | create fullmodel, morphname, 0, 1 300 | smooth reduced, 10, 10 301 | create fullmodel, reduced, 0, 101 302 | 303 | 304 | 305 | 306 | PART 4 307 | 308 | ################################################### 309 | Movies on the command line with scenes 310 | ################################################### 311 | With scenes you can change representations during the movie 312 | 313 | rein 314 | load structures.pse # load a file with states for this one. 315 | remove hydrogen 316 | hide all 317 | bg_color white 318 | 319 | select lig, organic 320 | select bb, bb. 321 | select sc, sc. + name ca + /*//*/PRO`*/N 322 | 323 | as cartoon, bb 324 | set cartoon_gap_cutoff, 0 325 | show sticks, sc + lig 326 | util.cbc 327 | color black, lig 328 | util.cnc 329 | orient bb 330 | select none 331 | dss 332 | 333 | extract trimer, c. A 334 | extract dimer, c. B 335 | orient trimer 336 | select bb, bb. 337 | select sc, sc. + name ca + /*//*/PRO`*/N 338 | 339 | orient 340 | 341 | ################################################### 342 | - - THIS CAN ACT AS A GOOD TEMPLATE!! - - 343 | mview reset 344 | mset 1 x400 -380 x20 345 | set scene_animation,-1 346 | set scene_animation_duration,0 347 | set ray_trace_frames=0 # set this to 1 to get ray traced frames (takes a while) 348 | mview interpolate 349 | mview smooth 350 | 351 | disable dimer 352 | orient trimer 353 | hide sticks 354 | scene 001, store 355 | 356 | turn y, 90 357 | show lines, sc 358 | scene 002, store 359 | 360 | show sticks, sc 361 | scene 003, store 362 | 363 | set_view (\ 364 | 0.206935033, -0.007686321, 0.978324473,\ 365 | -0.978228033, 0.014468522, 0.207028300,\ 366 | -0.015746213, -0.999865770, -0.004524941,\ 367 | 0.000000000, 0.000000000, -135.752883911,\ 368 | -1.243819475, 7.003369808, 15.669667244,\ 369 | 107.028610229, 164.477157593, -20.000000000 ) 370 | scene 004, store 371 | enable dimer 372 | scene 005, store 373 | 374 | scene 001 375 | mview store, 1 376 | turn x, -120 377 | mview store, 50, power=1.0 378 | turn x, -120 379 | mview store, 100, power=1.0 380 | turn x, -120 381 | mview store, 150 382 | scene 002 383 | mview store, 195 384 | scene 003 385 | mview store, 200 386 | turn z, -120 387 | mview store, 250, power=1.0 388 | turn z, -120 389 | mview store, 300, power=1.0 390 | turn z, -120 391 | mview store, 350 392 | scene 004 393 | mview store, 395 394 | scene 005 395 | mview store, 400 396 | turn y, 180 397 | mview store, 600 398 | mview store, 798 399 | 400 | mview interpolate 401 | mview smooth 402 | rewind 403 | 404 | 405 | PART 4 406 | 407 | ################################################### 408 | Movies and molecular transitions in powerpoint 409 | ################################################### 410 | 411 | Show example in powerpoint and session file 412 | (Sorry youtubers, this bit has some unpublished work in it) 413 | 414 | PART 5 415 | 416 | ################################################### 417 | Movies and molecular transitions in powerpoint 418 | ################################################### 419 | 420 | Complex Movies Examples 421 | 422 | ################################################# 423 | How the professionals do it!! (examples from the net) 424 | 425 | 426 | # setup PyMOL for the movie 427 | reinitialize 428 | set matrix_mode, 1 429 | set movie_panel, 1 430 | 431 | # load the PDBs 432 | fetch 1cll 1ggz, async=0 433 | 434 | # orient the scene 435 | as cartoon 436 | orient 437 | 438 | # make 100-frame movie 439 | mset 1 x100 440 | # goto frame 1 441 | frame 1 442 | 443 | # store the camera position and object 444 | # positions in frame 1 445 | mview store 446 | mview store, object=1cll 447 | mview store, object=1ggz 448 | 449 | # goto frame 90 450 | frame 90 451 | # align the two proteins 452 | super 1cll, 1ggz 453 | # we rezoom to center the camera on the 454 | # two aligned proteins 455 | zoom 456 | # store the camera positions 457 | mview store 458 | # store the new object position(s) 459 | mview store, object=1cll 460 | mview store, object=1ggz 461 | 462 | # have PyMOL stitch together the scenes. 463 | mview reinterpolate 464 | mview reinterpolate, object=1cll 465 | mview reinterpolate, object=1ggz 466 | 467 | # rewind 468 | frame 1 469 | # get some popcorn! 470 | mplay 471 | 472 | ################################################# 473 | Backbone walking 474 | 475 | # usual setup 476 | reinitialize 477 | set matrix_mode, 1 478 | set movie_panel, 1 479 | 480 | # fetch 1CLL to work on; this will only work on 1cll 481 | # or any other protein with 144 AAs starting at resi 4. 482 | fetch 1cll, async=0 483 | as sticks 484 | color marine 485 | util.cnc 486 | #zoom i. 1+2, 2 487 | 488 | # 10 frames per AA 489 | mset 1 x1440 490 | mview store 491 | 492 | # this code maps the zooming of 493 | # one AA and it's neighbor to 10 frames 494 | python 495 | for x in range(0,144): 496 | cmd.frame((20*x)+1) 497 | cmd.zoom( "n. CA and i. " + str(x) + "+" + str(x+1), 2) 498 | cmd.mview("store") 499 | python end 500 | 501 | # goto the end and interpolate all the frames 502 | #frame 288 503 | mview store 504 | mview reinterpolate 505 | 506 | mplay 507 | -------------------------------------------------------------------------------- /Tutorial-5-Building.txt: -------------------------------------------------------------------------------- 1 | ######################################## 2 | # Building with pymol # 3 | ######################################## 4 | 5 | ######################################## 6 | https://pymolwiki.org/index.php/Modeling_and_Editing_Structures 7 | ######################################## 8 | 9 | 10 | ######################################## 11 | # Make Peptide in Pymol (helix, sheet) 12 | refresh editing mode, 13 | bond 14 | unbond 15 | 16 | 2x peptides, fuse 17 | [ALT] WELIKE etc 18 | fab CHEMISTRY, ss=1 19 | # sequence view 20 | alter obj01, resi=str(int(resi)+6) 21 | 22 | pick n and c termini 23 | fuse 24 | 25 | fab CHEMISTRY, name-helix, ss=1 26 | fab CHEMISTRY, name-anti, ss=2 27 | fab CHEMISTRY, name-para, ss=3 28 | 29 | Building with pymol 30 | The builder 31 | [ALT]ACD etc 32 | Joining structures 33 | Fuse 34 | 35 | 36 | # can use on whole proteins . . . 37 | rein 38 | fetch 3chb, type=pdb, async=0 39 | remove hetatm 40 | util.cbc 41 | split_chains 42 | disable 3chb_F 43 | disable 3chb_G 44 | disable 3chb_H 45 | orient 46 | select 3chb_D & i. 103 47 | orient sele 48 | show sticks, sele 49 | util.cnc 50 | remove 3chb_D & i. 103 & n. oxt 51 | select 3chb_D & i. 103 & n. c 52 | select c-term, 3chb_D & i. 103 & n. c 53 | 54 | select 3chb_E & i. 1 55 | orient sele 56 | show sticks, sele 57 | select n-term, 3chb_E & i. 1 and n. n 58 | 59 | fuse c-term, n-term 60 | 61 | # change phi and psi - NOT THE PEPTIDE BOND!!! 62 | now click in space > editing mode > [CTR]-right click phi or psi > [CTR]-left click[HOLD] and drag to rotate component about bond 63 | 64 | Clean up nomenclature i. c. s. 65 | alter 3chb_E & c. E, resi=str(int(resi)+103) 66 | alter 3chb_E & c. D, chain='E' 67 | 68 | 69 | 70 | ######################################## 71 | # Importing and Building Small Molecules 72 | Having trouble? --> use openbabel 73 | 74 | Builder widget 75 | 76 | rein 77 | Import Lewis-y from chemdraw 78 | Clean > Scuplt 79 | 80 | Make Lewix-y in Pymol 81 | 82 | 83 | ######################################## 84 | # Structural Transforations 85 | 86 | rein 87 | fetch 2chb, async=0 88 | remove ! polymer 89 | split_chains 90 | orient 91 | 92 | # axis 93 | rotate x, 90, 2chb_D 94 | # vector 95 | rotate [1,1,1],45,2chb_E 96 | 97 | translate [0,0,20], 2chb_D 98 | 99 | # rotations and translations are based on the camera angle 100 | orient 101 | rotate x, 90, 2chb_F 102 | turn y, 90 103 | rotate x, 90, 2chb_F 104 | 105 | # make a dimer 106 | orient 107 | create obj01, 2chb, 1, 0 108 | rotate x, 180, obj01 109 | translate [0,0,32], obj01 110 | color cyan, obj01 111 | as sticks 112 | util.cbc 113 | util.cnc 114 | alter obj01, segi='nseg' 115 | extract dimer, obj01 + 2chb 116 | 117 | delete 2chb* + obj01 118 | sort dimer 119 | sculpt_activate dimer, 120 | sculpt_iterate all, cycles=1000 121 | sculpt_deactivate dimer 122 | flag free, all 123 | 124 | ######################################## 125 | 126 | rein 127 | fetch 2chb, async=0 128 | remove ! polymer 129 | split_chains 130 | orient 131 | util.cbc 132 | 133 | select interE, br. 2chb_E within 5 of 2chb_D 134 | select interH, br. 2chb_H within 5 of 2chb_D 135 | 136 | translate [-20,20,0], 2chb_D 137 | 138 | show surface, interE 139 | show surface, interH 140 | color orange, inter* & r. ALA+CYS+PHE+ILE+LEU+MET+PRO+VAL+TRP & ! n. C+CA+N+O 141 | 142 | util.cnc 143 | color orange, inter* & r. ALA+CYS+PHE+ILE+LEU+MET+PRO+VAL+TRP & ! n. C+CA+N+O 144 | 145 | 146 | 147 | ######################################## 148 | # Single chained lumazine synthase 149 | rein 150 | fetch 1nqu, type=pdb, async=0 151 | remove ! polymer 152 | util.cbc 153 | split_chains 154 | show sticks, sele 155 | color grey50 156 | util.chainbow c. A 157 | util.chainbow c. B 158 | 159 | as sticks 160 | util.cnc 161 | 162 | # select ‘N’ of i. 1 use [ALT]G, [ALT]S to make chain 163 | or fab GSGSGSGSGSGSGSG 164 | # use auto-sculpting 165 | # editing [CTL] drag 166 | 167 | 168 | flag free, all 169 | flag fix, all and not sele 170 | set auto_sculpt, on 171 | 172 | set sculpting, off 173 | set auto_sculpt, off 174 | flag free, all 175 | 176 | 177 | 178 | sort newmol 179 | select ligand, c. A 180 | flag fix, ligand 181 | sculpt_activate newmol 182 | sculpt_iterate all, cycles=1000 183 | sculpt_deactivate newmol 184 | flag free, all 185 | 186 | 187 | create obj02, obj01, 0, 1 188 | create obj03, obj01, 0, 1 189 | create obj04, obj01, 0, 1 190 | create obj05, obj01, 0, 1 191 | align obj02 & c. A, 1nqu_B 192 | align obj03 & c. A, 1nqu_C 193 | align obj04 & c. A, 1nqu_D 194 | align obj05 & c. A, 1nqu_E 195 | alter obj02, resi=str(int(resi)+200) 196 | alter obj03, resi=str(int(resi)+400) 197 | alter obj04, resi=str(int(resi)+600) 198 | alter obj05, resi=str(int(resi)+800) 199 | -------------------------------------------------------------------------------- /Tutorial-6-FAQ.txt: -------------------------------------------------------------------------------- 1 | #################################################### 2 | # Saving by command line, and directory location 3 | 4 | opening via shortcut 5 | opening at file location 6 | 7 | pwd where am i? 8 | ls what is in this directory? 9 | cd move into directory ('cd ..' to go backwards) 10 | 11 | save whatever.pdb, whatever 12 | 13 | #################################################### 14 | # proximity selection https://pymolwiki.org/index.php/Selection_Algebra 15 | 16 | 17 | #select residues around binding site 18 | rein 19 | fetch 1nqu 20 | bg_color white 21 | util.cbc 22 | colour black, org 23 | util.cnc 24 | remove solvent + inorganic 25 | select ligA, bm. first org 26 | select close, br. polymer near_to 5 of ligA 27 | show sticks, close & sc. + close & n. CA + close & r. PRO & n. N 28 | 29 | # removing atoms outside of a distance 30 | rein 31 | fetch 5npp 32 | bg_color white 33 | util.cbc 34 | remove solvent + c. D 35 | remove br. polymer.nucleic gap 15 36 | remove br. polymer.protein gap 15 37 | 38 | # binding site surface visualisation 1 39 | rein 40 | fetch 1nqu 41 | bg_color white 42 | util.cbc 43 | colour black, org 44 | util.cnc 45 | remove solvent + inorganic 46 | select ligA, bm. first org 47 | select close, br. polymer near_to 5 of ligA 48 | show surface, close 49 | set transparency, 0.3 50 | 51 | # binding site surface visualisation 2 52 | rein 53 | fetch 1nqu 54 | bg_color white 55 | util.cbc 56 | colour black, org 57 | util.cnc 58 | remove solvent + inorganic 59 | select ligA, bm. first org 60 | select prot, polymer 61 | set surface_carve_cutoff, 4.5 62 | set surface_carve_selection, ligA 63 | set surface_carve_normal_cutoff, -0.1 64 | show surface, prot within 8 of ligA 65 | set two_sided_lighting 66 | set transparency, 0.5 67 | orient ligA 68 | zoom ligA, 2 69 | select close, br. polymer near_to 5 of ligA 70 | show sticks, close & sc. + close & n. CA + close & r. PRO & n. N 71 | set surface_color, white 72 | distance hbond, ligA, prot, mode=2 73 | color magenta, hbond 74 | 75 | 76 | #################################################### 77 | # Crystal lattice expansion and contacts. 78 | 79 | reinitialize 80 | fetch 1wl9, async=0 81 | alter 1wl9, segi='rpdb' 82 | remove solvent + inorganic 83 | bg_color white 84 | 85 | symexp sym, 1wl9, (1wl9), 4 86 | alter sym*, segi='crys' 87 | color grey90 88 | color black, 1wl9 89 | show sticks 90 | 91 | select loop, 1wl9 & ps. LYRPGTSI 92 | color green, loop 93 | alter loop, segi='loop' 94 | 95 | select near, br. 1wl9 near_to 5 of loop 96 | color cyan, near 97 | alter near, segi='near' 98 | 99 | select crys, br. loop around 5 & ! 1wl9 100 | color hotpink, crys 101 | alter crys, segi='crys' 102 | 103 | orient loop 104 | zoom loop, 10 105 | util.cnc 106 | 107 | select removeme, br. loop gap 15 108 | remove removeme & ! 1wl9 109 | deselect 110 | 111 | 112 | #################################################### 113 | # getting data from pymol (Make a ramachandran plot) 114 | 115 | rein 116 | fetch 3chb 117 | 118 | chain=D 119 | residues=$(grep " D " 3chb.pdb | grep ATOM | grep ' CA ' | wc -l ) 120 | echo "fetch 3chb, async=0 121 | f=open('phipsi.txt','w')" > phipsi.pml 122 | 123 | for i in $(seq 1 $residues) ; do 124 | sele1=$i 125 | sele2=$(($i + 1)) 126 | sele3=$(($sele2 + 1)) 127 | echo " 128 | select sele1, c. D & i. $sele1 129 | select sele2, c. D & i. $sele2 130 | select sele3, c. D & i. $sele3" >> phipsi.pml 131 | echo ' 132 | phi=cmd.get_dihedral("'sele1' & n. C", "'sele2' & n. N", "'sele2' & n. CA", "'sele2' & n. C") 133 | psi=cmd.get_dihedral("'sele2' & n. N", "'sele2' & n. CA", "'sele2' & n. C", "'sele3' & n. N") 134 | f.write("'$sele2-phi' %s\n" % phi) 135 | f.write("'$sele2-psi' %s\n" % psi)' >> phipsi.pml 136 | done 137 | echo "f.close()" >> phipsi.pml 138 | pymoll -qc phipsi.pml 139 | 140 | grep phi phipsi.txt | awk '{print $2}' > a.tx 141 | grep psi phipsi.txt | awk '{print $2}' > b.tx 142 | dos2unix a.tx 143 | dos2unix b.tx 144 | paste -d',' a.tx b.tx > phipsi.csv 145 | excel phipsi.csv 146 | 147 | ########### 148 | 149 | Simple stuff 150 | echo " 151 | f=open('outfile.tx','w') 152 | cnt=cmd.centerofmass("'"i. '$comres'"'") " >> fetch.pml 153 | echo 'f.write("'oricapcom' %s\n" % cnt)' >> fetch.pml 154 | echo "f.close() 155 | 156 | Simple stuff 157 | 158 | f=open('outfile.tx','w') 159 | cnt=cmd.centerofmass("'"i. '$comres'"'") 160 | echo 'f.write("'oricapcom' %s\n" % cnt) 161 | echo "f.close() 162 | 163 | 164 | 165 | #################################################### 166 | # automatic secondary structure detection 167 | 168 | dss 169 | rebuild 170 | 171 | #################################################### 172 | # show electron density 173 | 174 | wget https://edmaps.rcsb.org/maps/3ueq_2fofc.dsn6 175 | wget https://edmaps.rcsb.org/maps/3ueq_fofc.dsn6 176 | 177 | fetch 3ueq_A, type=pdb, async=0 178 | load 3ueq_2fofc.dsn6 179 | load 3ueq_fofc.dsn6 180 | select search-seq, 3ueq_A & ps. WILSN 181 | orient search-seq 182 | color black, search-seq 183 | bg_color white 184 | util.cnc 185 | deselect 186 | as sticks, polymer 187 | isomesh 3ueq-2fofc_1.5, 3ueq_2fofc, 1.5 188 | color blue, 3ueq-2fofc_1.5 189 | isomesh 3ueq-fofc_3, 3ueq_fofc, 3 190 | isomesh 3ueq-fofc_-3, 3ueq_fofc, -3 191 | color green, 3ueq-fofc_3 192 | color red, 3ueq-fofc_-3 193 | map_trim 3ueq*, search-seq, 4 194 | orient search-seq 195 | deselect 196 | mset 1 -360 197 | mview store, 1 198 | turn y, -180 199 | mview store, 180 200 | turn y, -180 201 | mview store, 360 202 | mplay 203 | --------------------------------------------------------------------------------