JPRED-2 Add alscript to the Git repository
[jpred.git] / sources / alscript / examples / ipns.als
1 #  
2 #  This is the alscript command file used to create the figure
3 #  published in:  Roach P. L. et al (1995), Nature (June)
4 #  
5 #  The figure shows Isopenicillin N synthase with homologues
6 #  secondary structure and other information.  It makes use
7 #  of many features of alscript 2.0
8 #
9 #  Comments in the file all start with the # sign
10 #
11 #
12 # define the alignment block file
13 BLOCK_FILE ipns.blc
14 # define the output file name
15 OUTPUT_FILE ipns.ps
16 # select portrait mode - longest paper side is vertical
17 PORTRAIT
18 # select point size for characters - this can be any number.
19 POINTSIZE 6.5 
20 #
21 # Define fonts that we will use in the alignment. You give each font 
22 # a unique number. The names of the fonts are standard PostScript 
23 # font names.
24 #
25 # This one means call Helvetica at the Default pointsize, font 0
26 DEFINE_FONT 0 Helvetica DEFAULT
27 # This means call Helvetica-Oblique at 70% of the default point size, font 1
28 DEFINE_FONT 1 Helvetica-Oblique REL 0.70
29 DEFINE_FONT 2 Helvetica-Bold DEFAULT
30 define_font 5 Symbol REL 1.2
31 define_font 6 Helvetica REL 0.7
32 #
33 # Colour definitions
34
35 # Define the colours that we will use in the alignment.  Each colour is given
36 # a number by which it is referred to later.  The three numbers following
37 # each colour are red,green,blue intensities.
38 #
39 # e.g. this defines colour number 1 to be red (1,0,0).
40 DEFINE_COLOUR 1 1 0 0
41 #DEFINE_COLOUR 2 0.8 1 0.8
42 DEFINE_COLOUR 2 1 1 0
43 DEFINE_COLOUR 3 0 0 1
44 DEFINE_COLOUR 4 1 1 1 
45 DEFINE_COLOUR 5 1 1 1
46 DEFINE_COLOUR 6 1 0.5 0
47 DEFINE_COLOUR 7 1 0   1
48 DEFINE_COLOUR 8 0 0   0
49 DEFINE_COLOUR 9 1 1   1
50 define_colour 10 0 1 0
51 define_colour 11 0 0 0
52 #
53 # The add_seq command adds extra space  to the alignment you have read in.
54
55 #
56 # Here we are adding space for four more lines after sequence number 8.
57 add_seq 8 4
58 #
59 # This means don't number the sequences 
60 no_numbers
61 #
62 # Alter the width of the space for identifiers at the lhs of the plot.  This
63 # must be set by trial and error - 10 is the default.
64 ident_width 6
65 #
66 # Only print sequence identifiers on the first line of a multi-line/page 
67 # alignment plot.
68 id_only_on_first_line
69 #
70 # This is some fiddling to reduce the default vertical spacing between 
71 # sequence lines.  We did this to improve the appearance of the alignment
72 # in a single column of Nature.  Other features of the display can 
73 # be modified in a similar way - e.g. x_space_factor.
74 y_space_factor 0.05
75 #
76 # commands above the SETUP are about the overall layout etc.  Commands
77 # after, are giving specific boxing/shading/colouring etc.
78 #
79 SETUP
80 #
81 # Calcluate conservation values for the complete alignment.  Conservation
82 # values range from 0-10 where 10 is an identity.  Values above 5 show
83 # increasing similarities in physico-chemical properties.  Having calculated
84 # conservation values, we can then colour the plot to highlight conserved
85 # positions.
86 #
87 calcons 1 1 424 8
88
89 # set mask for conserved position better than 5
90 #
91 # this clears the MASK array of all previous settings
92 mask SETUP
93 # this masks all columns of the alignment for which the conservation
94 # is > 5.
95 mask CONSERVATION ALL 5
96 #
97 # Now we box the masked positions and colour the 
98 # text backgrounds yellow (colour 2).  Note that this operation could
99 # be restricted to a subset of the alignment rather than the whole thing.
100 mask BOX 1 1 424 8
101 #
102 # The SCOL command colours the backgrounds of the character.  The CCOL
103 # command colours the character itself.
104 mask SCOL 1 1 424 8 2
105 #
106 # This resets the MASK commands ready for another operation.  If you don't
107 # reset, then subsequent mask commands are ADDED to the existing mask
108 #
109 mask RESET
110 #
111 #now do thw same for identities, only this time in red
112 #with white lettering
113 mask CONSERVATION ALL 10
114 mask SCOL 1 1 424 8 1
115 mask CCOL 1 1 424 8 99
116 mask FONT 1 1 424 8 2
117 mask RESET
118 #
119 # sub_id allows the identifier to be modified.  At present it is not possible
120 # to mix fonts within an ID, but the ID_FONT command can be used to modify the
121 # font used for individual IDs.
122 sub_id 1 "ACCO"
123 sub_id 2 "F3OH"
124 sub_id 3 "H6H "
125 sub_id 4 "FOLS"
126 sub_id 5 "GC20"
127 sub_id 6 "DAOCS"
128 sub_id 7 "DAOC/DACS "
129 sub_id 8 "IPNS"
130 #
131 # These are the secondary structure definitions.  They were entered by 
132 # hand from an analysis of the IPNS structure.
133 #
134 # Secondary structure
135 #
136 # Set Numbering relative to IPNS
137
138 # The x values (sequence position) of any commands that follow a 
139 # relative_to command will be translated into absolute alignment position.
140 # This takes account of gaps in the alignment.
141 relative_to 8
142 #
143 # Set the font for the line that will say alpha1, beta2 etc to Symbol font.
144 # Region commands operate on a region of the alignment - they usually expect
145 # four numbers to define the region - the numbers are x,y,x1,y1 where y and y1
146 # are the sequences and x and x1 are the residue positions.
147 font_region 1 11 331 11 5
148 #
149 #colour all secondary structures black  (colour 11)
150
151 colour_text_region 1 10 331 10 11
152 #
153 # Now draw all the helices and strands and label and colour them.
154 #
155 # For example, Tell ALSCRIPT to draw a strand from 11 to 13 of sequence 10
156 strand  11  10  13
157 #  Now write the text b1 (will be a Greek b because of the 
158 #  font_region command above).
159         text 12 11 "b1"
160 helix   15  10  18
161         text 16 11 "a1"
162 helix   22  10  37
163         text 30 11 "a2"
164 strand  41  10  45
165         text 43 11 "b2"
166 helix   51  10  64
167         text 57 11 "a3"
168 helix   67  10  73
169         text 70 11 "a4"
170 strand  89  10  91
171         text 90 11 "b3"
172 strand 101  10 105
173         text 103 11 "b4"
174 helix  115  10 118
175         text 116 11 "a5"
176 helix  138  10 163
177         text 151 11 "a6"
178 helix  172  10 174
179         text 173 11 "a7"
180 #
181 #barrel strand 1
182 strand 183  10 189
183 #       set the colour to green for this strand.
184         colour_text_region 183 10 189 10 10
185         text 186 11 "b5"
186 #
187 helix  197  10 199
188         text 198 11 "a8"
189 strand 201  10 202
190         text 201 11 "b6"
191 strand 208  10 209
192         text 208 11 "b7"
193 #
194 #barrel strands 2-6
195 strand 210  10 214
196         text 212 11 "b8"
197         colour_text_region 210 10 214 10 10
198 strand 220  10 225
199         text 222 11 "b9"
200         colour_text_region 220 10 225 10 10
201 strand 231  10 235
202         text 233 11 "b10"
203         colour_text_region 231 10 235 10 10
204 strand 238  10 241
205         text 239 11 "b11"
206         colour_text_region 238 10 241 10 10
207 strand 249  10 253
208         text 250 11 "b12"
209         colour_text_region 249 10 253 10 10
210 #
211 helix  255  10 260
212         text 257 11 "a9"
213 #
214 #
215 #barrel strands 7-8
216 strand 270  10 273
217         text 271 11 "b13"
218         colour_text_region 270 10 273 10 10
219 strand 279  10 286
220         text 282 11 "b14"
221         colour_text_region 279 10 286 10 10
222 #
223 #
224 #
225 strand 293  10 294
226         text 293 11 "b15"
227 strand 311  10 312
228         text 311 11 "b16"
229 helix  313  10 323
230         text 317 11 "a10"
231 #
232 #Now add arrows for the residues within 8A of the Mn
233 #
234 # The TEXT command normally just writes out the specified text
235 # at the specified position.  However, special TEXT objects
236 # exist.  These all start with the @ symbol.
237 #
238 colour_text_region 214 12 214 12 1
239 #
240 # This draws a filled up arrow at position 214,12.
241 text 214 12 "@fuparrow"
242 colour_text_region 216 12 216 12 1
243 text 216 12 "@fuparrow"
244 colour_text_region 270 12 270 12 1
245 text 270 12 "@fuparrow"
246 colour_text_region 330 12 330 12 1
247 text 330 12 "@fuparrow"
248 #
249 text  41 12 "@fuparrow"
250 text 252 12 "@fuparrow"
251 text 221 12 "@fuparrow"
252 text 187 12 "@fuparrow"
253 text 285 12 "@fuparrow"
254 text 223 12 "@fuparrow"
255 text 272 12 "@fuparrow"
256 text 218 12 "@fuparrow"
257 text 231 12 "@fuparrow"
258 #
259 #
260 # Now set the sequence numbering back to alignment positions.
261 relative_to 0
262 #
263 #
264 # From here to the end of the file was created by the alsnum program
265 # alsnum creates text commands for numbering a plot relative to a 
266 # specific sequence, rather than the alignment numbers that are 
267 # normally shown.  Please see the ALSCRIPT manual for further details.
268 #
269 #
270 # Text commands created for numbering
271 # Sequence Number: 8
272 # Starting Number: 1
273 # Interval:        10
274 # Position:        9
275 TEXT 53 9 "10"
276 TEXT 65 9 "20"
277 TEXT 78 9 "30"
278 TEXT 88 9 "40"
279 TEXT 101 9 "50"
280 TEXT 111 9 "60"
281 TEXT 121 9 "70"
282 TEXT 131 9 "80"
283 TEXT 141 9 "90"
284 TEXT 151 9 "100"
285 TEXT 161 9 "110"
286 TEXT 171 9 "120"
287 TEXT 181 9 "130"
288 TEXT 191 9 "140"
289 TEXT 201 9 "150"
290 TEXT 211 9 "160"
291 TEXT 221 9 "170"
292 TEXT 231 9 "180"
293 TEXT 241 9 "190"
294 TEXT 251 9 "200"
295 TEXT 261 9 "210"
296 TEXT 271 9 "220"
297 TEXT 281 9 "230"
298 TEXT 297 9 "240"
299 TEXT 307 9 "250"
300 TEXT 317 9 "260"
301 TEXT 327 9 "270"
302 TEXT 343 9 "280"
303 TEXT 353 9 "290"
304 TEXT 363 9 "300"
305 TEXT 378 9 "310"
306 TEXT 388 9 "320"
307 TEXT 398 9 "330"