Repository navigation
Expand file tree
/
Copy pathscripting.html
More file actions
1738 lines (1218 loc) · 63.1 KB
/
Copy pathscripting.html
File metadata and controls
1738 lines (1218 loc) · 63.1 KB
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
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!--#set var="TITLE" value="OpenAstexViewer Scripting Language" -->
<!--#include file="header.inc" -->
<h3>Table of Contents</h3>
<div class=doctext>
<ul>
<li><b><a href=#molecules>Loading and Deleting Molecules</a></b>
<li><b><a href=#maps>Loading and Deleting Maps and Grids</a></b>
<li><b><a href=#display>Display Styles for Atoms and Bonds</a></b>
<li><b><a href=#coloring>Coloring Atoms</a></b>
<li><b><a href=#labels>Labels and Distances</a></b>
<li><b><a href=#view>Controlling the View</a></b>
<li><b><a href=#objects>Creating Graphical Objects</a></b>
<li><b><a href=#manipulating>Manipulating Graphical Objects</a></b>
<li><b><a href=#property>Property Calculations and Texture Mapping</a></b>
<li><b><a href=#selections>Atom Selections</a></b>
<li><b><a href=#animation>Animation Commands</a></b>
<li><b><a href=#misc>Miscellaneous Scripting Commands</a></b>
</ul>
<h3><a href=#top name=molecules>Loading and Deleting Molecules</a></h3>
<p> OpenAstexViewer can read molecules from a variety of common file
formats. These include PDB files, MDL mol files and to a limited
extent Sybyl mol2 files. If the file name ends with .gz then it will
be assumed to have been compressed with gzip.
If OpenAstexViewer is running as an applet it will attempt to locate files
in any of the places that are allowed. This includes on the server, or
in the Jar file that OpenAstexViewer was downloaded in. It will also check
to see if it can find a gzip'ed version of the file in any of these
locations.
It should be noted that applets cannot usually read or write files
from the local disk of the machine that is running the applet. It is
possible to change this behaviour in Internet Explorer running on
Windows, without resorting to the use of signed applets. This is
described in detail in a later section.
<dl>
<dt>molecule load <em>name</em> <em>file_or_url</em></dt>
<dd>This is the basic command to load a molecule into OpenAstexViewer. The
<em>name</em> will be used to refer to this molecule in future
operations. The name may be optionally quoted in either single or
double quotes (valid names are discussed in detail later on). The
final parameter is a string that refers to a filename or a URL. Note
there are many limitations on what files/URL's can be read by a
standard applet (this is discussed in detail later on). Errors are not
handled gracefully, and will usually result in error messages written
to the console or the Java console if running as an applet.
</dd>
<dt>molecule lazy <em>name</em> <em>file_or_url</em></dt>
<dd>This variant on the molecule load command will only load the
molecule if one by this name doesn't already exist. This is usually
used as a convenience when a web application doesn't know if a target
molecule has already been loaded.
</dd>
<dt>molecule remove <em>pattern</em></dt>
<dd>This command removes the molecules whose names match the specified
pattern. The pattern can consist of simple wildcard characters and
ranges (see later for a full description of the allowed patterns), but
does not support full regular expressions.
</dd>
<dt>molecule display <em>pattern</em> {on/off/toggle}</dt>
<dd>Change the way a molecule is displayed. Accepted values of action
are <code>on</code>, <code>off</code> and <code>toggle</code>. The
<code>toggle</code> option will turn a molecule on if it is off and
off if it is on. Molecules that are off do not contribute to the
graphics display at all (note that graphical objects that are derived
from a molecule are not affected by this setting, but lines, spheres,
cylinders, distances, labels etc. are affected).
</dd>
<dt>write -molecule <em>name</em> [options]
<dd> This new style command provides capabilities for writing
molecules. Molecules can be written to files and to
<code>url</code>'s. The supported options are
<dl>
<dt>-type {pdb/mol}
<dd>Write the molecule out in this format. If no type is specified the
molecule is written out in the format it was read from. In the PDB
format CONECT records are used to keep track of bond orders, by
specifying the bond multiple times (similar to the way RasMol does
this). Element types are recorded on the end of the ATOM records as
described in the PDB format description.
<p>MDL <code>mol</code> files will support the basic element, bond
orders and charges. Behaviour is undefined when writing more than 999
atoms or bonds to a <code>mol</code> file.
<dt>-file <em>string</em>
<dd>Specify the file name to write the file to. You are responsible
for supplying the correct file extension and the path information in
the right format for your operating system.
<dt>-url <em>string</em>
<dd>Write the specified molecule to a url. This is done by packing the
molecule into a string, encoding it to protect special characters and
<code>POST</code>'ing it to the specified <code>url</code>. By default
the molecule is sent as the parameter <code>pdb=...</code>.
Additional name/value pairs specified in the <code>url</code> are
identified and posted along with the molecule. This provides a very
powerful way for communicating changes back to a database, using only
basic Internet standard protocols. [<em>Note, if running as an Applet
you are usually only able to write to <code>url</code>'s on the same
server that you were downloaded from</em>].
<dt>-parameter <em>name</em>
<dd>Change the parameter that is used for sending a molecule to a
<code>url</code>. The new parameter must be a valid name for a
URL. The default parameter name for <code>url</code> writes is
<code>pdb</code>.
</dl>
</dl>
<h3><a href=#top name=maps>Loading and Deleting Maps and Grids</a></h3>
<dl>
<dt>map load <em>name</em> <em>file_or_url</em></dt>
<dd>This is the basic command to load a map into OpenAstexViewer. The
<em>name</em> will be used to refer to this map in future
operations. The name may be optionally quoted in either single or
double quotes (valid names are discussed in detail later on). The
final parameter is a string that refers to a filename or a URL. Note
there are many limitations on what files/URL's can be read by a
standard applet (this is discussed in detail later on). Errors are not
handled gracefully, and will usually result in error messages written
to the console or the Java console if running as an applet.
</dd>
<dt>map remove <em>pattern</em></dt>
<dd>This command removes the maps whose names match the specified
pattern. The pattern can consist of simple wildcard characters and
ranges (see later for a full description of the allowed patterns), but
does not support full regular expressions.
</dd>
<dt>map <em>name</em> contour {0/1/2} {on/off/toggle}</dt>
<dd>When a map or grid is loaded it is created with three contour
levels. Exactly which contour levels are turned on or off and
displayed at which levels depends on the type of map. This command
allows you to change which contour levels are displayed.
</dd>
<dt>map <em>name</em> contour {0/1/2} <em>number</em></dt>
<dd>This command allows you to specify the contour value for
particular contour levels.
</dd>
<dt>map <em>name</em> contour {0/1/2} <em>color</em></dt>
<dd>This command allows you to specify the color for particular
contour levels.
</dd>
<dt>map <em>name</em> contour {0/1/2} {wire/solid}</dt>
<dd>This command allows you to specify how a particular contour level
is displayed. The value <em>wire</em> will show the contour level in
the traditional electron density style, while <em>solid</em> will
produce a shaded, triangulated version of the contour level.
</dd>
<dt>map <em>name</em> contour {0/1/2} linewidth <em>number</em></dt>
<dd>Specify the linewidth for a particular map contour. The values
-1, -2 and -3 draw the contour in increasingly wide lines. Positive
values will draw the lines as cylinders. A value of around 0.01 is
about as thick as the thinnest line.
</dd>
<dt>map <em>name</em> contour {0/1/2} transparency {0-255}</dt>
<dd>Specify the transparency level for a triangulated map contour.
Level 0 is completely transparent and 255 is completely opaque.
</dd>
</dl>
When a map is loaded it creates three graphical objects which it uses
to display the various contour levels. The objects are called
<em>name_0</em>, <em>name_1</em> and <em>name_2</em>. Extreme caution
should be taken not to make changes to these objects (especially
deleting them), as the map will overwrite the changes you make to
them.
<h3><a href=#top name=display>Display Styles for Atoms and Bonds</a></h3>
OpenAstexViewer supports the usual styles for renderering molecules. These
are lines, ball-and-stick, cylinders and spheres. The following
scripting commands are used to change how a particular set of atoms
are displayed.
<dl>
<dt>display <em>style</em> {on/off} <u>selection</u><dt>
<dd>This command controls whether or not the specified atoms are
displayed in the indicated style. The allowed values for
<em>style</em> are
<dl>
<dt>spheres
<dd>A single sphere displayed in the vdW radius of the atom with the
current color and transparency of the atom. There are two methods for
drawing spheres. The first uses a bitmap which is very fast, allowing
even the biggest structures to be rendered as spheres in real
time. The second uses analytical spheres which intersect better but
are much slower. This is a global setting which applies to all spheres
(in graphical objects as well) and is described in View Settings.
<dt>cylinders
<dd>A sphere capped cylinder (capsule) is drawn to represent all bonds
between atoms that have the cylinder style. Each half of the cylinder
is drawn in the color of the atom, and the current cylinder radius is
used. It should be noted that cylinders cannot be transparent in the
current version of OpenAstexViewer. If a bond has a marked bond order
(e.g. it came from an SD file) then the bond order will be shown. If a
double bond lies in a ring then a detail line is drawn inside the most
appropriate ring. Exocylic double bonds have their detail drawn in the
plane of one of the sp2 atoms they are connected to.
<dt>sticks
<dd>Colored spheres are drawn for each atom, and a single color
stick, usually of a slightly thinner radius is drawn for each bond
between atoms that have the <em>sticks</em> display style. No bond
order indicators are drawn, and sticks cannot be made transparent.
<dt>lines
<dd>This is the default display style for all atoms. The lines are
drawn in the color of the atoms they connect, and can have different
line widths. Bond order indicators are drawn in the same way that
they are for the <em>cylinder</em> display style.
</dl>
</dd>
<dt>vdw <em>number</em> <u>selection</u><dt>
<dd>Change the vdW radius of the specifed atoms. Note that the number
is an absolute value rather than a scale factor. This is sometimes
inconvenient and will hopefully be addressed in a future version.
<dt>ball_radius <em>number</em> <u>selection</u><dt>
<dd>Change the radius of the balls that are used when an atom is
displayed in ball-and-stick style. Again this is an absolute value.
<dt>stick_radius <em>number</em> <u>selection</u><dt>
<dd>Change the radius of the sticks that are used when an atom is
displayed in ball-and-stick style. Again this is an absolute value.
<dt>cylinder_radius <em>number</em> <u>selection</u><dt>
<dd>Change the radius of the tubes that are drawn when an atom is
displayed in <em>cylinder</em> style. Note it is not possible to
change the radius or the offset of the bond order details in this
version of OpenAstexViewer.
<dt>bond_width {0/1/2} <u>selection</u><dt>
<dd>Change the width of the lines that are used to show bonds in
<em>lines</em> style. Note that it is not possible to change the
positioning of the bond order details in this version of OpenAstexViewer.
Width 0 is the thinnest line that can be drawn.
<dt>transparency {0-255} <u>selection</u><dt>
<dd>Change the transparency setting of <em>spheres</em> style for the
specified atoms. Note, 0 is completely transparent, 255 is completely
opaque. Transparent spheres can be rather slow to draw especially if
they are very big, so use them carefully.
</dl>
<h3><a href=#top name=coloring>Coloring Atoms</a></h3>
Atoms can be colored in a variety of ways, on the basis of selection
expressions or certain builtin coloring commands. Some of the builtin
coloring commands behave directly on those atoms that are selected
rather than taking a specific atom selection. This inconsistency will
be fixed in a future version of OpenAstexViewer.
<dl>
<dt>color <em>name</em> <u>selection</u><dt>
<dd>Change the color of the specified atoms. Appropriate values for
the name are the single word color names from the X11 set (e.g. red,
cyan, magenta, orange, peach etc.), or numeric values of the form
'#RRGGBB' (where RR, GG and BB are hexadecimal integers) or 'R,G,B'
(where R, G and B are integers in the range 0-255).
<dt>color_by_atom<dt>
<dd>Change the color of the currently selected atoms according to what
element type they are. Carbons are made green, oxygens red, nitrogens
blue, sulphurs yellow, phosphorus magenta, hydrogen white etc. There
is no way to change this default coloring behaviour. Alternative
color schemes can be created by putting sets of color selection
commands together.
<dt>color_by_chain<dt>
<dd>Change the color of the currently selected atoms according to
which chain they are in. The chains are assigned colors in order from
the sequence green, yellow, orange, blue and red. This list is not
changeable in the current version. More sophisticated schemes can be
built from groups of individual color commands.
<dt>color_by_bvalue<dt>
<dd>Change the color of the currently selected atoms according to
their crystallographic b-value (or b-factor). This command applies a
fixed set of b-value cutoffs to map into a ramp of eight colors from
blue, through white to red. The color bands are
<ul>
<li> 0.0 < b <= 10.0 [blue], 10.0 < b <= 15.0,
15.0 < b <= 20.0, 20.0 < b <= 25.0
<li> 25.0 < b <= 30.0, 30.0 < b <= 35.0,
35.0 < b <= 40.0, 40.0 < b [red]
</ul>
<dt>color_by_bvalue_range<dt>
<dd>Change the color of the currently selected atoms according to
their crystallographic b-value (or b-factor). This command applies a
fixed set of b-value cutoffs to map into a ramp of eight colors from
blue, through white to red. The color bands are split evenly between
the minimum and maximum b-value for the selected atoms.
<dt>color_by_rainbow <u>selection</u><dt>
<dd>Change the color of the specified atoms into a hue selected from
the standard rainbow of colors. It should be noted that the command
acts on the specified selection of atoms, rather than those atoms that
are selected. Specifying the selection as 'default' will cause this
command to behave in the same way as the other color by commands (the
'default' selection command returns what is currently selected or
everything if nothing is selected). The color ramp that is used goes
backwards from blue through the colors of the rainbow to red (blue,
green, yellow, orange, red). This color ramp is used as it is
convenient for showing the path of a polypeptide chain (from blue at
the N-terminus to red at the C-terminus). There is no way to specify
an alternate color ramp.
</dl>
<h3><a href=#top name=labels>Labels and Distances</a></h3>
A variety of label styles and distances can be shown in OpenAstexViewer.
Labels can be applied to sets of atoms using a syntax similar to that
found in the program molscript. Basically a format statement controls
which attributes of each atom are placed in that atoms label. Labels
can be displayed in a variety of font colors and sizes. Also, a 3d
font style is available. The command works as follows.
<dl>
<dt>label <em>format</em> <u>selection</u>
<dd>The command applies the label specified in <em>format</em> to the
atoms contained in <u>selection</u>. The <em>format</em> parameter is
a mixture of plain text, tokens controlling what attributes are
substituted and formatting information about what font size/color and
justification to use. The meaning of the attribute tokens is explained
in the table below, all attributes start with a % character.
<table border=0 cellpadding=3>
<tr><td nowrap><code>%a</code></td><td>The name of the atom.</td></tr>
<tr><td nowrap><code>%A</code></td><td>The name of the atom, with greek symbols for the
second character of aminoacid atoms.</td></tr>
<tr><td nowrap><code>%x</code></td><td>The <i>x</i> coordinate of the atom.</td></tr>
<tr><td nowrap><code>%y</code></td><td>The <i>y</i> coordinate of the atom.</td></tr>
<tr><td nowrap><code>%z</code></td><td>The <i>z</i> coordinate of the atom.</td></tr>
<tr><td nowrap><code>%b</code></td><td>The b-factor of the atom to one decimal place.</td></tr>
<tr><td nowrap><code>%B</code></td><td>The integer b-factor of the atom.</td></tr>
<tr><td nowrap><code>%o</code></td><td>The occupancy of the atom.</td></tr>
<tr><td nowrap><code>%q</code></td><td>The partial charge of the atom.</td></tr>
<tr><td nowrap><code>%i</code></td><td>The id of the atom.</td></tr>
<tr><td nowrap><code>%I</code></td><td>The insertion code of the atom.</td></tr>
<tr><td nowrap><code>%r</code></td><td>The residue number of the residue, followed by the
insertion code if it is non-blank.</td></tr>
<tr><td nowrap><code>%R</code></td><td>The name of the residue.</td></tr>
<tr><td nowrap><code>%f</code></td><td>The name of the residue with only
the first letter as a capital.</td></tr>
<tr><td nowrap><code>%c</code></td><td>The chain identifier.</td></tr>
<tr><td nowrap><code>%m</code></td><td>The molecule name.</td></tr>
<tr><td nowrap><code>%%</code></td><td>The % character.</td></tr>
<tr><td nowrap> </td><td>All other characters are included verbatim.</td></tr>
</table>
<p>Characters that are prefixed with a '\' will be drawn in the Symbol
font equivalent. This makes it easy to include Greek letters in
labels. The <code>%A</code> format statement will automatically
substitute lower case Greek letters for the second character of
aminoacid atom names e.g. <code>CA</code> becomes <code>C\a</code>.
<p>Additionally, the label may contain a prefix enclosed in <, >
characters. This contains instructions that will affect how the label
is displayed, justified etc. An example label with a prefix would be
<code>'<xoff=-0.2,3d=true>%a'</code>. The formatting statements that
can be included in the prefix are described below.
<table border=0 cellpadding=3>
<tr><td><code>xoff=</code><i>number</i></td><td>X-offset after transformation.</td></tr>
<tr><td><code>yoff=</code><i>number</i></td><td>Y-offset after transformation.</td></tr>
<tr><td><code>zoff=</code><i>number</i></td><td>Z-offset after transformation.</td></tr>
<tr><td><code>color=</code><i>name</i></td><td>Color of the label.</td></tr>
<tr><td><code>points=</code><i>integer</i></td><td>Size in points if using bitmap fonts.</td></tr>
<tr><td><code>3d=</code><i>boolean</i></td><td>Display label in 3d font.</td></tr>
<tr><td><code>size=</code><i>number</i></td><td>Size of characters for 3d font.</td></tr>
<tr><td><code>radius=</code><i>number</i></td><td>Radius of lines for 3d font.</td></tr>
<tr><td valign=top><code>justify=</code><i>string</i></td>
<td>
Justification style for label. Composed of the following characters (e.g. <code>bl</code> for
bottom left).
<table cellpadding=2>
<tr>
<td><code>l</code></td><td>Left justified</td>
<td><code>r</code></td><td>Right justified</td>
</tr>
<tr>
<td><code>b</code></td><td>Bottom justified</td>
<td><code>t</code></td><td>Top justified</td>
</tr>
<tr>
<td><code>v</code></td><td>Vertical center</td>
<td><code>h</code></td><td>Horizontal center</td>
</tr>
</table>
</td>
</tr>
</table>
<dt>label clear <u>selection</u>
<dd>Clear the labels for the atoms specified in <u>selection</u>.
<dt>distance -mode {pairs/nbpairs} -from { <u>sel1</u> }
-to { <u>sel2</u> } [options]
<dd>Generate a distance monitor from every atom in <u>sel1</u>
to every atom in <u>sel2</u> (distance monitors are not
generated for atoms in common between the two selections). <i>Note,
that the selection expressions must be enclosed in '{' and '}' when
used in these distance commands.</i> If mode is '<code>nbpairs</code>'
then only pairs that are not connected by 1, 2 or 3 bonds will be
shown. The distance creation is controlled by two additional
parameters which affect the maximum separation of atoms that will be
considered.
<dl>
<dt>-dmax <em>number</em> (default 5.0)
<dd>Atoms that are more than <em>number</em>Å apart do not get a
distance monitor.
<dt>-contact <em>number</em> (default 0.5)
<dd>Atoms that are more than the sum of their vdW radii plus
<em>number</em>Å apart do not get a distance monitor.
</dl>
<dt>distance -mode centroid -from { <u>sel1</u> }
-to { <u>sel2</u> } [options]
<dd>Generate a distance monitor from the centroid of the atoms in
<u>sel1</u> to the centroid of the atoms in
<u>sel2</u>. <i>Note, that the selection expressions must be
enclosed in '{' and '}' when used in these distance commands.</i>
<dt>distance -delete <em>pattern</em>
<dd>Remove distance monitors whose name matches <em>pattern</em>.
</dl>
The appearance of the distance monitors is controlled by the additional
options.
<dl>
<dt>-radius <em>number</em> (Default -1.0)
<dd>The radius of the line that represents the monitor. Negative
numbers are lines of various thickness, positive numbers indicate a
cylinder.
<dt>-on <em>number</em> (Default 0.2)
<dd>The length of the dash in the distance monitors.
<dt>-off <em>number</em> (Default 0.2)
<dd>The length of the gap between dashes in the distance monitors.
<dt>-color <em>color</em> (Default white)
<dd>The color of the distance monitor.
<dt>-format <em>string</em> (Default "%.2fA")
<dd>The format string that controls the label of the distance
monitor. The current distance is substituted for any floating point
format specifier.
<dt>-labelcolor <em>color</em> (Default white)
<dd>The color of the string that is shown by the distance monitor.
<dt>-name <em>string</em> (Default null)
<dd>The name of the distance monitor.
</dl>
<p>The command <code>astex.MouseTracker</code> can be used to add
labelling options that occur when the mouse is moved over atoms, or to
change the behaviour of clicking on atoms.
<dl>
<dt>-mouseover <code>format</code>
<dd>Generate a label for atoms as the mouse is moved over them.
<dt>-mouseover null
<dd>Turn off the mouseover labelling of atoms.
<dt>-onclick <code>format</code>
<dd>Generate a label for atoms as they are clicked.
<dt>-onclick null
<dd>Turn off the onclick labelling of atoms.
</dl>
<p>Additionally the format string can contain characters enclosed in `
characters. This is reminiscent of the unix ` syntax, which runs the
command between the quotes and puts the output there. In this case the
string between the quotes is treated as a url and the contents are
placed in the appropriate place. The url replacement is done after the
substitution of format characters so attributes of atoms can be passed
to urls. This allows additional data to be looked up and placed in the
label strings.
<p>e.g. the following could be used to lookup a kinase name that
corresponds to the id of the atom.
<pre>
astex.MouseTracker -mouseover \
'kinase `http://path/to/cgi/lookup_kinase.cgi?id=%i`'
</pre>
<h3><a href=#top name=view>Controlling the View</a></h3>
The view that is shown in the graphics window is controlled by several
parameters. These are the rotation matrix for the current orientation,
the radius of the view in world coordinates (which controls the scale,
but seems more convenient this way), the position of the forward and
back clipping planes and the position that we are looking at. The
following combination of commands are used for manipulating the
view. Note that the view matrix only controls the rotation part of the
view, it does not control the scale or the view point, these are
specified separately.
<dl>
</dd>
<dt>center <em>number</em> <em>number</em> <em>number</em><dt>
<dd>Change the position that the renderer is centered on. It does not
change the orientation, the radius of the view or the position of the
clipping planes. The units for the three numbers are Å's.
<dt>radius <em>number</em><dt>
<dd>Change the radius (width) of the view. This is in effect the
equivalent of scaling the view. It doesn't change the orientation. The
units are Å's.
<dt>matrix<em><br>
x00 x01 x02 x03<br>
x10 x11 x12 x13<br>
x20 x21 x22 x23<br>
x30 x31 x32 x33</em><dt>
<dd>Change the view matrix. Only the components <em>x00, x01, x02,
x10, x11, x12, x20, x21</em> and <em>x22</em> are used and should
correspond to a rotation matrix. Currently you must specify all 16
numbers for the syntax of the command to be correct.
<dt>clip <em>number</em> <em>number</em><dt>
<dd>Set the position of the clipping planes. The first number controls
the position of the front clipping plane and the second number
controls the position of the back clipping plane. The units are
Å's.
<dt>center <u>selection</u><dt>
<dd>Set the center, radius and clipping planes so that the specified
atoms are visible. It does not change the view matrix. This is a
convenient way for centering on a particular subset of atoms all in
one go.
<dt>view [options]
<dd>Control various aspects of the overall graphics view. Some
settings also control the default values that are used when generating
offscreen images for movies, or saving images. The options that can be
set are described below.
<dl>
<dt>-defaultwidth <em>number</em> (default 400)
<dd>The default width of image that is generated when saving an image.
Can be overridden at image creation time.
<dt>-defaultheight <em>number</em> (default 300)
<dd>The default height of image that is generated when saving an image.
Can be overridden at image creation time.
<dt>-defaultsample <em>number</em> (default 1)
<dd>The default supersampling for an offscreen image. This causes the
image to be rendered at <em>number</em>x<em>number</em> samples per
pixel and so large numbers use a lot of memory. A value of 2 causes
acceptable antialiasing for most images.
<dt>-defaultcompress <em>boolean</em> (default <em>false</em>)
<dd>Controls whether saved images are compressed using gzip. As only
Windows bitmap files (.bmp) can be saved this is useful, as it will
typically compress images by a factor of five.
<dt>-defaultimage <em>string</em> (default "movie/image_%04d.bmp")
<dd>Specifies the default filename for movies. The frame number is
substituted into the string using the format specification. This can
be changed to allow for a variety of different movie filename
conventions.
<dt>-writeimage <em>string</em> (no default)
<dd>Writes the current view to the specified file. If the filename is
'default' then all of the defaults that are in effect are used to
control the size/quality of the image. This command provides the
mechanism to write out the screen image e.g.
<pre>
view -writeimage 'screen.bmp';
</pre>
<dt>-width <em>number</em>
<dd>The width of image that is generated when saving an image.
Can be overridden at image creation time.
<dt>-height <em>number</em>
<dd>The height of image that is generated when saving an image.
Can be overridden at image creation time.
<dt>-sample <em>number</em>
<dd>The supersampling for an offscreen image. This causes the image to
be rendered at <em>number</em>x<em>number</em> samples per pixel and
so large numbers use a lot of memory. A value of 2 causes acceptable
antialiasing for most images.
<dt>-compress <em>boolean</em>
<dd>Controls whether saved images are compressed using gzip. As only
Windows bitmap files (.bmp) can be saved this is useful, as it will
typically compress images by a factor of five.
</dl>
<p>The following options control the quality/appearance of the
onscreen image.
<dl>
<dt>-background <em>color</em>
<dd>Change the color of the background. Only solid colors are
supported. Most objects automatically fog to the background
color. Positioning the rear clipping plane will adjust the degree of
fog.
<dt>-gradient <em>boolean</em>
<dd>Make the background blend from one color at the top
to another at the bottom. The colors are specified by
-gradienttop and -gradientbottom (see below).
<dt>-gradienttop <em>color</em>
<dd>Change the gradient color for the top of the background.
Objects will still be fogged by the current background color
(so make this a blend between the current top and bottom gradient
color <i>[maybe this should be done automatically]</i>.
<dt>-gradientbottom <em>color</em>
<dd>Change the gradient color for the bottom of the background.
Objects will still be fogged by the current background color
(so make this a blend between the current top and bottom gradient
color <i>[maybe this should be done automatically]</i>.
<dt>-antialias <em>boolean</em>
<dd>Should the onscreen image be antialiased. This uses a 2x2 pixel
sampling antialiasing procedure.
<dt>-wuantialias <em>boolean</em>
<dd>Draw antialiased lines using the Wu algorithm. This makes nice looking
lines but doesn't interact perfectly with other object types in the scene.
In particular there will artifacts where lines cross shaded objects. Also
the lines only really work with a dark background as they blend colors in the
background to achieve the smooth effect. This means that the lines will disappear
on light backgrounds.
<dt>-realspheres <em>boolean</em>
<dd>If set to true, analytical spheres are used rather than
bitmaps. The analytical spheres are slower but give better images and
allow for transparency.
<dt>-shadows <em>boolean</em>
<dd>If set to true, shadows are cast on objects. Only the first light
source casts a shadow. Shadow casting slows down rendering quite a
bit, but simple scenes (e.g. made entirely of spheres) will still
render almost interactively (the 1323 aminoacid atoms of PDB code
621p, will do about 1 frame/second on a 1GHz PIII 640x480). There are
some situations that don't render quite properly. All objects cast
shadows as if they were opaque, which means that lines inside a
surface all look like they are in the dark. Cylinders inside
transparent spheres don't always render correctly.
<dt>-solidfonts <em>boolean</em>
<dd>If set to true, text is rendered using the solid fonts
(constructed using the Hershey font set). They will always face
towards the viewer and will cast shadows when necessary.
<dt>-lightingmodel {normal/cartoon}
<dd>If set to 'cartoon' the lighting model is adapted to produce
pictures similar to David S. Goodsell's <a
href="http://www.rcsb.org/pdb/static.do?p=education_discussion/molecule_of_the_month/index.html" target=_blank>Molecule
of the Month</a> pictures at the RCSB website. These can be
manipulated in real time and will cast shadows in a similar fashion.
<dt>-ambient {0-255}
<dd>This provides the ambient contribution to the lighting model. The
value is used for the red, green and blue contributions. This should
arguably be part of the light commands which are described next.
</dl>
<dt>light {0-7} [options]
<dd>Specify information about the position of one of the lights.
Eight lights are supported. The lighting model only really supports
white lights all of which must be point lights at infinity. The
supported options are.
<dl>
<dt>-x <em>number</em>
<dt>-y <em>number</em>
<dt>-z <em>number</em>
<dd>The direction of the light. The components are normalised, and
all three should be specified in the same light command.
<dt>-on <em>boolean</em>
<dd>Set whether the light is on or off. Only light 0 casts shadows, so
if this light is off there will be no shadows.
<dt>-specularint <em>number</em>
<dd>Set the specular highlight intensity for this light.
<dt>-diffuseint <em>number</em>
<dd>Set the diffuse intensity for this light.
<dt>-phongpower <em>integer</em>
<dd>Set the Phong exponent power for this light. Values from 0 to 100
are useful.
</dl>
</dl>
<h3><a href=#top name=objects>Creating Graphical Objects</a></h3>
In addition to the atom based display styles, OpenAstexViewer allows the
creation of a number of different represenations in graphical
objects. These objects exist independently of all the atoms and
molecules. This is sometimes a useful aid and other times it can be a
little inconvenient that a particular object does not disappear when
the group of atoms it represents is turned off.
<h4>Protein Schematics (Cartoons)</h4>
<dl>
<dt>schematic -name <em>object</em> [options] <u>selection</u><dt>
<dd>This command uses the new style OpenAstexViewer command syntax which
makes it much simpler to implement new commands. Argument names are
prefixed by a '-' and followed by the appropriate values.
<p>The command makes a graphical object which contains a schematic
cartoon of the selection. The schematic is called <em>object</em> and
this name can be used to modify the object later on. The schematics
that are generated look a little like those that are produced by the
program MolScript. Helices are shown as a wound ribbon, strands are
shown as arrows and coil is shown as a narrow tube. The schematic
takes its color from the atoms when they are created. The secondary
structure that is currently assigned is used to generate the
schematic. This can be assigned by the command
<code>secstruc</code>. <em>[Currently it is not possible to read the
secondary structure definitions from a PDB file, hopefully this will
be changed in the future]</em>.
<p>Currently it is only possible to generate cartoons for aminoacid
residues, and these residues must define the main backbone atoms. A
future version will implement a different scheme that allows cartoons
to be constructed from Cα coordinates alone, or that can create
cartoons for DNA structures.
<p>The appearance of the schematic can be controlled by a large number
of options which are outlined below. The options are grouped together
according to which part of the schematic structure they affect:
<dl>
<dt>-name <em>object</em></dt>
<dd>As described above this supplies the name of the generated
graphical object.
<dt>-quality {1/2/3/4/5} (default 1)</dt>
<dd>This controls the overall quality of the schematic. The number of
interpolation points and the number of points on the perimeter of the
objects are multiplied by this number. Quality 1 has less triangles
and will render fastest, quality 5 is the best.
<dt>-colorbyss <em>boolean</em> (default false)</dt>
<dd>Control how the schematic is colored. If colorbyss is
true then each type of secondary structure is colored
differently (typcially red for ribbon, yellow for arrow
and white for tube). If it is false then the secondary
structure colors are taken from the residues that
are used in its construction.
<dt>-alltube <em>boolean</em> (default false)</dt>
<dd>If this option is set a curved tube is created for the entire
polypeptide chain. This passes through the Cα atoms.
<dt>-ribbontangent <em>number</em> (default 5.0)</dt>
<dd>Controls the length of the tangent vectors for the hermite spline
that smooths the helical ribbons.
<dt>-ribbonpoints <em>number</em> (default 8*quality)</dt>
<dd>Controls the number of points that are interpolated for a
particular residue in a helix ribbon.
<dt>-ribbonwidth <em>number</em> (default 2.2)</dt>
<dd>The width across the peptide plane of the helical ribbon.
<dt>-ribbonminwidth <em>number</em> (default 0.4)</dt>
<dd>The width across the peptide plane of the helical ribbon at each
end. The ribbon tapers to/from this value for the last/first residue
of each helical ribbon.
<dt>-ribbonthickness <em>number</em> (default 0.15)</dt>
<dd>The thickness of the helical ribbon perpendicular to the plane of
the helix.
<dt>-ribboncylinders <em>boolean</em> (default true)</dt>
<dd>If the ribbon is being drawn in a square cross section this option
controls whether or not cylinders are drawn along the edge of
ribbon. It should be noted that this will prevent the schematic object
being truly transparent, as the cylinders cannot be made
transparent. If you want a transparent schematic it is best to not use
the ribbon cylinders.
<dt>-ribbonellipse <em>boolean</em> (default false)</dt>
<dd>Controls whether the helical ribbons are drawn with an elliptical
or rectangular cross section. The elliptical ones shade nicely but use
more triangles. If elliptical cross section ribbons are generated
then ribbon cylinders are not produced.
<dt>-ribbonellipsepoints <em>number</em> (default 12*quality)</dt>
<dd>Controls the number of points that approximate the elliptical
cross section of the helix if elliptical ribbons are generated.
<dt>-ribboncolor <em>color</em> (default red)</dt>
<dd>The color of ribbon sections if <code>-colorbyss</code>
is set to true.
<dt>-tubesmoothing <em>number</em> (default 1)</dt>
<dd>The number of smoothing iterations that are applied to guide
points in coil regions. If the option <code>-alltube</code> is
specified to generate a cylindrical tube for the atoms, then no
tubesmoothing is performed independent of the value of this parameter.
<dt>-tubepoints <em>number</em> (default 4*quality)</dt>
<dd>The number of points that are interpolated for each residue in a
coil tube.
<dt>-tubeperimeter <em>number</em> (default 8*quality)</dt>
<dd>The number of points that are used to make the circular cross
section of a coil tube.
<dt>-tubetangent <em>number</em> (default 2.0)</dt>
<dd>The length of the tangent vector used for the hermite spline
interpolation in coil tubes.
<dt>-tuberadius <em>number</em> (default 0.2)</dt>
<dd>The radius of the coil tubes.
<dt>-tubetaperradius <em>number</em> (default 0.1)</dt>
<dd>The radius of the coil tubes at each end. The tube radius is
tapered smoothly between the main radius and this value.