-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmacros.html
737 lines (661 loc) · 58.1 KB
/
macros.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
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Chapter 7 Macros | A Guide to YASARA</title>
<meta name="description" content="A guide for the visualization program YASARA and the uses of the program">
<meta name="generator" content="bookdown and GitBook 2.6.7">
<meta property="og:title" content="Chapter 7 Macros | A Guide to YASARA" />
<meta property="og:type" content="book" />
<meta property="og:image" content="images/cover.png" />
<meta property="og:description" content="A guide for the visualization program YASARA and the uses of the program" />
<meta name="github-repo" content="https://github.com/CEBerndsen/YASARA-guide" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="Chapter 7 Macros | A Guide to YASARA" />
<meta name="twitter:description" content="A guide for the visualization program YASARA and the uses of the program" />
<meta name="twitter:image" content="images/cover.png" />
<meta name="author" content="Chris Berndsen">
<meta name="date" content="2019-01-03">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="prev" href="making-measurements-and-comparisons.html">
<link rel="next" href="exercise-answers.html">
<script src="libs/jquery-2.2.3/jquery.min.js"></script>
<link href="libs/gitbook-2.6.7/css/style.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-table.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-bookdown.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-highlight.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-search.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-fontsettings.css" rel="stylesheet" />
<style type="text/css">
div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */
code > span.fl { color: #40a070; } /* Float */
code > span.ch { color: #4070a0; } /* Char */
code > span.st { color: #4070a0; } /* String */
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
code > span.ot { color: #007020; } /* Other */
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
code > span.fu { color: #06287e; } /* Function */
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
code > span.cn { color: #880000; } /* Constant */
code > span.sc { color: #4070a0; } /* SpecialChar */
code > span.vs { color: #4070a0; } /* VerbatimString */
code > span.ss { color: #bb6688; } /* SpecialString */
code > span.im { } /* Import */
code > span.va { color: #19177c; } /* Variable */
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code > span.op { color: #666666; } /* Operator */
code > span.bu { } /* BuiltIn */
code > span.ex { } /* Extension */
code > span.pp { color: #bc7a00; } /* Preprocessor */
code > span.at { color: #7d9029; } /* Attribute */
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div class="book without-animation with-summary font-size-2 font-family-1" data-basepath=".">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li><a href="./">A guide to biomolecule visualization and analysis in YASARA</a></li>
<li class="divider"></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html"><i class="fa fa-check"></i>Index</a><ul>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#why-read-this-book"><i class="fa fa-check"></i>Why read this book</a></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#what-is-in-this-guide"><i class="fa fa-check"></i>What is in this guide?</a></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#a-note-on-using-the-command-line"><i class="fa fa-check"></i>A note on using the command line</a></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#end-of-section-checks-and-active-reading"><i class="fa fa-check"></i>End of section checks and active reading</a></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#questions-and-corrections"><i class="fa fa-check"></i>Questions and corrections</a></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#copyright"><i class="fa fa-check"></i>Copyright</a></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#acknowledgements"><i class="fa fa-check"></i>Acknowledgements</a><ul>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#who-owns-yasara-and-the-other-programs-in-this-book"><i class="fa fa-check"></i>Who owns YASARA and the other programs in this book</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="1" data-path="obtaining-yasara.html"><a href="obtaining-yasara.html"><i class="fa fa-check"></i><b>1</b> Obtaining YASARA</a><ul>
<li class="chapter" data-level="1.1" data-path="obtaining-yasara.html"><a href="obtaining-yasara.html#what-is-yasara"><i class="fa fa-check"></i><b>1.1</b> What is YASARA</a></li>
<li class="chapter" data-level="1.2" data-path="obtaining-yasara.html"><a href="obtaining-yasara.html#download-yasaraview"><i class="fa fa-check"></i><b>1.2</b> Download YASARA<sub>view</sub></a></li>
<li class="chapter" data-level="1.3" data-path="obtaining-yasara.html"><a href="obtaining-yasara.html#installing-yasara"><i class="fa fa-check"></i><b>1.3</b> Installing YASARA</a></li>
</ul></li>
<li class="chapter" data-level="2" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html"><i class="fa fa-check"></i><b>2</b> The YASARA user interface</a><ul>
<li class="chapter" data-level="2.1" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#HUD"><i class="fa fa-check"></i><b>2.1</b> Heads Up Display (HUD)</a><ul>
<li class="chapter" data-level="2.1.1" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#atom-properties"><i class="fa fa-check"></i><b>2.1.1</b> Atom Properties</a></li>
<li class="chapter" data-level="2.1.2" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#content"><i class="fa fa-check"></i><b>2.1.2</b> Scene Content</a></li>
<li class="chapter" data-level="2.1.3" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#hiding-the-hud"><i class="fa fa-check"></i><b>2.1.3</b> Hiding the HUD</a></li>
</ul></li>
<li class="chapter" data-level="2.2" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#console"><i class="fa fa-check"></i><b>2.2</b> The Console</a><ul>
<li class="chapter" data-level="2.2.1" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#up-arrow"><i class="fa fa-check"></i><b>2.2.1</b> Up Arrow!</a></li>
<li class="chapter" data-level="2.2.2" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#tangent-on-using-the-command-line-and-the-interactive-menus"><i class="fa fa-check"></i><b>2.2.2</b> Tangent on using the command line and the interactive menus</a></li>
</ul></li>
<li class="chapter" data-level="2.3" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#seq"><i class="fa fa-check"></i><b>2.3</b> Sequence Bar</a></li>
<li class="chapter" data-level="2.4" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#Menu"><i class="fa fa-check"></i><b>2.4</b> Menu System</a><ul>
<li class="chapter" data-level="2.4.1" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#top-menu"><i class="fa fa-check"></i><b>2.4.1</b> Top Menu</a></li>
<li class="chapter" data-level="2.4.2" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#toprow"><i class="fa fa-check"></i><b>2.4.2</b> Top row buttons</a></li>
<li class="chapter" data-level="2.4.3" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#pop-up-menu"><i class="fa fa-check"></i><b>2.4.3</b> Pop-up menu</a></li>
<li class="chapter" data-level="2.4.4" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#selmenu"><i class="fa fa-check"></i><b>2.4.4</b> Selection Menus</a></li>
</ul></li>
<li class="chapter" data-level="2.5" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#help"><i class="fa fa-check"></i><b>2.5</b> Where to find help</a><ul>
<li class="chapter" data-level="2.5.1" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#searchdoc"><i class="fa fa-check"></i><b>2.5.1</b> SearchDoc</a></li>
<li class="chapter" data-level="2.5.2" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#help-movies"><i class="fa fa-check"></i><b>2.5.2</b> Help Movies</a></li>
</ul></li>
<li class="chapter" data-level="2.6" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#files"><i class="fa fa-check"></i><b>2.6</b> File system</a><ul>
<li class="chapter" data-level="2.6.1" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#datam"><i class="fa fa-check"></i><b>2.6.1</b> Naming files and Data Management</a></li>
</ul></li>
<li class="chapter" data-level="2.7" data-path="the-yasara-user-interface.html"><a href="the-yasara-user-interface.html#knowledge-self-checks"><i class="fa fa-check"></i><b>2.7</b> Knowledge Self-Checks</a></li>
</ul></li>
<li class="chapter" data-level="3" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html"><i class="fa fa-check"></i><b>3</b> File types and how to work with them in YASARA</a><ul>
<li class="chapter" data-level="3.1" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#types"><i class="fa fa-check"></i><b>3.1</b> Common model file types</a><ul>
<li class="chapter" data-level="3.1.1" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#pdb-files"><i class="fa fa-check"></i><b>3.1.1</b> .pdb files</a></li>
<li class="chapter" data-level="3.1.2" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#yob-files-yasara-object"><i class="fa fa-check"></i><b>3.1.2</b> .yob files (YASARA object)</a></li>
<li class="chapter" data-level="3.1.3" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#sce-files-scene-files"><i class="fa fa-check"></i><b>3.1.3</b> .sce files (Scene files)</a></li>
</ul></li>
<li class="chapter" data-level="3.2" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#starting-to-work-with-models-in-yasara"><i class="fa fa-check"></i><b>3.2</b> Starting to work with models in YASARA</a></li>
<li class="chapter" data-level="3.3" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#load"><i class="fa fa-check"></i><b>3.3</b> Loading a model</a><ul>
<li class="chapter" data-level="3.3.1" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#pdb-files-1"><i class="fa fa-check"></i><b>3.3.1</b> .pdb files</a></li>
<li class="chapter" data-level="3.3.2" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#getting-a-.pdb-file-from-the-internet"><i class="fa fa-check"></i><b>3.3.2</b> Getting a .pdb file from the internet</a></li>
<li class="chapter" data-level="3.3.3" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#yob-files"><i class="fa fa-check"></i><b>3.3.3</b> .yob files</a></li>
<li class="chapter" data-level="3.3.4" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#sce-files"><i class="fa fa-check"></i><b>3.3.4</b> .sce files</a></li>
</ul></li>
<li class="chapter" data-level="3.4" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#what-does-obj-vs.mol-vs.res-vs.atom-mean"><i class="fa fa-check"></i><b>3.4</b> What does Obj vs. Mol vs. Res vs. Atom mean?</a><ul>
<li class="chapter" data-level="3.4.1" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#why-is-the-organization-important"><i class="fa fa-check"></i><b>3.4.1</b> Why is the organization important?</a></li>
</ul></li>
<li class="chapter" data-level="3.5" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#build"><i class="fa fa-check"></i><b>3.5</b> Building a molecule</a></li>
<li class="chapter" data-level="3.6" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#save"><i class="fa fa-check"></i><b>3.6</b> Saving Models</a><ul>
<li class="chapter" data-level="3.6.1" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#pdb-files-2"><i class="fa fa-check"></i><b>3.6.1</b> .pdb files</a></li>
<li class="chapter" data-level="3.6.2" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#yob-files-1"><i class="fa fa-check"></i><b>3.6.2</b> .yob files</a></li>
<li class="chapter" data-level="3.6.3" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#sce-files-1"><i class="fa fa-check"></i><b>3.6.3</b> .sce files</a></li>
</ul></li>
<li class="chapter" data-level="3.7" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#remove"><i class="fa fa-check"></i><b>3.7</b> Adding and Removing Objects</a></li>
<li class="chapter" data-level="3.8" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#clearing-the-scene"><i class="fa fa-check"></i><b>3.8</b> Clearing the scene</a></li>
<li class="chapter" data-level="3.9" data-path="file-types-and-how-to-work-with-them-in-yasara.html"><a href="file-types-and-how-to-work-with-them-in-yasara.html#knowledge-self-checks-1"><i class="fa fa-check"></i><b>3.9</b> Knowledge Self-Checks</a></li>
</ul></li>
<li class="chapter" data-level="4" data-path="manipulate.html"><a href="manipulate.html"><i class="fa fa-check"></i><b>4</b> Manipulating the model</a><ul>
<li class="chapter" data-level="4.1" data-path="manipulate.html"><a href="manipulate.html#orient"><i class="fa fa-check"></i><b>4.1</b> Positioning and orienting the model</a><ul>
<li class="chapter" data-level="4.1.1" data-path="manipulate.html"><a href="manipulate.html#making-reproducible-views"><i class="fa fa-check"></i><b>4.1.1</b> Making Reproducible Views</a></li>
</ul></li>
<li class="chapter" data-level="4.2" data-path="manipulate.html"><a href="manipulate.html#style"><i class="fa fa-check"></i><b>4.2</b> Changing how the model looks</a><ul>
<li class="chapter" data-level="4.2.1" data-path="manipulate.html"><a href="manipulate.html#stylizing-individual-amino-acids"><i class="fa fa-check"></i><b>4.2.1</b> Stylizing individual amino acids</a></li>
<li class="chapter" data-level="4.2.2" data-path="manipulate.html"><a href="manipulate.html#hide"><i class="fa fa-check"></i><b>4.2.2</b> Showing and Hiding Atoms and Amino Acids</a></li>
</ul></li>
<li class="chapter" data-level="4.3" data-path="manipulate.html"><a href="manipulate.html#colors"><i class="fa fa-check"></i><b>4.3</b> Setting the Colors of the Model</a><ul>
<li class="chapter" data-level="4.3.1" data-path="manipulate.html"><a href="manipulate.html#color-wheel"><i class="fa fa-check"></i><b>4.3.1</b> Color Wheel</a></li>
<li class="chapter" data-level="4.3.2" data-path="manipulate.html"><a href="manipulate.html#color-by-element-and-other-features"><i class="fa fa-check"></i><b>4.3.2</b> Color by Element and other features</a></li>
<li class="chapter" data-level="4.3.3" data-path="manipulate.html"><a href="manipulate.html#changing-the-color-scheme"><i class="fa fa-check"></i><b>4.3.3</b> Changing the color scheme</a></li>
</ul></li>
<li class="chapter" data-level="4.4" data-path="manipulate.html"><a href="manipulate.html#surfaces"><i class="fa fa-check"></i><b>4.4</b> Adding a surface</a><ul>
<li class="chapter" data-level="4.4.1" data-path="manipulate.html"><a href="manipulate.html#hiding-a-surface"><i class="fa fa-check"></i><b>4.4.1</b> Hiding a surface</a></li>
</ul></li>
<li class="chapter" data-level="4.5" data-path="manipulate.html"><a href="manipulate.html#knowledge-self-check"><i class="fa fa-check"></i><b>4.5</b> Knowledge Self-Check</a></li>
</ul></li>
<li class="chapter" data-level="5" data-path="adding-annotations-to-your-scene.html"><a href="adding-annotations-to-your-scene.html"><i class="fa fa-check"></i><b>5</b> Adding annotations to your scene</a><ul>
<li class="chapter" data-level="5.1" data-path="adding-annotations-to-your-scene.html"><a href="adding-annotations-to-your-scene.html#png"><i class="fa fa-check"></i><b>5.1</b> Saving an image</a><ul>
<li class="chapter" data-level="5.1.1" data-path="adding-annotations-to-your-scene.html"><a href="adding-annotations-to-your-scene.html#background"><i class="fa fa-check"></i><b>5.1.1</b> Change the background color</a></li>
<li class="chapter" data-level="5.1.2" data-path="adding-annotations-to-your-scene.html"><a href="adding-annotations-to-your-scene.html#hidehud"><i class="fa fa-check"></i><b>5.1.2</b> Hide the HUD!</a></li>
<li class="chapter" data-level="5.1.3" data-path="adding-annotations-to-your-scene.html"><a href="adding-annotations-to-your-scene.html#rayopt"><i class="fa fa-check"></i><b>5.1.3</b> Ray Tracing options</a></li>
</ul></li>
<li class="chapter" data-level="5.2" data-path="adding-annotations-to-your-scene.html"><a href="adding-annotations-to-your-scene.html#labels"><i class="fa fa-check"></i><b>5.2</b> Labels</a><ul>
<li class="chapter" data-level="5.2.1" data-path="adding-annotations-to-your-scene.html"><a href="adding-annotations-to-your-scene.html#labpar"><i class="fa fa-check"></i><b>5.2.1</b> Label parameters</a></li>
<li class="chapter" data-level="5.2.2" data-path="adding-annotations-to-your-scene.html"><a href="adding-annotations-to-your-scene.html#removing-a-label"><i class="fa fa-check"></i><b>5.2.2</b> Removing a label</a></li>
</ul></li>
<li class="chapter" data-level="5.3" data-path="adding-annotations-to-your-scene.html"><a href="adding-annotations-to-your-scene.html#bonds"><i class="fa fa-check"></i><b>5.3</b> Adding Hydrogen Bonds</a><ul>
<li class="chapter" data-level="5.3.1" data-path="adding-annotations-to-your-scene.html"><a href="adding-annotations-to-your-scene.html#coloring-hydrogen-bonds"><i class="fa fa-check"></i><b>5.3.1</b> Coloring hydrogen bonds</a></li>
</ul></li>
<li class="chapter" data-level="5.4" data-path="adding-annotations-to-your-scene.html"><a href="adding-annotations-to-your-scene.html#figurelessons"><i class="fa fa-check"></i><b>5.4</b> Making good figures</a><ul>
<li class="chapter" data-level="5.4.1" data-path="adding-annotations-to-your-scene.html"><a href="adding-annotations-to-your-scene.html#considerations-when-making-a-biomolecule-figure"><i class="fa fa-check"></i><b>5.4.1</b> Considerations when making a biomolecule figure</a></li>
</ul></li>
<li class="chapter" data-level="5.5" data-path="adding-annotations-to-your-scene.html"><a href="adding-annotations-to-your-scene.html#knowledge-checks"><i class="fa fa-check"></i><b>5.5</b> Knowledge Checks</a></li>
</ul></li>
<li class="chapter" data-level="6" data-path="making-measurements-and-comparisons.html"><a href="making-measurements-and-comparisons.html"><i class="fa fa-check"></i><b>6</b> Making measurements and comparisons</a><ul>
<li class="chapter" data-level="6.1" data-path="making-measurements-and-comparisons.html"><a href="making-measurements-and-comparisons.html#select"><i class="fa fa-check"></i><b>6.1</b> Making Selections</a><ul>
<li class="chapter" data-level="6.1.1" data-path="making-measurements-and-comparisons.html"><a href="making-measurements-and-comparisons.html#making-multiple-selections"><i class="fa fa-check"></i><b>6.1.1</b> Making multiple selections</a></li>
<li class="chapter" data-level="6.1.2" data-path="making-measurements-and-comparisons.html"><a href="making-measurements-and-comparisons.html#how-to-manipulate-selections"><i class="fa fa-check"></i><b>6.1.2</b> How to manipulate selections</a></li>
</ul></li>
<li class="chapter" data-level="6.2" data-path="making-measurements-and-comparisons.html"><a href="making-measurements-and-comparisons.html#measure"><i class="fa fa-check"></i><b>6.2</b> Measuring Distance</a><ul>
<li class="chapter" data-level="6.2.1" data-path="making-measurements-and-comparisons.html"><a href="making-measurements-and-comparisons.html#labdist"><i class="fa fa-check"></i><b>6.2.1</b> Labeling distances</a></li>
</ul></li>
<li class="chapter" data-level="6.3" data-path="making-measurements-and-comparisons.html"><a href="making-measurements-and-comparisons.html#mangle"><i class="fa fa-check"></i><b>6.3</b> Measuring Angles</a></li>
<li class="chapter" data-level="6.4" data-path="making-measurements-and-comparisons.html"><a href="making-measurements-and-comparisons.html#dihedral"><i class="fa fa-check"></i><b>6.4</b> Measurings Dihedrals</a></li>
<li class="chapter" data-level="6.5" data-path="making-measurements-and-comparisons.html"><a href="making-measurements-and-comparisons.html#count"><i class="fa fa-check"></i><b>6.5</b> Counting Atoms/Residues</a></li>
<li class="chapter" data-level="6.6" data-path="making-measurements-and-comparisons.html"><a href="making-measurements-and-comparisons.html#align"><i class="fa fa-check"></i><b>6.6</b> Alignment</a><ul>
<li class="chapter" data-level="6.6.1" data-path="making-measurements-and-comparisons.html"><a href="making-measurements-and-comparisons.html#why-did-my-objmol-move-or-not"><i class="fa fa-check"></i><b>6.6.1</b> Why did my Obj/Mol move (or not)?</a></li>
<li class="chapter" data-level="6.6.2" data-path="making-measurements-and-comparisons.html"><a href="making-measurements-and-comparisons.html#rmsd"><i class="fa fa-check"></i><b>6.6.2</b> Root Mean Square Deviation</a></li>
</ul></li>
<li class="chapter" data-level="6.7" data-path="making-measurements-and-comparisons.html"><a href="making-measurements-and-comparisons.html#swap"><i class="fa fa-check"></i><b>6.7</b> Making amino acid or nucleotide substitutions</a><ul>
<li class="chapter" data-level="6.7.1" data-path="making-measurements-and-comparisons.html"><a href="making-measurements-and-comparisons.html#swapping-bonds"><i class="fa fa-check"></i><b>6.7.1</b> Swapping bonds</a></li>
</ul></li>
<li class="chapter" data-level="6.8" data-path="making-measurements-and-comparisons.html"><a href="making-measurements-and-comparisons.html#knowledge-checks-1"><i class="fa fa-check"></i><b>6.8</b> Knowledge Checks</a></li>
</ul></li>
<li class="chapter" data-level="7" data-path="macros.html"><a href="macros.html"><i class="fa fa-check"></i><b>7</b> Macros</a><ul>
<li class="chapter" data-level="7.1" data-path="macros.html"><a href="macros.html#text-editors"><i class="fa fa-check"></i><b>7.1</b> Text editors</a></li>
<li class="chapter" data-level="7.2" data-path="macros.html"><a href="macros.html#macro"><i class="fa fa-check"></i><b>7.2</b> Organization of a macro</a><ul>
<li class="chapter" data-level="7.2.1" data-path="macros.html"><a href="macros.html#the-as-a-way-to-help-your-reader-and-you"><i class="fa fa-check"></i><b>7.2.1</b> The <code>#</code> as a way to help your reader (and you!)</a></li>
</ul></li>
<li class="chapter" data-level="7.3" data-path="macros.html"><a href="macros.html#making-a-macro"><i class="fa fa-check"></i><b>7.3</b> Making a macro</a><ul>
<li class="chapter" data-level="7.3.1" data-path="macros.html"><a href="macros.html#commands-that-can-be-used-in-a-macro"><i class="fa fa-check"></i><b>7.3.1</b> Commands that can be used in a macro</a></li>
<li class="chapter" data-level="7.3.2" data-path="macros.html"><a href="macros.html#macrosave"><i class="fa fa-check"></i><b>7.3.2</b> Saving the macro</a></li>
<li class="chapter" data-level="7.3.3" data-path="macros.html"><a href="macros.html#macroplay"><i class="fa fa-check"></i><b>7.3.3</b> Playing the macro</a></li>
</ul></li>
<li class="chapter" data-level="7.4" data-path="macros.html"><a href="macros.html#macro-examples"><i class="fa fa-check"></i><b>7.4</b> Macro examples</a></li>
<li class="chapter" data-level="7.5" data-path="macros.html"><a href="macros.html#knowledge-checks-2"><i class="fa fa-check"></i><b>7.5</b> Knowledge Checks</a></li>
</ul></li>
<li class="chapter" data-level="8" data-path="exercise-answers.html"><a href="exercise-answers.html"><i class="fa fa-check"></i><b>8</b> Exercise Answers</a><ul>
<li class="chapter" data-level="8.1" data-path="exercise-answers.html"><a href="exercise-answers.html#threekey"><i class="fa fa-check"></i><b>8.1</b> Chapter 3</a></li>
<li class="chapter" data-level="8.2" data-path="exercise-answers.html"><a href="exercise-answers.html#fourkey"><i class="fa fa-check"></i><b>8.2</b> Chapter 4</a></li>
<li class="chapter" data-level="8.3" data-path="exercise-answers.html"><a href="exercise-answers.html#fivekey"><i class="fa fa-check"></i><b>8.3</b> Chapter 5</a></li>
<li class="chapter" data-level="8.4" data-path="exercise-answers.html"><a href="exercise-answers.html#sixkey"><i class="fa fa-check"></i><b>8.4</b> Chapter 6</a></li>
<li class="chapter" data-level="8.5" data-path="exercise-answers.html"><a href="exercise-answers.html#sevenkey"><i class="fa fa-check"></i><b>8.5</b> Chapter 6</a></li>
<li class="chapter" data-level="8.6" data-path="exercise-answers.html"><a href="exercise-answers.html#eightkey"><i class="fa fa-check"></i><b>8.6</b> Chapter 7</a></li>
</ul></li>
<li class="chapter" data-level="9" data-path="manage.html"><a href="manage.html"><i class="fa fa-check"></i><b>9</b> Data Management</a><ul>
<li class="chapter" data-level="9.1" data-path="manage.html"><a href="manage.html#introduction-to-the-problem"><i class="fa fa-check"></i><b>9.1</b> Introduction to the problem</a></li>
<li class="chapter" data-level="9.2" data-path="manage.html"><a href="manage.html#what-are-data"><i class="fa fa-check"></i><b>9.2</b> What are Data?</a></li>
<li class="chapter" data-level="9.3" data-path="manage.html"><a href="manage.html#effective-file-naming"><i class="fa fa-check"></i><b>9.3</b> Effective File naming</a><ul>
<li class="chapter" data-level="9.3.1" data-path="manage.html"><a href="manage.html#information-to-consider-including-in-file-names"><i class="fa fa-check"></i><b>9.3.1</b> Information to consider including in file names</a></li>
</ul></li>
<li class="chapter" data-level="9.4" data-path="manage.html"><a href="manage.html#data-and-file-naming-dictionary"><i class="fa fa-check"></i><b>9.4</b> Data and File Naming Dictionary</a></li>
<li class="chapter" data-level="9.5" data-path="manage.html"><a href="manage.html#data-management-plan"><i class="fa fa-check"></i><b>9.5</b> Data Management Plan</a><ul>
<li class="chapter" data-level="9.5.1" data-path="manage.html"><a href="manage.html#data-management-plan-questions-for-students-in-biochemistry-class"><i class="fa fa-check"></i><b>9.5.1</b> Data Management Plan questions for students in Biochemistry class:</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="10" data-path="errors-and-quirks.html"><a href="errors-and-quirks.html"><i class="fa fa-check"></i><b>10</b> Errors and quirks</a><ul>
<li class="chapter" data-level="10.1" data-path="errors-and-quirks.html"><a href="errors-and-quirks.html#macrotext"><i class="fa fa-check"></i><b>10.1</b> .mcr –> .txt and back again</a></li>
<li class="chapter" data-level="10.2" data-path="errors-and-quirks.html"><a href="errors-and-quirks.html#running-in-the-downloads-folder"><i class="fa fa-check"></i><b>10.2</b> Running in the downloads folder</a></li>
<li class="chapter" data-level="10.3" data-path="errors-and-quirks.html"><a href="errors-and-quirks.html#admin-permission-needed"><i class="fa fa-check"></i><b>10.3</b> Admin permission needed</a></li>
<li class="chapter" data-level="10.4" data-path="errors-and-quirks.html"><a href="errors-and-quirks.html#menu-bar-disappears"><i class="fa fa-check"></i><b>10.4</b> Menu bar disappears</a></li>
</ul></li>
<li class="divider"></li>
<li><a href="https://github.com/rstudio/bookdown" target="blank">
Published with bookdown</a></li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i><a href="./">A Guide to YASARA</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<div id="macros" class="section level1">
<h1><span class="header-section-number">Chapter 7</span> Macros</h1>
<p>Throughout this guide, the command line using syntax such as <code>ColorRes</code> and <code>PosOriObj</code> has been useful for doing manipulations to the structures and scenes in YASARA. However, typing many commands repeatedly can be tedious and potentially irreproducible. Static images are great illustrations of simple points, however sometimes an idea is too complex or a single image OR an interactive movie might be a more useful display item. This is where macros can come in. A <strong>macro</strong> is a file that contains all the commands as you would type them into the command line that is read by YASARA as a series of instructions for how to show, analyze, and/or record data. This chapter will focus on macros for making movies such as those shown HERE, while Chapter 9 will focus on macros for analysis.</p>
<p><strong>Note:</strong> Because macros are all command line based, I will not show how to do any of these steps using the menu system. Most of them can be found with a bit of searching or using <code>SearchDoc</code> to find the menu path. Also, the “>” from the beginning of lines will not be shown in code boxes because they are not included in the macro file.</p>
<div id="text-editors" class="section level2">
<h2><span class="header-section-number">7.1</span> Text editors</h2>
<p>Making a macro for YASARA requires a text editor such as <a href="https://en.wikipedia.org/wiki/Microsoft_Notepad">NotePad</a>, <a href="https://en.wikipedia.org/wiki/WordPad">WordPad</a>, or <a href="https://support.apple.com/guide/textedit/welcome/mac">TextEdit</a>. Each command is listed on a separate line and the entire file saved as a .mcr file type. See <a href="macros.html#macrosave">7.3.2</a> and <a href="errors-and-quirks.html#macrotext">10.1</a> for more information about saving YASARA appropriate macro files.</p>
</div>
<div id="macro" class="section level2">
<h2><span class="header-section-number">7.2</span> Organization of a macro</h2>
<p>Macros, regardless of function, all share a common header like that shown in Figure <a href="macros.html#fig:header">7.1</a>. The header is not shown or seen, unless the macro file is opened directly, but it can provide useful information to the reader such as the purpose and author of the macro.</p>
<div class="figure"><span id="fig:header"></span>
<img src="images/mcrheader.PNG" alt="Macro header in YASARA" width="120%" />
<p class="caption">
Figure 7.1: Macro header in YASARA
</p>
</div>
<div id="the-as-a-way-to-help-your-reader-and-you" class="section level3">
<h3><span class="header-section-number">7.2.1</span> The <code>#</code> as a way to help your reader (and you!)</h3>
<p>A list of YASARA commands, such as is shown below, can be dense to read and interpret.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">LoadPDB 1crn, download=yes
AutoPosOriObj <span class="dv">1</span>, x =<span class="st"> </span><span class="dv">1</span>, y =<span class="st"> </span><span class="dv">10</span>, z =<span class="st"> </span><span class="dv">0</span>, alpha =<span class="st"> </span><span class="dv">0</span>, beta =<span class="st"> </span><span class="dv">0</span>, gamma =<span class="st"> </span><span class="dv">0</span>
ColorRes cys, green
ShowRes cys
BallStickRes cys
AutoRotateObj <span class="dv">1</span>, Y =<span class="st"> </span><span class="dv">1</span>
wait <span class="dv">180</span>
AutoRotateObj <span class="dv">1</span>, Y =<span class="st"> </span><span class="dv">0</span>
ZoomRes Cys <span class="dv">16</span>, step =<span class="st"> </span><span class="dv">50</span>
wait <span class="dv">100</span>
ZoomRes all</code></pre></div>
<p>Just reading this list of commands and finding the one you need is difficult. Any line that starts with <code>#</code> however will not be read by YASARA and can serve to help reduce the density of text and is good for writing notes to your future self as shown below.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># Load the structure of crambin from the internet</span>
LoadPDB 1crn, download=yes
<span class="co"># Position and orient the object as below to better show the over structure</span>
AutoPosOriObj <span class="dv">1</span>, x =<span class="st"> </span><span class="dv">1</span>, y =<span class="st"> </span><span class="dv">10</span>, z =<span class="st"> </span><span class="dv">0</span>, alpha =<span class="st"> </span><span class="dv">0</span>, beta =<span class="st"> </span><span class="dv">0</span>, gamma =<span class="st"> </span><span class="dv">0</span>
<span class="co">#Color the cysteine residues green and show them as ball-stick forms</span>
ColorRes cys, green
ShowRes cys
BallStickRes cys
<span class="co"># Rotate the object, wait for 180 degrees, then stop</span>
AutoRotateObj <span class="dv">1</span>, Y =<span class="st"> </span><span class="dv">1</span>
Wait <span class="dv">180</span>
AutoRotateObj <span class="dv">1</span>, Y =<span class="st"> </span><span class="dv">0</span>
<span class="co"># Zoom in on cysteine 16 over the course of 50 steps, wait for 100 screen refreshes, then zoom out</span>
ZoomRes Cys <span class="dv">16</span>, step =<span class="st"> </span><span class="dv">50</span>
Wait <span class="dv">100</span>
ZoomRes all, step =<span class="st"> </span><span class="dv">50</span></code></pre></div>
<p>Reading the annotated commands above, it is clearer what is intended and how the code leads to this result. Use <code>#</code> as a note to your future self so that if you need to re-use code or want to troubleshoot, you can find your target easier.</p>
</div>
</div>
<div id="making-a-macro" class="section level2">
<h2><span class="header-section-number">7.3</span> Making a macro</h2>
<p>To make a macro, open your text editor then make your header followed by your commands. HERE is a general template that can be derived as needed. The first set of commands are shown in the code box below and they set the environment. These settings can be adjusted as needed (use <code>SearchDoc</code> for more details) but are good places to start for most computers.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># Change working directory to the place of this macro</span>
<span class="co"># (so that we don't have to specify paths when loading stuff).</span>
<span class="kw">CD</span> (MacroDir)
<span class="co">#If there is an error, the macro continues</span>
OnError Continue
<span class="co"># Don't show console and head up display</span>
Console Off
HUD Off
<span class="co"># Set default parameters</span>
CoordSys Left
Projection perspective
StickRadius <span class="dv">50</span>
BallStickRadius <span class="dv">50</span>,<span class="dv">50</span>
AtomTexture <span class="dv">1</span>
Fog <span class="dv">70</span>
ColorFog Black
SurfPar Resolution=<span class="dv">3</span>, Molecular=Gaussian
AtomSize <span class="dv">100</span>
<span class="co"># Animation delay</span>
delay=<span class="dv">400</span>
<span class="co"># Set the YASARA window size</span>
ScreenSize X=<span class="dv">1024</span>,Y=<span class="dv">768</span>,Scale=<span class="dv">1</span></code></pre></div>
<div id="commands-that-can-be-used-in-a-macro" class="section level3">
<h3><span class="header-section-number">7.3.1</span> Commands that can be used in a macro</h3>
<p>After the header and the environment settings, the YASARA commands can then be typed with one command per line. For most macros that are simply displaying structures, the commands like <code>Color</code> (<a href="manipulate.html#colors">4.3</a>), <code>PosOri</code> (<a href="manipulate.html#orient">4.1</a>), and <code>Label</code> (<a href="adding-annotations-to-your-scene.html#labels">5.2</a>) along with broader sets of commands for changing display style (<a href="manipulate.html#style">4.2</a>) and surfaces (<a href="manipulate.html#surfaces">4.4</a>) work just as they would be typed into the command line. However there are additional commands that can be useful as well.</p>
<div id="rotate" class="section level4">
<h4><span class="header-section-number">7.3.1.1</span> Rotate</h4>
<p>The <code>Rotate</code> command is similar to the <code>PosOri</code> commands described in section <a href="manipulate.html#orient">4.1</a>. In <code>Rotate</code>, the Obj is specified along with the axis of rotation (X, Y or Z) and the number of degrees as shown below.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># Load the structure of crambin from the internet</span>
LoadPDB 1crn, download=yes
<span class="co"># Rotate Obj 1 30 degrees around the Y-axis</span>
RotateObj <span class="dv">1</span>, Y =<span class="st"> </span><span class="dv">30</span>
<span class="co"># Rotate the Obj 1 30 degrees around the Y-axis and 20 degrees around the Z-axis</span>
RotateObj <span class="dv">1</span>, Y =<span class="st"> </span><span class="dv">30</span>, Z =<span class="st"> </span><span class="dv">20</span></code></pre></div>
<p>For macros that are being used to display information in a presentation style, it is worth using <code>AutoRotate</code>, which animates the rotation in a nice format. The command is the same, except <code>Auto</code> needs to be inserted before <code>Rotate</code> as shown below. One caution is that <code>AutoRotate</code> needs a stop command in the form of the same command with the axis rotations set to 0.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># Load the structure of crambin from the internet</span>
LoadPDB 1crn, download=yes
<span class="co"># Rotate Obj 1 around the Y-axis in 1 degree steps</span>
AutoRotateObj <span class="dv">1</span>, Y =<span class="st"> </span><span class="dv">1</span>
<span class="co"># Rotate the Obj 1 the Y-axis and the Z-axis in 1 degree steps</span>
AutoRotateObj <span class="dv">1</span>, Y =<span class="st"> </span><span class="dv">1</span>, Z =<span class="st"> </span><span class="dv">1</span>
<span class="co"># To stop rotate set the axis to zero</span>
AutoRotateObj <span class="dv">1</span>, Y =<span class="st"> </span><span class="dv">0</span>, Z =<span class="st"> </span><span class="dv">0</span></code></pre></div>
<p><strong>Stylistic suggestion:</strong> Do not set the <code>AutoRotate</code> command to move more than 2 degrees per step as it can get disorienting with fast spinning.</p>
</div>
<div id="displaying-images" class="section level4">
<h4><span class="header-section-number">7.3.1.2</span> Displaying images</h4>
<p>Images can also be added to a macro and positioned within the viewing window, however it is a two step process.</p>
<ol style="list-style-type: decimal">
<li><p><strong>Load</strong> the image file into the program using the commands <code>LoadPNG</code> and <code>LoadJPG</code> depending on your file type</p></li>
<li><p><strong>Show</strong> the image using the command <code>ShowImage</code> followed by a number. If you have only loaded 1 image, this value is likely 1.</p></li>
</ol>
<p><code>ShowImage</code> also takes commands to position and size the image within the viewing window as detailed below and shown in the code chunk with the results shown in Figure <a href="macros.html#fig:images">7.2</a>.</p>
<ul>
<li><p><strong>X and Y :</strong> These set the coordinates for the top left corner of the image. These can be negative if you want the image to be moved down and right.</p></li>
<li><p>** Width and Height:** Sets the width and height of the image. If they are larger than the image itself, then the image will be reduced on the screen.</p></li>
<li><p><strong>Alpha:</strong> Like surfaces, you can adjust the transparency of an image. 100 is non-transparent, while 0 is completely transparent.</p></li>
<li><p><strong>Priority:</strong> This is the layering function of the command. If set to 1, then the images is on top, if set to 0, then it is on the bottom and any structures will appear over the image.</p></li>
</ul>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># Load the image called slide_1 into the memory</span>
LoadJPG example
<span class="co"># Show the image at full size</span>
ShowImage <span class="dv">1</span>
<span class="co"># Show the image, but at a different position</span>
ShowImage <span class="dv">1</span>, X =<span class="st"> </span><span class="op">-</span><span class="dv">1100</span>, Y =<span class="st"> </span><span class="op">-</span><span class="dv">500</span>, Alpha=<span class="dv">100</span>, Priority=<span class="dv">1</span>
<span class="co"># Show the image, but at a different position and scaling</span>
ShowImage <span class="dv">1</span>, X =<span class="st"> </span><span class="op">-</span><span class="dv">100</span>, Y =<span class="st"> </span><span class="op">-</span><span class="dv">500</span>, Width =<span class="st"> </span><span class="dv">5000</span>, Height =<span class="st"> </span><span class="dv">5000</span>, Alpha=<span class="dv">100</span>, Priority=<span class="dv">1</span>
<span class="co"># Show the image underneath of DNA</span>
LoadPDB 1BNA, download=yes
ShowImage <span class="dv">1</span>, Priority=<span class="dv">0</span></code></pre></div>
<div class="figure"><span id="fig:images"></span>
<img src="YASARA-guide_files/figure-html/images-1.png" alt="Results from Load and ShowImage commands" width="100%" />
<p class="caption">
Figure 7.2: Results from Load and ShowImage commands
</p>
</div>
<p>Images can be useful for showing reference or acknowledgement slides. To do this, list your references in a Powerpoint slide, Photoshop image, or whatever format can be easily converted to a .PNG or .JPG file. Then import the references into YASARA at the end of your macro.</p>
<div id="hiding-or-removing-images" class="section level5">
<h5><span class="header-section-number">7.3.1.2.1</span> Hiding or removing images</h5>
<p>When an image is no longer needed, it is prudent to hide the image on the screen or delete the image from the memory. To hide the image, the command is <code>HideImage</code> followed by the image number. To delete the image, the command is <code>DelImage</code> followed by the image number. Hide is preferred if the image will be needed again, such as a background image.</p>
</div>
</div>
<div id="showing-messages" class="section level4">
<h4><span class="header-section-number">7.3.1.3</span> Showing messages</h4>
<p>Messages are a useful way to annotate your pictures beyond what a label can show. The command is <code>ShowMessage</code> followed by the text of your message.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># Show the message "Hello World!"</span>
ShowMessage Hello World<span class="op">!</span></code></pre></div>
<p>The limits of the text using <code>ShowMessage</code> are not always clear and should be optimized for your screen size. If a message is too long for the screen to display in a single frame, then the message will scroll from left to right in a repeating loop. Also, certain punctuation can cause issues for messages.</p>
<div id="hide-messages" class="section level5">
<h5><span class="header-section-number">7.3.1.3.1</span> Hide messages</h5>
<p>To hide a message the command is <code>HideMessage</code>.</p>
</div>
</div>
<div id="wait" class="section level4">
<h4><span class="header-section-number">7.3.1.4</span> Wait</h4>
<p><code>Wait</code> commands can be useful for stopping the macro until a certain time or action occurs. For macros containing a mixture of structures, text, and images, <code>Wait</code> commands are the way to stop YASARA so that the viewer can see and understand the screen display. The basic <code>Wait</code> commands are:</p>
<ul>
<li><p><strong>Wait XXX:</strong> The XXX value is replaced with a number equal to the number of screen refreshes. For a 60 Hz screen, 60 would mean ~1 second.</p></li>
<li><p><strong>Wait Button:</strong> The scene holds until the viewer clicks a mouse button. This can be further specified to <code>LeftButton</code> if desired.</p></li>
<li><p><strong>Wait ContinueButton:</strong> YASARA will displays a box labeled “Continue” in the bottom right corner and the scene holds until the viewer clicks the button.</p></li>
<li><p><strong>Wait MarkedAtom XXX:</strong> The scene holds until the viewer clicks the atom specified by XXX.</p></li>
</ul>
<p>Here is an example of a mixed <code>ShowMessage</code> and <code>Wait</code> command.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># Show message until user clicks the continue button then hide the message</span>
ShowMessage Hello World<span class="op">!</span>
Wait ContinueButton
HideMessage</code></pre></div>
</div>
</div>
<div id="macrosave" class="section level3">
<h3><span class="header-section-number">7.3.2</span> Saving the macro</h3>
<p>To save the macro, save the document as you normally would, however append the file extension of .mcr. In Notepad, this requires going file>Save As, then typing a file name, and changing the “Save as type” to “All files”. On a Mac, TextEdit may not allow you to add the exension when you save, however you can change the file extension ((macrotext)).</p>
</div>
<div id="macroplay" class="section level3">
<h3><span class="header-section-number">7.3.3</span> Playing the macro</h3>
<p>When playing a macro, make sure that all associated models, images, or other files are included in the folder with the macro file. Otherwise you may have errors or missing scenes while playing the macro.</p>
<p>Macros can be played through the file system by:</p>
<p>Options>Macro & Movie>Play Macro, and then selecting the .mcr file to play.</p>
<p>Via the command line:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># command to play the macro</span>
<span class="op">></span>PlayMacro path\to\macro\awesome_macro.mcr</code></pre></div>
<div id="drag-and-drop" class="section level4">
<h4><span class="header-section-number">7.3.3.1</span> Drag and Drop</h4>
<p>The easiest way to play a macro is to drag the file into an open YASARA window.</p>
</div>
</div>
</div>
<div id="macro-examples" class="section level2">
<h2><span class="header-section-number">7.4</span> Macro examples</h2>
<p>Below is an example of part of a macro that loads the structure of DNA and shows how steric clashing causes problems. The complete macro can be found here. Not all of the commands in the macro have been described in this guide, but they can be found in more detail using <code>SearchDoc</code>.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># Header</span>
<span class="co"># YASARA MOVIE</span>
<span class="co"># TOPIC: Thermodynamics</span>
<span class="co"># TITLE: Thermodynamics</span>
<span class="co"># REQUIRES: View</span>
<span class="co"># AUTHOR: Chris Berndsen</span>
<span class="co"># LICENSE: CC-BY-4.0</span>
<span class="co"># DESCRIPTION: An educational resource to thermodynamics in Biochemistry I</span>
<span class="co"># Set the YASARA environment</span>
<span class="kw">CD</span> (MacroDir)
OnError Continue
<span class="co"># Don't show console and head up display</span>
Console Off
HUD Off
<span class="co"># Set default parameters</span>
CoordSys Left
Projection perspective
StickRadius <span class="dv">50</span>
BallStickRadius <span class="dv">50</span>,<span class="dv">50</span>
AtomTexture <span class="dv">1</span>
Fog <span class="dv">70</span>
ColorFog Black
SurfPar Resolution=<span class="dv">3</span>,Molecular=Gaussian
AtomSize <span class="dv">100</span>
<span class="co"># Animation delay</span>
delay=<span class="dv">400</span>
<span class="co"># Macro bits</span>
<span class="co">#</span>
<span class="co"># SLIDE 1: Sterics</span>
<span class="co">#</span>
Steric<span class="op">:</span>
<span class="co">#</span>
Clear
<span class="co">#Load the molecule, remove waters, and position it</span>
LoadPDB 1BNA, download=yes
Style BallStick
DelRes HOH
PosOriObj <span class="dv">01</span>, X=<span class="fl">0.000</span>, Y=<span class="fl">0.000</span>, Z=<span class="fl">67.620</span>, Alpha=<span class="fl">101.323</span>, Beta=<span class="fl">330.643</span>, Gamma=<span class="fl">5.241</span>
<span class="co"># Show message and wait until continue button is pushed then hide the message and show another message (x2)</span>
ShowMessage This is the structure of DNA.
ShowButton Continue
Wait ContinueButton
HideMessage
ShowMessage While not shown here, molecules are always moving and stretching.
ShowButton Continue
Wait ContinueButton
HideMessage
ShowMessage Stable molecules are <span class="cf">in</span> equilibrium with less stable forms of the molecule.
ShowButton Continue
Wait ContinueButton
HideMessage
<span class="co"># Hide the side chain atoms and zoom in on bases 7 and 18, with some formatting</span>
HideAtom sidechain
ZoomRes <span class="dv">7</span> <span class="dv">18</span>
ColorRes all, grey
ColorRes <span class="dv">7</span> <span class="dv">18</span>, element
ShowRes <span class="dv">7</span> <span class="dv">18</span>
<span class="co"># Center the atom on the screen</span>
CenterAtom Atom <span class="dv">361</span>
<span class="co"># Rotate about the axis for 330 steps then stop and wait for 0.5 seconds</span>
AutoRotateObj <span class="dv">1</span>, Y =<span class="st"> </span><span class="dv">1</span>
Wait <span class="dv">330</span>
AutoRotateObj <span class="dv">1</span>, Y =<span class="st"> </span><span class="dv">0</span>
Wait <span class="dv">30</span>
<span class="co"># Rotate about the axis for 360 steps then stop and then show a message</span>
AutoRotateObj <span class="dv">1</span>, X =<span class="st"> </span><span class="dv">1</span>
Wait <span class="dv">360</span>
AutoRotateObj <span class="dv">1</span>, X =<span class="st"> </span><span class="dv">0</span>
ShowMessage Shown are two nucleotides within DNA forming a base pair.
ShowButton Continue
Wait ContinueButton
HideMessage
<span class="co"># Add hydrogens and then show the hydrogen bonds and a message.</span>
AddHydObj <span class="dv">1</span>
ShowHBoRes <span class="dv">7</span> <span class="dv">18</span>,Extend=No
ShowMessage Hydrogen bonds have been added <span class="cf">in</span> yellow to show how these atoms interact.
ShowButton Continue
Wait ContinueButton
HideMessage
<span class="co"># Rotate and then show two messages</span>
AutoRotateObj <span class="dv">1</span>, Y =<span class="st"> </span><span class="dv">1</span>
Wait <span class="dv">360</span>
AutoRotateObj <span class="dv">1</span>, Y =<span class="st"> </span><span class="dv">0</span>
Wait <span class="dv">30</span>
AutoRotateObj <span class="dv">1</span>, X =<span class="st"> </span><span class="dv">1</span>
Wait <span class="dv">360</span>
AutoRotateObj <span class="dv">1</span>, X =<span class="st"> </span><span class="dv">0</span>
ShowMessage Like all weak bonds, the atoms are <span class="cf">in</span> motion and moving apart and together to find the most stable state.
ShowButton Continue
Wait ContinueButton
HideMessage
ShowMessage How do you think this interaction would be affected <span class="cf">if</span> the atoms were <span class="cf">in</span> different positions?
ShowButton Continue
Wait ContinueButton
HideMessage
<span class="co"># Rotate and then make a mutation, rotate again to show the mutation effects, then show a series of messages.</span>
AutoRotateObj <span class="dv">1</span>, X =<span class="st"> </span><span class="dv">1</span>
Wait <span class="dv">90</span>
AutoRotateObj <span class="dv">1</span>, X =<span class="st"> </span><span class="dv">0</span>
Wait <span class="dv">30</span>
SwapRes Atom <span class="dv">210</span>, DA,Isomer=L
ShowHBoRes <span class="dv">7</span> <span class="dv">18</span>,Extend=No
Wait <span class="dv">30</span>
AutoRotateObj <span class="dv">1</span>, X =<span class="st"> </span><span class="dv">1</span>
Wait <span class="dv">360</span>
AutoRotateObj <span class="dv">1</span>, X =<span class="st"> </span><span class="dv">0</span>
ShowMessage Is this interaction more stable now that the atoms are closer?
ShowButton Continue
Wait ContinueButton
HideMessage
ShowMessage It is likely that these molecules would adopt a new position to reduce the unfavorable overlap of atoms.
ShowButton Continue
Wait ContinueButton
HideMessage
<span class="co"># Zoom out and then change the scene</span>
ZoomAll
ShowRes All
ZoomAll
<span class="co"># Rotate and then show a series of messages</span>
AutoRotateObj <span class="dv">1</span>, X =<span class="st"> </span><span class="op">-</span><span class="dv">1</span>
Wait <span class="dv">90</span>
AutoRotateObj <span class="dv">1</span>, X =<span class="st"> </span><span class="dv">0</span>
ShowMessage How might this overlap affect the overall stability of the larger molecule?
ShowButton Continue
Wait ContinueButton
HideMessage
ShowMessage Hint<span class="op">:</span><span class="st"> </span>If you have taken a BIO course, how common are A<span class="op">:</span>A base pairs?
ShowButton Continue
Wait ContinueButton
HideMessage
ShowMessage Remember, molecules and reactions will always try to find the most stable state <span class="cf">in</span> the environment.
ShowButton Continue
Wait ContinueButton
HideMessage
ShowMessage The shape and <span class="cf">function</span> of biomolecules depends on this principle.
ShowButton Continue
Wait ContinueButton
HideMessage</code></pre></div>
</div>
<div id="knowledge-checks-2" class="section level2">
<h2><span class="header-section-number">7.5</span> Knowledge Checks<a href="#fn10" class="footnoteRef" id="fnref10"><sup>10</sup></a></h2>
<ol style="list-style-type: decimal">
<li>Create a macro that loads the PDB file 1UBQ, deletes the waters, centers the protein on the screen, and then cycles through each of the representations with a message describing what is shown. Have a 2 second wait between each change in representation.</li>
</ol>
</div>
</div>
<div class="footnotes">
<hr />
<ol start="10">
<li id="fn10"><p>Answers can be found <a href="exercise-answers.html#eightkey">8.6</a><a href="macros.html#fnref10">↩</a></p></li>
</ol>
</div>
</section>
</div>
</div>
</div>
<a href="making-measurements-and-comparisons.html" class="navigation navigation-prev " aria-label="Previous page"><i class="fa fa-angle-left"></i></a>
<a href="exercise-answers.html" class="navigation navigation-next " aria-label="Next page"><i class="fa fa-angle-right"></i></a>
</div>
</div>
<script src="libs/gitbook-2.6.7/js/app.min.js"></script>
<script src="libs/gitbook-2.6.7/js/lunr.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-search.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-sharing.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-fontsettings.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-bookdown.js"></script>
<script src="libs/gitbook-2.6.7/js/jquery.highlight.js"></script>
<script>
gitbook.require(["gitbook"], function(gitbook) {
gitbook.start({
"sharing": {
"github": false,
"facebook": true,
"twitter": true,
"google": true,
"linkedin": false,
"weibo": false,
"instapaper": false,
"vk": false,
"all": ["facebook", "google", "twitter", "linkedin", "weibo", "instapaper"],
"instapper": false
},
"fontsettings": {
"theme": "white",
"family": "serif",
"size": 2
},
"edit": {
"link": null,
"text": null
},
"history": {
"link": null,
"text": null
},
"download": null,
"toc": {
"collapse": "section",
"scroll_highlight": true
},
"search": true,
"toolbar": {
"position": "fixed"
}
});
});
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
var src = "";
if (src === "" || src === "true") src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML";
if (location.protocol !== "file:" && /^https?:/.test(src))
src = src.replace(/^https?:/, '');
script.src = src;
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>