Debian Codegraph @

hmmer/easel/miniapps/esl-ssdraw.itest.pl

raw
1 #! /usr/bin/perl
2
3 # Integrated test of the esl-ssdraw miniapp.
4 #
5 # Usage: ./esl-ssdraw.itest.pl <esl-ssdraw binary> <postscript template file> <alignment file> <tmpfile prefix>
6 # Example: ./esl-ssdraw.itest.pl ./esl-ssdraw ../testsuite/trna-ssdraw.ps ../testsuite/trna-5.stk foo
7 #
8 # EPN, Tue Feb 9 12:22:29 2010
9
10 $eslssdraw = shift;
11 $templatefile = shift;
12 $alifile = shift;
13 $tmppfx = shift;
14
15 if (! -x "$eslssdraw") { die "FAIL: didn't find esl-ssdraw binary $eslssdraw"; }
16
17 open(MASKFILE, ">$tmppfx.mask1") || die "FAIL: couldn't open $tmppfx.mask1 for writing maskfile";
18 print MASKFILE << "EOF";
19 10010110101101111111111010101111111010101011010001100010101110101010101
20 EOF
21 close MASKFILE;
22
23 open(MASKFILE, ">$tmppfx.mask2") || die "FAIL: couldn't open $tmppfx.mask2 for writing maskfile";
24 print MASKFILE << "EOF";
25 11011011111110101011111111111010101010100000000001001010011101010101010
26 EOF
27 close MASKFILE;
28
29 open(IFILE, ">$tmppfx.ifile") || die "FAIL: couldn't open $tmppfx.ifile for writing insert file";
30 print IFILE << "EOF";
31 tRNA 71
32 tRNA1 73 1 71 16 17 1 45 47 1
33 tRNA2 72 1 71 19 20 1
34 tRNA3 72 1 71 19 20 1
35 tRNA4 72 1 71 45 46 1
36 tRNA5 64 5 71 16 13 1 45 43 1
37 //
38 EOF
39 close IFILE;
40
41 open(DFILE, ">$tmppfx.dfile") || die "FAIL: couldn't open $tmppfx.efile for writing draw file";
42 print DFILE << "EOF";
43 Example of using --dfile to specify colors
44 These numbers mean what?
45 0.0 0.6 0.7 0.8 0.9 0.95 1.0
46 0.560
47 0.730
48 0.210
49 0.120
50 0.910
51 1.000
52 0.000
53 0.302
54 0.121
55 1.000
56 0.998
57 0.353
58 0.5
59 0.342
60 0.560
61 0.730
62 0.210
63 0.120
64 0.910
65 1.000
66 0.000
67 0.302
68 0.121
69 1.000
70 0.998
71 0.353
72 0.5
73 0.342
74 0.560
75 0.730
76 0.210
77 0.120
78 0.910
79 1.000
80 0.000
81 0.302
82 0.121
83 1.000
84 0.998
85 0.353
86 0.5
87 0.342
88 0.560
89 0.730
90 0.210
91 0.120
92 0.910
93 1.000
94 0.000
95 0.302
96 0.121
97 1.000
98 0.998
99 0.353
100 0.5
101 0.342
102 0.560
103 0.730
104 0.210
105 0.120
106 0.910
107 1.000
108 0.000
109 0.302
110 0.121
111 1.000
112 0.998
113 0.353
114 0.5
115 0.342
116 0.342
117 //
118 Another example of using --dfile to specify colors
119 Meaning is unknown
120 0.0 0.1 0.2 0.3 0.4 0.5 1.0
121 0.560
122 0.730
123 0.210
124 0.120
125 0.910
126 1.000
127 0.000
128 0.302
129 0.121
130 1.000
131 0.998
132 0.353
133 0.5
134 0.342
135 0.560
136 0.730
137 0.210
138 0.120
139 0.910
140 1.000
141 0.000
142 0.302
143 0.121
144 1.000
145 0.998
146 0.353
147 0.5
148 0.342
149 0.560
150 0.730
151 0.210
152 0.120
153 0.910
154 1.000
155 0.000
156 0.302
157 0.121
158 1.000
159 0.998
160 0.353
161 0.5
162 0.342
163 0.560
164 0.730
165 0.210
166 0.120
167 0.910
168 1.000
169 0.000
170 0.302
171 0.121
172 1.000
173 0.998
174 0.353
175 0.5
176 0.342
177 0.560
178 0.730
179 0.210
180 0.120
181 0.910
182 1.000
183 0.000
184 0.302
185 0.121
186 1.000
187 0.998
188 0.353
189 0.5
190 0.342
191 0.342
192 //
193 EOF
194 close DFILE;
195
196 open(EFILE, ">$tmppfx.efile") || die "FAIL: couldn't open $tmppfx.efile for writing draw file";
197 print EFILE << "EOF";
198 0.228 0.636 0.044 0.680
199 0.470 0.564 0.932 0.933
200 0.034 0.171 0.204 0.137
201 0.471 0.725 0.013 0.246
202 0.414 0.111 0.478 0.329
203 0.947 0.110 0.870 0.230
204 0.789 0.964 0.649 0.174
205 0.991 0.362 0.028 0.634
206 0.977 0.838 0.265 0.046
207 0.024 0.806 0.148 0.647
208 0.235 0.891 0.594 0.694
209 0.799 0.366 0.073 0.013
210 0.914 0.393 0.793 0.826
211 0.054 0.786 0.486 0.386
212 0.794 0.360 0.061 0.304
213 0.070 0.866 0.646 0.961
214 0.217 0.462 0.220 0.608
215 0.446 0.715 0.516 0.287
216 0.546 0.924 0.456 0.468
217 0.438 0.035 0.613 0.031
218 0.321 0.437 0.935 0.336
219 0.101 0.275 0.089 0.410
220 0.714 0.681 0.622 0.676
221 0.315 0.079 0.850 0.917
222 0.524 0.897 0.908 0.902
223 0.460 0.826 0.039 0.979
224 0.041 0.130 0.599 0.122
225 0.181 0.234 0.813 0.157
226 0.514 0.145 0.386 0.801
227 0.183 0.929 0.161 0.588
228 0.852 0.746 0.189 0.836
229 0.455 0.580 0.439 0.373
230 0.473 0.212 0.655 0.536
231 0.678 0.744 0.434 0.793
232 0.844 0.816 0.646 0.459
233 0.806 0.807 0.002 0.304
234 0.395 0.972 0.800 0.119
235 0.981 0.492 0.752 0.463
236 0.926 0.327 0.066 0.099
237 0.029 0.252 0.846 0.134
238 0.571 0.306 0.698 0.213
239 0.711 0.470 0.680 0.522
240 0.639 0.930 0.336 0.968
241 0.839 0.824 0.118 0.877
242 0.399 0.449 0.675 0.740
243 0.105 0.341 0.014 0.971
244 0.965 0.277 0.691 0.732
245 0.198 0.648 0.903 0.804
246 0.958 0.939 0.561 0.028
247 0.359 0.665 0.162 0.298
248 0.581 0.260 0.237 0.773
249 0.042 0.540 0.410 0.190
250 0.013 0.841 0.068 0.796
251 0.763 0.904 0.601 0.677
252 0.849 0.928 0.010 0.797
253 0.517 0.658 0.094 0.870
254 0.378 0.132 0.736 0.559
255 0.385 0.358 0.951 0.566
256 0.100 0.141 0.397 0.492
257 0.091 0.913 0.870 0.351
258 0.819 0.429 0.862 0.267
259 0.263 0.777 0.427 0.602
260 0.005 0.225 0.023 0.157
261 0.154 0.009 0.800 0.514
262 0.915 0.456 0.162 0.235
263 0.374 0.595 0.678 0.901
264 0.099 0.163 0.410 0.515
265 0.969 0.191 0.912 0.117
266 0.557 0.919 0.084 0.690
267 0.846 0.032 0.300 0.158
268 0.736 0.131 0.007 0.138
269 //
270 0.0 0.0 0.0 0.0 T
271 0.0 0.0 0.0 0.0 h
272 0.0 0.0 0.0 0.0 i
273 0.0 0.0 0.0 0.0 s
274 0.0 0.0 0.0 0.0 i
275 0.0 0.0 0.0 0.0 s
276 0.0 0.0 0.0 0.0 a
277 0.0 0.0 0.0 0.0 t
278 0.0 0.0 0.0 0.0 R
279 0.0 0.0 0.0 0.0 N
280 0.0 0.0 0.0 0.0 A
281 0.0 0.0 0.0 0.0 T
282 0.0 0.0 0.0 0.0 h
283 0.0 0.0 0.0 0.0 i
284 0.0 0.0 0.0 0.0 s
285 0.0 0.0 0.0 0.0 i
286 0.0 0.0 0.0 0.0 s
287 0.0 0.0 0.0 0.0 a
288 0.0 0.0 0.0 0.0 t
289 0.0 0.0 0.0 0.0 R
290 0.0 0.0 0.0 0.0 N
291 0.0 0.0 0.0 0.0 A
292 0.0 0.0 0.0 0.0 T
293 0.0 0.0 0.0 0.0 h
294 0.0 0.0 0.0 0.0 i
295 0.0 0.0 0.0 0.0 s
296 0.0 0.0 0.0 0.0 i
297 0.0 0.0 0.0 0.0 s
298 0.0 0.0 0.0 0.0 a
299 0.0 0.0 0.0 0.0 t
300 0.0 0.0 0.0 0.0 R
301 0.0 0.0 0.0 0.0 N
302 0.0 0.0 0.0 0.0 A
303 0.0 0.0 0.0 0.0 T
304 0.0 0.0 0.0 0.0 h
305 0.0 0.0 0.0 0.0 i
306 0.0 0.0 0.0 0.0 s
307 0.0 0.0 0.0 0.0 i
308 0.0 0.0 0.0 0.0 s
309 0.0 0.0 0.0 0.0 a
310 0.0 0.0 0.0 0.0 t
311 0.0 0.0 0.0 0.0 R
312 0.0 0.0 0.0 0.0 N
313 0.0 0.0 0.0 0.0 A
314 0.0 0.0 0.0 0.0 T
315 0.0 0.0 0.0 0.0 h
316 0.0 0.0 0.0 0.0 i
317 0.0 0.0 0.0 0.0 s
318 0.0 0.0 0.0 0.0 i
319 0.0 0.0 0.0 0.0 s
320 0.0 0.0 0.0 0.0 a
321 0.0 0.0 0.0 0.0 t
322 0.0 0.0 0.0 0.0 R
323 0.0 0.0 0.0 0.0 N
324 0.0 0.0 0.0 0.0 A
325 0.0 0.0 0.0 0.0 T
326 0.0 0.0 0.0 0.0 h
327 0.0 0.0 0.0 0.0 i
328 0.0 0.0 0.0 0.0 s
329 0.0 0.0 0.0 0.0 i
330 0.0 0.0 0.0 0.0 s
331 0.0 0.0 0.0 0.0 a
332 0.0 0.0 0.0 0.0 t
333 0.0 0.0 0.0 0.0 R
334 0.0 0.0 0.0 0.0 N
335 0.0 0.0 0.0 0.0 A
336 0.0 0.0 0.0 0.0 T
337 0.0 0.0 0.0 0.0 h
338 0.0 0.0 0.0 0.0 i
339 0.0 0.0 0.0 0.0 s
340 0.0 0.0 0.0 0.0 i
341 //
342 EOF
343 close EFILE;
344
345 $output = `$eslssdraw -h`;
346 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly"; }
347 if ($output !~ /Usage: esl-ssdraw/) { die "FAIL: help output not right"; }
348
349 # We do 2 runs of most tests, with and without --small
350 $smallA[0] = "";
351 $smallA[1] = "--small ";
352
353 # Note: these tests are less rigorous than similar ones for other miniapps because esl-ssdraw
354 # creates a postscript file and to test that it was created properly we'd really want to open
355 # it in a postscript viewer and look at it. Since we can't do that easily in an automated way,
356 # I simply check the postscript file for text that I know should be there.
357
358 for($pass = 0; $pass < 2; $pass++) {
359 $pass2write = $pass+1;
360
361 system("$eslssdraw $smallA[$pass] $alifile $templatefile $tmppfx.ps > /dev/null");
362 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
363 $output = `cat $tmppfx.ps`;
364 if($output !~ /\(tRNA 71 21\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
365 if($output !~ /\(\\\[0.800-1.200\\\)\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
366 if($output !~ /\(tRNA 71 21\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
367 if($output !~ /\%nucleotide 9\nnewpath\n.+0.00\d* 0.21\d* 1.00\d* 0.00\d* setcmykcolor/s) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
368
369 system("$eslssdraw $smallA[$pass] -d $alifile $templatefile $tmppfx.ps > /dev/null");
370 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
371 $output = `cat $tmppfx.ps`;
372 if($output !~ /\(tRNA 71 21\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
373 if($output !~ /\(\\\[0.800-1.200\\\)\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
374 if($output !~ /\(tRNA 71 21\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
375 if($output !~ /\%nucleotide 9\nnewpath\n.+0.00\d* 0.21\d* 1.00\d* 0.00\d* setcmykcolor/s) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
376
377 system("$eslssdraw $smallA[$pass] --prob $alifile $templatefile $tmppfx.ps > /dev/null");
378 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
379 $output = `cat $tmppfx.ps`;
380 if($output !~ /\(tRNA 71 21\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
381 if($output !~ /\(\\\[0.900-0.950\\\)\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
382 if($output !~ /\%nucleotide 18\nnewpath\n.+0.50\d* 0.00\d* 0.00\d* 0.50\d* setcmykcolor/s) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
383
384 system("$eslssdraw $smallA[$pass] --ifreq $alifile $templatefile $tmppfx.ps > /dev/null");
385 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
386 $output = `cat $tmppfx.ps`;
387 if($output !~ /\(tRNA 71 21\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
388 if($output !~ /\(\\\[0.500-1.000\\\]\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
389 if($output !~ /\%nucleotide 19\nnewpath\n.+0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.00\d* 0.63\d* 1.00\d* 0.00\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
390
391 system("$eslssdraw $smallA[$pass] --iavglen $alifile $templatefile $tmppfx.ps > /dev/null");
392 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
393 $output = `cat $tmppfx.ps`;
394 if($output !~ /\(tRNA 71 21\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
395 if($output !~ /\(>= 10\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
396
397 if($output !~ /\%nucleotide 19\nnewpath\n.+moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.92\d* 0.84\d* 0.00\d* 0.08\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
398
399 system("$eslssdraw $smallA[$pass] --dall $alifile $templatefile $tmppfx.ps > /dev/null");
400 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
401 $output = `cat $tmppfx.ps`;
402 if($output !~ /\(tRNA 71 21\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
403 if($output !~ /\(zero deletions\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
404 if($output !~ /\%nucleotide 1\nnewpath\n.+moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.42\d* 0.00\d* 1.00\d* 0.00\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
405
406 system("$eslssdraw $smallA[$pass] --dint $alifile $templatefile $tmppfx.ps > /dev/null");
407 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
408 $output = `cat $tmppfx.ps`;
409 if($output !~ /\(tRNA 71 21\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
410 if($output !~ /\(zero internal deletions\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
411 if($output !~ /\%nucleotide 1\nnewpath\n.+moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.00\d* 0.00\d* 0.00\d* 0.20\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
412
413 system("$eslssdraw $smallA[$pass] --mutinfo $alifile $templatefile $tmppfx.ps > /dev/null");
414 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
415 $output = `cat $tmppfx.ps`;
416 if($output !~ /\(tRNA 71 21\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
417 if($output !~ /\(0 complete basepairs\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
418 if($output !~ /\%nucleotide 61\nnewpath\n.+moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.42\d* 0.00\d* 1.00\d* 0.00\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
419
420 system("$eslssdraw $smallA[$pass] --span $alifile $templatefile $tmppfx.ps > /dev/null");
421 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
422 $output = `cat $tmppfx.ps`;
423 if($output !~ /\(tRNA 71 21\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
424 if($output !~ /\(no sequences span\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
425 if($output !~ /\%nucleotide 2\nnewpath\n.+0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.50\d* 0.00\d* 0.00\d* 0.50\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
426
427 system("$eslssdraw $smallA[$pass] --span $alifile $templatefile $tmppfx.ps > /dev/null");
428 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
429 $output = `cat $tmppfx.ps`;
430 if($output !~ /\(tRNA 71 21\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
431 if($output !~ /\(no sequences span\)/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
432 if($output !~ /\%nucleotide 2\nnewpath\n.+moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.50\d* 0.00\d* 0.00\d* 0.50\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
433
434 system("$eslssdraw $smallA[$pass] --info --prob --ifreq --dall --dint --mutinfo --span --tabfile $tmppfx.tab $alifile $templatefile $tmppfx.ps > /dev/null");
435 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
436 $output = `cat $tmppfx.ps`;
437 if($output !~ /setcmykcolor \(g\).+moveto show/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
438 $output = `cat $tmppfx.tab`;
439 if($output !~ /Information content data/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
440 if($output !~ /Mutual information data/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
441 if($output !~ /Insert frequency data/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
442 if($output !~ /Delete data/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
443 if($output !~ /Internal delete data/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
444 if($output !~ /Average posterior probability data/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
445 if($output !~ /Span data/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
446 if($output !~ /infocontent 7 1.27\d+ 5 4/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
447 if($output !~ /mutualinfo 16 30 38 0.47\d* 0.47\d* 0.76\d* 5 5/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
448 if($output !~ /insertfreq 45 0.60000 5 6/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
449 if($output !~ /deleteall 67 0.20\d* 4/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
450 if($output !~ /deleteint 67 0.00\d* 4 0/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
451 if($output !~ /avgpostprob 19 0.88\d* 5 4/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
452 if($output !~ /span 67 0.80\d* 6/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
453
454 system("$eslssdraw $smallA[$pass] --rf $alifile $templatefile $tmppfx.ps > /dev/null");
455 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
456 $output = `cat $tmppfx.ps`;
457 if($output !~ /\(\*REFERENCE\* \(\"#=GC RF\"\)\) 212.49 418.24 moveto show/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
458 if($output !~ /\(a\) 110.00 332.00 moveto show/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
459
460 if($pass == 0) {
461 system("$eslssdraw $smallA[$pass] --indi $alifile $templatefile $tmppfx.ps > /dev/null");
462 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
463 $output = `cat $tmppfx.ps`;
464 # should include tRNA2, tRNA3, and tRNA5 only
465 if($output !~ /tRNA1/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
466 if($output !~ /tRNA2/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
467 if($output !~ /tRNA3/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
468 if($output !~ /tRNA4/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
469 if($output !~ /tRNA5/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
470 if($output !~ /\%nucleotide 19\nnewpath\n 108.40 306.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.50\d* 0.00\d* 0.00\d* 0.50\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
471 if($output !~ /\(A\) 180.00 392.00 moveto show/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
472 if($output !~ /\%nucleotide 19\nnewpath\n 108.40 306.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.00\d* 0.21\d* 1.00\d* 0.00\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
473 }
474
475 system("$eslssdraw $smallA[$pass] --mask-col --mask $tmppfx.mask1 $alifile $templatefile $tmppfx.ps > /dev/null");
476 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
477 $output = `cat $tmppfx.ps`;
478 if($output !~ /\%nucleotide 3\nnewpath\n 166.40 374.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.00\d* 1.00\d* 0.00\d* 0.00\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
479
480 system("$eslssdraw $smallA[$pass] --mask-diff $tmppfx.mask2 --mask-col --mask $tmppfx.mask1 $alifile $templatefile $tmppfx.ps > /dev/null");
481 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
482 $output = `cat $tmppfx.ps`;
483 if($output !~ /\%nucleotide 3\nnewpath\n 166.40 374.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.00\d* 0.00\d* 0.00\d* 0.20\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
484
485 system("$eslssdraw $smallA[$pass] --mask-diff $tmppfx.mask2 --mask-col --mask $tmppfx.mask1 $alifile $templatefile $tmppfx.ps > /dev/null");
486 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
487 $output = `cat $tmppfx.ps`;
488 if($output !~ /\%nucleotide 3\nnewpath\n 166.40 374.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.00\d* 0.00\d* 0.00\d* 0.20\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
489
490 system("$eslssdraw $smallA[$pass] --no-leg $alifile $templatefile $tmppfx.ps > /dev/null");
491 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
492 $output = `cat $tmppfx.ps`;
493 if($output =~ /\(LEGEND\) 134.00 216.00 moveto show/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
494
495 system("$eslssdraw $smallA[$pass] --no-head $alifile $templatefile $tmppfx.ps > /dev/null");
496 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
497 $output = `cat $tmppfx.ps`;
498 if($output =~ /\(tRNA 71 21\) 96.98 418.24 moveto show/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
499
500 system("$eslssdraw $smallA[$pass] --no-foot $alifile $templatefile $tmppfx.ps > /dev/null");
501 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
502 $output = `cat $tmppfx.ps`;
503 if($output =~ /\(Created by 'esl-ssdraw'. Copyright \(C\) 2010 Howard Hughes Medical Institute.\) 12.00 12.00 moveto show/) { die "FAIL: postscript diagram drawn incorrectly on pass $pass2write"; }
504
505 # --small is incompatible with --indi:
506 if($pass == 0) {
507 system("$eslssdraw $smallA[$pass] --no-pp --indi $alifile $templatefile $tmppfx.ps > /dev/null");
508 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
509 $output = `cat $tmppfx.ps`;
510 # should include tRNA2, tRNA3, and tRNA5 only
511 if($output !~ /tRNA1/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
512 if($output !~ /tRNA2/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
513 if($output !~ /tRNA3/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
514 if($output !~ /tRNA4/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
515 if($output !~ /tRNA5/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
516 if($output !~ /\%nucleotide 19\nnewpath\n 108.40 306.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.50\d* 0.00\d* 0.00\d* 0.50\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
517 if($output !~ /\(A\) 180.00 392.00 moveto show/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
518 if($output =~ /\%nucleotide 19\nnewpath\n 108.40 306.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.92\d* 0.84\d* 0.00\d* 0.08\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
519 if($output !~ /\(Watson-Crick/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
520 if($output !~ /\(Positions !=/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
521
522 system("$eslssdraw $smallA[$pass] --no-bp --indi $alifile $templatefile $tmppfx.ps > /dev/null");
523 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
524 $output = `cat $tmppfx.ps`;
525 # should include tRNA2, tRNA3, and tRNA5 only
526 if($output !~ /tRNA1/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
527 if($output !~ /tRNA2/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
528 if($output !~ /tRNA3/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
529 if($output !~ /tRNA4/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
530 if($output !~ /tRNA5/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
531 if($output !~ /\%nucleotide 19\nnewpath\n 108.40 306.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.50\d* 0.00\d* 0.00\d* 0.50\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
532 if($output !~ /\(A\) 180.00 392.00 moveto show/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
533 if($output !~ /\%nucleotide 19\nnewpath\n 108.40 306.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.92\d* 0.84\d* 0.00\d* 0.08\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
534 if($output =~ /\(Watson-Crick/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
535 if($output !~ /\(Positions !=/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
536
537 system("$eslssdraw $smallA[$pass] --no-ol --indi $alifile $templatefile $tmppfx.ps > /dev/null");
538 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
539 $output = `cat $tmppfx.ps`;
540 # should include tRNA2, tRNA3, and tRNA5 only
541 if($output !~ /tRNA1/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
542 if($output !~ /tRNA2/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
543 if($output !~ /tRNA3/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
544 if($output !~ /tRNA4/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
545 if($output !~ /tRNA5/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
546 if($output !~ /\%nucleotide 19\nnewpath\n 108.40 306.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.50\d* 0.00\d* 0.00\d* 0.50\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
547 if($output !~ /\(A\) 180.00 392.00 moveto show/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
548 if($output !~ /\%nucleotide 19\nnewpath\n 108.40 306.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.92\d* 0.84\d* 0.00\d* 0.08\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
549 if($output !~ /\(Watson-Crick/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
550 if($output =~ /\(Positions !=/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
551
552 # NOTE: for --no-ntpp we don't actually check that residues are not drawn on PP diagrams
553 system("$eslssdraw $smallA[$pass] --no-ntpp --indi $alifile $templatefile $tmppfx.ps > /dev/null");
554 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
555 $output = `cat $tmppfx.ps`;
556 # should include tRNA2, tRNA3, and tRNA5 only
557 if($output !~ /tRNA1/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
558 if($output !~ /tRNA2/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
559 if($output !~ /tRNA3/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
560 if($output !~ /tRNA4/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
561 if($output !~ /tRNA5/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
562 if($output !~ /\%nucleotide 19\nnewpath\n 108.40 306.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.50\d* 0.00\d* 0.00\d* 0.50\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
563 if($output !~ /\(A\) 180.00 392.00 moveto show/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
564 if($output !~ /\%nucleotide 19\nnewpath\n 108.40 306.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.92\d* 0.84\d* 0.00\d* 0.08\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
565 if($output !~ /\(Watson-Crick/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
566 if($output !~ /\(Positions !=/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
567 }
568
569 system("$eslssdraw $smallA[$pass] --no-cnt --info $alifile $templatefile $tmppfx.ps > /dev/null");
570 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
571 $output = `cat $tmppfx.ps`;
572 if($output =~ /setcmykcolor (g)\s+168\.\d+\s+392\.\d+\s+moveto show/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
573
574 system("$eslssdraw $smallA[$pass] --cthresh 0.4 --info $alifile $templatefile $tmppfx.ps > /dev/null");
575 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
576 $output = `cat $tmppfx.ps`;
577 if($output =~ /setcmykcolor (G)\s+168\.\d+\s+392\.\d+\s+moveto show/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
578
579 system("$eslssdraw $smallA[$pass] --cambig --info $alifile $templatefile $tmppfx.ps > /dev/null");
580 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
581 $output = `cat $tmppfx.ps`;
582 if($output =~ /setcmykcolor (K)\s+168\.\d+\s+392\.\d+\s+moveto show/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
583
584 system("$eslssdraw $smallA[$pass] --cambig --cthresh 0.4 --info $alifile $templatefile $tmppfx.ps > /dev/null");
585 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
586 $output = `cat $tmppfx.ps`;
587 if($output =~ /setcmykcolor (C)\s+168\.\d+\s+376\.\d+\s+moveto show/) { die "FAIL: tab file incorrectly written on pass $pass2write"; }
588
589 system("$eslssdraw $smallA[$pass] --mask $tmppfx.mask1 $alifile $templatefile $tmppfx.ps > /dev/null");
590 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
591 $output = `cat $tmppfx.ps`;
592 if($output !~ /\%nucleotide 3\nnewpath\n 171.00 379.00 3.0 0 360 arc closepath\n 0.0\d*0 0.63\d* 1.0\d*0 0.0\d*0 setcmykcolor\n stroke/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
593
594 system("$eslssdraw $smallA[$pass] --mask-x --mask $tmppfx.mask1 $alifile $templatefile $tmppfx.ps > /dev/null");
595 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
596 $output = `cat $tmppfx.ps`;
597 if($output !~ /stroke\n 175.00 375.00 moveto -8.0 8.0 rlineto closepath/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
598
599 system("$eslssdraw $smallA[$pass] --mask-u --mask $tmppfx.mask1 $alifile $templatefile $tmppfx.ps > /dev/null");
600 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
601 $output = `cat $tmppfx.ps`;
602 if($output !~ /\%nucleotide 3\nnewpath\n 168.00 376.00 moveto 0 6.0 rlineto 6.0 0 rlineto 0 -6.0 rlineto closepath\n 0.00\d* 0.63\d* 1.00\d* 0.00\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
603
604 system("$eslssdraw $smallA[$pass] --mask-a --mask-x --mask $tmppfx.mask1 $alifile $templatefile $tmppfx.ps > /dev/null");
605 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
606 $output = `cat $tmppfx.ps`;
607 if($output !~ /%nucleotide 3\nnewpath\n 0.00\d* 0.63\d* 1.00\d* 0.00\d* setcmykcolor\n 167.00 375.00 moveto 8.0 8.0 rlineto closepath\n stroke/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
608
609 system("$eslssdraw $smallA[$pass] --mask-a --mask-u --mask $tmppfx.mask1 $alifile $templatefile $tmppfx.ps > /dev/null");
610 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
611 $output = `cat $tmppfx.ps`;
612 if($output !~ /\%nucleotide 3\nnewpath\n 168.50 376.50 moveto 0 5.0 rlineto 5.0 0 rlineto 0 -5.0 rlineto closepath\n 0.00\d* 0.63\d* 1.00\d* 0.00\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
613
614 system("$eslssdraw $smallA[$pass] --dfile $tmppfx.dfile $alifile $templatefile $tmppfx.ps > /dev/null");
615 $output = `cat $tmppfx.ps`;
616 if($output !~ /%nucleotide 3\nnewpath\n 166.40 374.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.92\d* 0.84\d* 0.00\d* 0.08\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
617
618 system("$eslssdraw $smallA[$pass] --mask $tmppfx.mask1 --dfile $tmppfx.dfile $alifile $templatefile $tmppfx.ps > /dev/null");
619 $output = `cat $tmppfx.ps`;
620 if($output !~ /%nucleotide 3\nnewpath\n 171.00 379.00 3.0 0 360 arc closepath\n 0.9200 0.8400 0.00\d* 0.0800 setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
621
622 system("$eslssdraw $smallA[$pass] --efile $tmppfx.efile $alifile $templatefile $tmppfx.ps > /dev/null");
623 $output = `cat $tmppfx.ps`;
624 if($output !~ /\%nucleotide 3\nnewpath\n 166.40 374.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.03 0.17 0.20 0.14 setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
625
626 system("$eslssdraw $smallA[$pass] --ifreq --ifile $tmppfx.ifile $alifile $templatefile $tmppfx.ps > /dev/null");
627 if ($? != 0) { die "FAIL: esl-ssdraw failed unexpectedly on pass $pass2write";}
628 $output = `cat $tmppfx.ps`;
629 if($output !~ /\%nucleotide 45\nnewpath\n 198.40 312.40 moveto 0 8 rlineto 8 0 rlineto 0 -8 rlineto closepath\n 0.00\d* 0.94\d* 1.00\d* 0.00\d* setcmykcolor/) { die "FAIL: postscript diagram drawn incorrectly written on pass $pass2write"; }
630 }
631
632 print "ok\n";
633
634 unlink "$tmppfx.mask1";
635 unlink "$tmppfx.mask2";
636 unlink "$tmppfx.ifile";
637 unlink "$tmppfx.dfile";
638 unlink "$tmppfx.efile";
639 unlink "$tmppfx.ps";
640 unlink "$tmppfx.tab";
641 unlink "$tmppfx.stk";
642
643
644 exit 0;