Mercurial > repos > xuebing > sharplabtool
comparison tools/mytools/fimo_out/fimo-to-html.xsl @ 0:9071e359b9a3
Uploaded
author | xuebing |
---|---|
date | Fri, 09 Mar 2012 19:37:19 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:9071e359b9a3 |
---|---|
1 <?xml version="1.0" encoding="ISO-8859-1"?> | |
2 <xsl:stylesheet version="1.0" | |
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
4 xmlns:cis="http://zlab.bu.edu/schema/cisml" | |
5 xmlns:fimo="http://noble.gs.washington.edu/schema/cisml" | |
6 xmlns:mem="http://noble.gs.washington.edu/meme" | |
7 > | |
8 | |
9 <xsl:output method="html" indent="yes" | |
10 doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" | |
11 doctype-system="http://www.w3.org/TR/html4/loose.dtd" | |
12 /> | |
13 | |
14 <!-- Stylesheet processing starts here --> | |
15 <xsl:template match="/fimo"> | |
16 <html> | |
17 <xsl:call-template name="html_head"/> | |
18 <body bgcolor='#D5F0FF'> | |
19 <a name="top_buttons"></a> | |
20 <hr /> | |
21 <table summary="buttons" align="left" cellspacing="0"> | |
22 <tr> | |
23 <td bgcolor="#00FFFF"> | |
24 <a href='#database_and_motifs'><b>Database and Motifs</b></a> | |
25 </td> | |
26 <td bgcolor="#DDFFDD"> | |
27 <a href="#sec_i"><b>High-scoring Motif Occurences</b></a> | |
28 </td> | |
29 <td bgcolor="#DDDDFF"> | |
30 <a href="#debugging_information"><b>Debugging Information</b></a> | |
31 </td> | |
32 </tr> | |
33 </table> | |
34 <br /> | |
35 <br /> | |
36 <!-- Create the various sub-sections of the document --> | |
37 <xsl:call-template name="version"/> | |
38 <xsl:call-template name="database_and_motifs"/> | |
39 <xsl:call-template name="high_scoring_motif_occurrences"/> | |
40 <!-- Diagrams and annotations break for long sequences | |
41 (H. sap. chr21 for example --> | |
42 <!-- | |
43 <xsl:call-template name="motif_diagrams"/> | |
44 <xsl:call-template name="annotations"/> | |
45 --> | |
46 <xsl:call-template name="debugging_information"/> | |
47 <!-- Buttons are pointless since there is only one section | |
48 <xsl:call-template name="button_help"/> | |
49 --> | |
50 </body> | |
51 </html> | |
52 </xsl:template> | |
53 | |
54 <xsl:template name="html_head"> | |
55 <!-- This template prints the HTML head block, including the document level CSS. --> | |
56 <head> | |
57 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> | |
58 <title>FIMO Results</title> | |
59 <style type="text/css"> | |
60 td.left {text-align: left;} | |
61 td.right {text-align: right; padding-right: 1cm;} | |
62 </style> | |
63 </head> | |
64 </xsl:template> | |
65 | |
66 <xsl:template name="version"> | |
67 <!-- | |
68 This template prints the HTML describing the version of FIMO | |
69 that generated this document. | |
70 --> | |
71 <hr /> | |
72 <center> | |
73 <big><b>FIMO - Motif search tool</b></big> | |
74 </center> | |
75 <hr /> | |
76 <p> | |
77 FIMO version <xsl:value-of select="@version"/>, | |
78 (Release date: <xsl:value-of select="@release"/>) | |
79 </p> | |
80 <p> | |
81 For further information on how to interpret these results | |
82 or to get a copy of the FIMO software please access | |
83 <a href="http://meme.nbcr.net">http://meme.nbcr.net</a> | |
84 </p> | |
85 <p>If you use FIMO in your research, please cite the following paper:<br /> | |
86 Charles E. Grant, Timothy L. Bailey, and William Stafford Noble, | |
87 "FIMO: Scanning for occurrences of a given motif", | |
88 <i>Bioinformatics</i>, <b>27</b>(7):1017-1018, 2011. | |
89 </p> | |
90 </xsl:template> | |
91 | |
92 <xsl:template name="reference"> | |
93 <!-- This template prints the instructions for citing FIMO. --> | |
94 <hr/> | |
95 <center> | |
96 <a name="reference"/> | |
97 <big><b>REFERENCE</b></big> | |
98 </center> | |
99 <hr/> | |
100 <p> | |
101 If you use this program in your research, please cite: | |
102 </p> | |
103 <p> | |
104 </p> | |
105 </xsl:template> | |
106 | |
107 <xsl:template name="database_and_motifs"> | |
108 <!-- | |
109 This template prints the HTML descibing the input sequences | |
110 and motifs that were used to generate this document. | |
111 --> | |
112 <hr/> | |
113 <center> | |
114 <big> | |
115 <b><a name="database_and_motifs">DATABASE AND MOTIFS</a></b> | |
116 </big> | |
117 </center> | |
118 <hr/> | |
119 <div style="padding-left: 0.75in; line-height: 1em; font-family: monospace;"> | |
120 <p> | |
121 DATABASE | |
122 <xsl:value-of select="/fimo/settings/setting[@name='sequence file name']"/> | |
123 <br /> | |
124 Database contains | |
125 <xsl:value-of select="/fimo/sequence-data/@num-sequences"/> | |
126 sequences, | |
127 <xsl:value-of select="/fimo/sequence-data/@num-residues"/> | |
128 residues | |
129 </p> | |
130 <p> | |
131 MOTIFS | |
132 <xsl:value-of select="/fimo/settings/setting[@name='MEME file name']"/> | |
133 <xsl:text> </xsl:text> | |
134 (<xsl:value-of select="/fimo/alphabet"/>) | |
135 <table> | |
136 <thead> | |
137 <tr> | |
138 <th style="border-bottom: 1px dashed;">MOTIF</th> | |
139 <th style="border-bottom: 1px dashed; padding-left: 1em;">WIDTH</th> | |
140 <th style="border-bottom: 1px dashed; padding-left: 1em;" align="left"> | |
141 BEST POSSIBLE MATCH | |
142 </th> | |
143 </tr> | |
144 </thead> | |
145 <tbody> | |
146 <xsl:for-each select="/fimo/motif"> | |
147 <tr> | |
148 <td align="right"><xsl:value-of select="./@name"/></td> | |
149 <td align="right" style="padding-left: 1em;"><xsl:value-of select="./@width"/></td> | |
150 <td align="left" style="padding-left: 1em;"> | |
151 <xsl:value-of select="./@best-possible-match"/> | |
152 </td> | |
153 </tr> | |
154 </xsl:for-each> | |
155 </tbody> | |
156 </table> | |
157 </p> | |
158 <p> | |
159 Random model letter frequencies | |
160 (from <xsl:value-of select="/fimo/background/@source"/>): | |
161 <br /> | |
162 <xsl:call-template name="bg_freq"/> | |
163 </p> | |
164 </div> | |
165 </xsl:template> | |
166 | |
167 <xsl:template name="bg_freq"> | |
168 <!-- This template prints the HTML listing the background frequencies for each symbol in the alphabet. --> | |
169 <xsl:for-each select="/fimo/background/value"> | |
170 <xsl:value-of select="./@letter"/> | |
171 <xsl:text> </xsl:text> | |
172 <xsl:value-of select="format-number(., '0.000')"/> | |
173 <xsl:text> </xsl:text> | |
174 <!-- For amino acids insert a line break very 9 characters. --> | |
175 <xsl:variable name="letter_index" select="position()" /> | |
176 <xsl:if test="$letter_index mod 9 = 0"> | |
177 <xsl:text> </xsl:text> | |
178 <br/> | |
179 <xsl:text> </xsl:text> | |
180 </xsl:if> | |
181 </xsl:for-each> | |
182 </xsl:template> | |
183 | |
184 <xsl:template name="high_scoring_motif_occurrences"> | |
185 <xsl:variable name="alphabet"> | |
186 <xsl:value-of select="/fimo/alphabet"/> | |
187 </xsl:variable> | |
188 <xsl:variable name="num_qvalues"> | |
189 <xsl:value-of | |
190 select="count(document('cisml.xml')/cis:cis-element-search/cis:pattern/cis:scanned-sequence/cis:matched-element/mem:qvalue)"/> | |
191 </xsl:variable> | |
192 <!-- This template prints the matches to the pattern. --> | |
193 <hr/> | |
194 <center> | |
195 <big><b><a name="sec_i">SECTION I: HIGH-SCORING MOTIF OCCURENCES</a></b></big> | |
196 </center> | |
197 <hr/> | |
198 <ul> | |
199 <li> Each of the following | |
200 <xsl:value-of select="count(document('cisml.xml')/cis:cis-element-search/cis:pattern/cis:scanned-sequence/cis:matched-element)"/> | |
201 motif occurrences has | |
202 <xsl:choose> | |
203 <xsl:when test="/fimo/settings/setting[@name='output q-threshold set'] = 'true'"> | |
204 q-value less than | |
205 <xsl:value-of select="/fimo/settings/setting[@name='output q-value threshold' = 'true']"/> | |
206 </xsl:when> | |
207 <xsl:otherwise> | |
208 p-value less than | |
209 <xsl:value-of select="/fimo/settings/setting[@name='output p-value threshold']"/> | |
210 </xsl:otherwise> | |
211 </xsl:choose> | |
212 </li> | |
213 <li> The p-value of a motif occurrence is defined as the | |
214 probability of a random sequence of the same length as the motif | |
215 matching that position of the sequence with as good or better a score. | |
216 </li> | |
217 <li> The score for the match of a position in a sequence to a motif | |
218 is computed by summing the appropriate entries from each column of | |
219 the position-dependent scoring matrix that represents the motif. | |
220 </li> | |
221 <xsl:if test="$num_qvalues > 0"> | |
222 <li> The q-value of a motif occurrence is defined as the | |
223 false discovery rate if the occurrence is accepted as significant. | |
224 </li> | |
225 </xsl:if> | |
226 <li>The table is sorted by increasing p-value.</li> | |
227 <li>If the start position is larger than the end position, | |
228 the motif occurrence is on the reverse strand. | |
229 </li> | |
230 </ul> | |
231 <table border="1"> | |
232 <thead> | |
233 <tr> | |
234 <th>Motif</th> | |
235 <th>Sequence Name</th> | |
236 <xsl:if test="$alphabet='nucleotide'"> | |
237 <th>Strand</th> | |
238 </xsl:if> | |
239 <th>Start</th> | |
240 <th>End</th> | |
241 <th>p-value</th> | |
242 <xsl:if test="$num_qvalues > 0"> | |
243 <th>q-value</th> | |
244 </xsl:if> | |
245 <th>Matched Sequence</th> | |
246 </tr> | |
247 </thead> | |
248 <tbody> | |
249 <xsl:for-each select="document('cisml.xml')/cis:cis-element-search/cis:pattern/cis:scanned-sequence/cis:matched-element"> | |
250 <xsl:sort select="@pvalue" data-type="number" order="ascending"/> | |
251 <xsl:variable name="seq_name" select="../@name"/> | |
252 <tr> | |
253 <td align="left"> | |
254 <a name="occurrences_{$seq_name}"><xsl:value-of select="../../@name"/></a> | |
255 </td> | |
256 <td align="left"> | |
257 <xsl:value-of select="../@name"/> | |
258 </td> | |
259 <!-- start and stop positions --> | |
260 <!-- CISML uses start > stop to indicate - strand --> | |
261 <!-- For HTML we want start < stop, indicate strand in strand column --> | |
262 <xsl:if test="$alphabet='nucleotide'"> | |
263 <xsl:choose> | |
264 <xsl:when test="@start > @stop"> | |
265 <!-- start > stop so - strand --> | |
266 <td align="center"><xsl:text>−</xsl:text></td> | |
267 </xsl:when> | |
268 <xsl:otherwise> | |
269 <td align="center"><xsl:text>+</xsl:text></td> | |
270 </xsl:otherwise> | |
271 </xsl:choose> | |
272 </xsl:if> | |
273 <xsl:choose> | |
274 <xsl:when test="@start > @stop"> | |
275 <!-- start > stop so - strand --> | |
276 <td align="left"> | |
277 <xsl:value-of select="@stop"/> | |
278 </td> | |
279 <td align="left"> | |
280 <xsl:value-of select="@start"/> | |
281 </td> | |
282 </xsl:when> | |
283 <xsl:otherwise> | |
284 <td align="left"> | |
285 <xsl:value-of select="@start"/> | |
286 </td> | |
287 <td align="left"> | |
288 <xsl:value-of select="@stop"/> | |
289 </td> | |
290 </xsl:otherwise> | |
291 </xsl:choose> | |
292 <td align="left"> | |
293 <xsl:value-of select="@pvalue"/> | |
294 </td> | |
295 <xsl:if test="$num_qvalues > 0"> | |
296 <td align="left"> | |
297 <xsl:value-of select="./mem:qvalue"/> | |
298 </td> | |
299 </xsl:if> | |
300 <td align="left"> | |
301 <code style="font-size: x-large;"><xsl:value-of select="./cis:sequence"/></code> | |
302 </td> | |
303 </tr> | |
304 </xsl:for-each> | |
305 </tbody> | |
306 </table> | |
307 </xsl:template> | |
308 | |
309 <xsl:template name="motif_diagrams"> | |
310 <!-- | |
311 This template draws the bead-on-string diagram for each | |
312 of the scanned sequence. | |
313 --> | |
314 <hr/> | |
315 <center> | |
316 <big><b><a name="sec_ii">SECTION II: MOTIF DIAGRAMS</a></b></big> | |
317 </center> | |
318 <hr/> | |
319 <table border="1"> | |
320 <thead> | |
321 <tr> | |
322 <th align="left"><br/>Name</th> | |
323 <th align="left"><br/>Motifs</th> | |
324 <th></th> | |
325 </tr> | |
326 </thead> | |
327 <tbody> | |
328 <xsl:for-each select="document('cisml.xml')/cis:cis-element-search/cis:pattern/cis:scanned-sequence[not (@name = preceding::cis:scanned-sequence/@name)]"> | |
329 <xsl:sort select="@name" order="ascending"/> | |
330 <xsl:variable name="sequence_width" select="@length"/> | |
331 <xsl:variable name="sequence_name" select="@name"/> | |
332 <tr> | |
333 <td><a name="diagram_{$sequence_name}"><xsl:value-of select="$sequence_name"/></a></td> | |
334 <td> | |
335 <table> | |
336 <tr> | |
337 <xsl:call-template name="draw_diagram_for_sequence"> | |
338 <xsl:with-param name="sequence_name" select="$sequence_name"/> | |
339 <xsl:with-param name="sequence_width" select="@length"/> | |
340 </xsl:call-template> | |
341 </tr> | |
342 </table> | |
343 </td> | |
344 </tr> | |
345 </xsl:for-each> | |
346 <tr> | |
347 <td rowspan="2" style="color: blue;">SCALE</td> | |
348 <td> | |
349 <table> | |
350 <tr> | |
351 <td> | |
352 <xsl:call-template name="ticks"> | |
353 <xsl:with-param name="count" select="1"/> | |
354 <xsl:with-param name="limit"> | |
355 <xsl:for-each select="document('cisml.xml')/cis:cis-element-search/cis:pattern/cis:scanned-sequence/@length"> | |
356 <xsl:sort data-type="number" order="descending"/> | |
357 <xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if> | |
358 </xsl:for-each> | |
359 </xsl:with-param> | |
360 </xsl:call-template> | |
361 </td> | |
362 </tr> | |
363 <tr> | |
364 <td> | |
365 <xsl:call-template name="scale"> | |
366 <xsl:with-param name="count" select="1"/> | |
367 <xsl:with-param name="limit"> | |
368 <xsl:for-each select="document('cisml.xml')/cis:cis-element-search/cis:pattern/cis:scanned-sequence/@length"> | |
369 <xsl:sort data-type="number" order="descending"/> | |
370 <xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if> | |
371 </xsl:for-each> | |
372 </xsl:with-param> | |
373 </xsl:call-template> | |
374 </td> | |
375 </tr> | |
376 </table> | |
377 </td> | |
378 </tr> | |
379 </tbody> | |
380 </table> | |
381 </xsl:template> | |
382 | |
383 <xsl:template name="draw_diagram_for_sequence"> | |
384 <!-- | |
385 This template draws the bead-on-string diagram for | |
386 a single sequence. | |
387 --> | |
388 <xsl:param name="sequence_name"/> | |
389 <xsl:param name="sequence_width"/> | |
390 <xsl:for-each select="document('cisml.xml')/cis:cis-element-search/cis:pattern/cis:scanned-sequence[@name = $sequence_name]/cis:matched-element"> | |
391 <xsl:sort select="number(@start)" data-type="number" order="ascending"/> | |
392 <xsl:variable name="starting"> | |
393 <xsl:choose> | |
394 <xsl:when test="number(@start) < number(@stop)"> | |
395 <xsl:value-of select="@start"/> | |
396 </xsl:when> | |
397 <xsl:otherwise> | |
398 <xsl:value-of select="@stop"/> | |
399 </xsl:otherwise> | |
400 </xsl:choose> | |
401 </xsl:variable> | |
402 <xsl:variable name="ending"> | |
403 <xsl:choose> | |
404 <xsl:when test="number(@start) < number(@stop)"> | |
405 <xsl:value-of select="@stop"/> | |
406 </xsl:when> | |
407 <xsl:otherwise> | |
408 <xsl:value-of select="@start"/> | |
409 </xsl:otherwise> | |
410 </xsl:choose> | |
411 </xsl:variable> | |
412 <xsl:variable name="current_element" select="position()"/> | |
413 <xsl:variable name="previous_end"> | |
414 <xsl:choose> | |
415 <xsl:when test="position() = 1">0</xsl:when> | |
416 <xsl:otherwise> | |
417 <xsl:for-each select="document('cisml.xml')/cis:cis-element-search/cis:pattern/cis:scanned-sequence[@name = $sequence_name]/cis:matched-element"> | |
418 <xsl:sort select="number(@start)" data-type="number" order="ascending"/> | |
419 <xsl:if test="position() = ($current_element - 1)"> | |
420 <xsl:choose> | |
421 <xsl:when test="number(@start) < number(@stop)"> | |
422 <xsl:value-of select="@stop"/> | |
423 </xsl:when> | |
424 <xsl:otherwise> | |
425 <xsl:value-of select="@start"/> | |
426 </xsl:otherwise> | |
427 </xsl:choose> | |
428 </xsl:if> | |
429 </xsl:for-each> | |
430 </xsl:otherwise> | |
431 </xsl:choose> | |
432 </xsl:variable> | |
433 <xsl:variable name="motif_name"> | |
434 <xsl:value-of select="../../@name"/> | |
435 </xsl:variable> | |
436 <xsl:variable name="motif_index"> | |
437 <xsl:for-each select="document('cisml.xml')/cis:cis-element-search/cis:pattern"> | |
438 <xsl:if test="@name = $motif_name"><xsl:value-of select="position()"/></xsl:if> | |
439 </xsl:for-each> | |
440 <xsl:value-of select="@name"/> | |
441 </xsl:variable> | |
442 <xsl:variable name="motif_color"> | |
443 <xsl:call-template name="pick_color"> | |
444 <xsl:with-param name="index" select="$motif_index"/> | |
445 </xsl:call-template> | |
446 </xsl:variable> | |
447 <xsl:variable name="font_color"> | |
448 <xsl:call-template name="pick_font_color"> | |
449 <xsl:with-param name="index" select="$motif_index"/> | |
450 </xsl:call-template> | |
451 </xsl:variable> | |
452 <xsl:variable name="strand"> | |
453 <xsl:choose> | |
454 <xsl:when test="number(@start) < number(@stop)"> | |
455 <xsl:text>+</xsl:text> | |
456 </xsl:when> | |
457 <xsl:otherwise> | |
458 <xsl:text>-</xsl:text> | |
459 </xsl:otherwise> | |
460 </xsl:choose> | |
461 </xsl:variable> | |
462 <xsl:variable name="alphabet" select="document('fimo.xml')/fimo/alphabet"/> | |
463 <td style="width: {2 * ($starting - $previous_end) }px;"><hr size="4" noshade="noshade"/></td> | |
464 <td style="width: {2 * ($ending - $starting)}px; background: {$motif_color}; color: {$font_color}; text-align: center;"> | |
465 <xsl:if test="$alphabet = 'nucleotide'"><xsl:value-of select="$strand"/></xsl:if> | |
466 <xsl:value-of select="../../@name"/> | |
467 </td> | |
468 <xsl:if test="position() = last()"> | |
469 <td style="width: {2 * ($sequence_width - $ending) }px;"><hr size="4" noshade="noshade"/></td> | |
470 </xsl:if> | |
471 </xsl:for-each> | |
472 </xsl:template> | |
473 | |
474 <xsl:template name="ticks"> | |
475 <!-- | |
476 This template is used to print the tick marks in the | |
477 scale at the bottom of the bead-on-string daigrams. | |
478 --> | |
479 <xsl:param name="count" select="1"/> | |
480 <xsl:param name="limit" select="1"/> | |
481 <xsl:if test="$count < $limit"> | |
482 <td style="width: 50px;" align="left"><font color="blue">|</font></td> | |
483 <xsl:call-template name="ticks"> | |
484 <xsl:with-param name="count" select="$count + 24"/> | |
485 <xsl:with-param name="limit" select="$limit"/> | |
486 </xsl:call-template> | |
487 </xsl:if> | |
488 </xsl:template> | |
489 | |
490 <xsl:template name="scale"> | |
491 <!-- | |
492 This template is used to print the text in the | |
493 scale at the bottom of the bead-on-string daigrams. | |
494 --> | |
495 <xsl:param name="count" select="1"/> | |
496 <xsl:param name="limit" select="1"/> | |
497 <xsl:if test="$count < $limit"> | |
498 <td style="width: 50px;" align="left"><font color="blue"><xsl:value-of select="$count"/></font></td> | |
499 <xsl:if test="$count = 1"> | |
500 <xsl:call-template name="scale"> | |
501 <xsl:with-param name="limit" select="$limit"/> | |
502 <xsl:with-param name="count" select="$count + 24"/> | |
503 </xsl:call-template> | |
504 </xsl:if> | |
505 <xsl:if test="$count > 1"> | |
506 <xsl:call-template name="scale"> | |
507 <xsl:with-param name="limit" select="$limit"/> | |
508 <xsl:with-param name="count" select="$count + 25"/> | |
509 </xsl:call-template> | |
510 </xsl:if> | |
511 </xsl:if> | |
512 </xsl:template> | |
513 | |
514 <xsl:template name="pick_color"> | |
515 <!-- | |
516 This template is used to set the color of motif markers | |
517 in the bead-on-string diagrams. | |
518 --> | |
519 <xsl:param name="index" select="1"/> | |
520 <xsl:choose> | |
521 <xsl:when test="($index mod 16) = 0">white</xsl:when> | |
522 <xsl:when test="($index mod 16) = 1">aqua</xsl:when> | |
523 <xsl:when test="($index mod 16) = 2">blue</xsl:when> | |
524 <xsl:when test="($index mod 16) = 3">red</xsl:when> | |
525 <xsl:when test="($index mod 16) = 4">fuchsia</xsl:when> | |
526 <xsl:when test="($index mod 16) = 5">yellow</xsl:when> | |
527 <xsl:when test="($index mod 16) = 6">lime</xsl:when> | |
528 <xsl:when test="($index mod 16) = 7">teal</xsl:when> | |
529 <xsl:when test="($index mod 16) = 8">#444444</xsl:when> | |
530 <xsl:when test="($index mod 16) = 9">green</xsl:when> | |
531 <xsl:when test="($index mod 16) = 10">silver</xsl:when> | |
532 <xsl:when test="($index mod 16) = 11">purple</xsl:when> | |
533 <xsl:when test="($index mod 16) = 12">olive</xsl:when> | |
534 <xsl:when test="($index mod 16) = 13">navy</xsl:when> | |
535 <xsl:when test="($index mod 16) = 14">maroon</xsl:when> | |
536 <xsl:when test="($index mod 16) = 15">black</xsl:when> | |
537 </xsl:choose> | |
538 </xsl:template> | |
539 | |
540 <xsl:template name="pick_font_color"> | |
541 <!-- | |
542 This template is used to set the font color in motif markers | |
543 in the bead-on-string diagrams. | |
544 --> | |
545 <xsl:param name="index" select="1"/> | |
546 <xsl:choose> | |
547 <xsl:when test="($index mod 16) = 0">black</xsl:when> | |
548 <xsl:when test="($index mod 16) = 1">black</xsl:when> | |
549 <xsl:when test="($index mod 16) = 2">white</xsl:when> | |
550 <xsl:when test="($index mod 16) = 3">black</xsl:when> | |
551 <xsl:when test="($index mod 16) = 4">black</xsl:when> | |
552 <xsl:when test="($index mod 16) = 5">black</xsl:when> | |
553 <xsl:when test="($index mod 16) = 6">black</xsl:when> | |
554 <xsl:when test="($index mod 16) = 7">white</xsl:when> | |
555 <xsl:when test="($index mod 16) = 8">white</xsl:when> | |
556 <xsl:when test="($index mod 16) = 9">black</xsl:when> | |
557 <xsl:when test="($index mod 16) = 10">black</xsl:when> | |
558 <xsl:when test="($index mod 16) = 11">white</xsl:when> | |
559 <xsl:when test="($index mod 16) = 12">white</xsl:when> | |
560 <xsl:when test="($index mod 16) = 13">white</xsl:when> | |
561 <xsl:when test="($index mod 16) = 14">white</xsl:when> | |
562 <xsl:when test="($index mod 16) = 15">white</xsl:when> | |
563 </xsl:choose> | |
564 </xsl:template> | |
565 | |
566 <xsl:template name="annotations"> | |
567 <!-- | |
568 This template draws the motif/sequence annotations for each | |
569 of the scanned sequence less than 10kb. | |
570 --> | |
571 <hr/> | |
572 <center> | |
573 <big><b><a name="sec_iii">SECTION III: SEQUENCE/MOTIF ANNOTATIONS</a></b></big> | |
574 </center> | |
575 <hr/> | |
576 <xsl:for-each select="document('cisml.xml')/cis:cis-element-search/cis:pattern/cis:scanned-sequence[not (@name = preceding::cis:scanned-sequence/@name)]"> | |
577 <xsl:sort select="@name" order="ascending"/> | |
578 <xsl:variable name="sequence_length" select="@length"/> | |
579 <xsl:variable name="sequence_name" select="@name"/> | |
580 <p> | |
581 <a name="annotation_{$sequence_name}"><xsl:value-of select="$sequence_name"/></a> | |
582 <br /> | |
583 <span style="background-color: ##DDDD88;"><a href="#occurrences_{$sequence_name}">S</a></span> | |
584 <span style="background-color: #DDFFDD;"><a href="#diagram_{$sequence_name}">D</a></span> | |
585 <span style="background-color: #FFFFFF;"><a href="#button_help">?</a></span> | |
586 </p> | |
587 <p> | |
588 Length = <xsl:value-of select="$sequence_length"/> | |
589 </p> | |
590 <p> | |
591 String Length = <xsl:value-of | |
592 select="string-length(normalize-space(document('matched_sequences.xml')/matched-sequences/sequence[@name=$sequence_name]))"/> | |
593 </p> | |
594 <pre> | |
595 <table style="font-family: monospace;"> | |
596 <tbody> | |
597 <xsl:call-template name="wrap_sequence"> | |
598 <xsl:with-param name="sequence" | |
599 select="normalize-space(document('matched_sequences.xml')/matched-sequences/sequence[@name=$sequence_name])"/> | |
600 <xsl:with-param name="sequence_index" select="1"/> | |
601 <xsl:with-param name="sequence_name" select="$sequence_name"/> | |
602 </xsl:call-template> | |
603 </tbody> | |
604 </table> | |
605 </pre> | |
606 <hr/> | |
607 </xsl:for-each> | |
608 | |
609 </xsl:template> | |
610 | |
611 <xsl:template name="debugging_information"> | |
612 <!-- This template print the HTML describing the FIMO input parameters. --> | |
613 <hr/> | |
614 <center> | |
615 <big><b><a name="debugging_information">DEBUGGING INFORMATION</a></b></big> | |
616 </center> | |
617 <hr/> | |
618 <p> | |
619 Command line: | |
620 </p> | |
621 <pre> | |
622 <xsl:value-of select="/fimo/command-line"/> | |
623 </pre> | |
624 <p> | |
625 Settings: | |
626 </p> | |
627 <pre> | |
628 <table> | |
629 <xsl:apply-templates select="/fimo/settings/setting[position() mod 3 = 1]"/> | |
630 </table> | |
631 </pre> | |
632 <p> | |
633 This information can be useful in the event you wish to report a | |
634 problem with the FIMO software. | |
635 </p> | |
636 <hr /> | |
637 <span style="background-color: #DDDDFF"><a href="#top_buttons"><b>Go to top</b></a></span> | |
638 | |
639 </xsl:template> | |
640 | |
641 <xsl:template match="setting"> | |
642 <!-- This template prints the program settings in 2 columns --> | |
643 <tr> | |
644 <td style="padding-right: 2em"><xsl:value-of select="@name"/> = <xsl:value-of select="."/></td> | |
645 <xsl:choose> | |
646 <xsl:when test="count(following-sibling::*[name()=name(current())])"> | |
647 <td style="padding-left: 5em; padding-right: 2em"> | |
648 <xsl:value-of select="following-sibling::setting[1]/@name"/> = <xsl:value-of select="following-sibling::setting[1]"/> | |
649 </td> | |
650 <td style="padding-left: 5em; padding-right: 2em"> | |
651 <xsl:value-of select="following-sibling::setting[2]/@name"/> = <xsl:value-of select="following-sibling::setting[2]"/> | |
652 </td> | |
653 </xsl:when> | |
654 <xsl:otherwise> | |
655 <td style="padding-left: 5em; padding-right: 2em"></td> | |
656 <td align="right"></td> | |
657 </xsl:otherwise> | |
658 </xsl:choose> | |
659 </tr> | |
660 </xsl:template> | |
661 | |
662 <xsl:template name="button_help"> | |
663 <hr /> | |
664 <center> | |
665 <h3><a name="button_help">Button Help</a></h3> | |
666 </center> | |
667 <hr /> | |
668 <span style="background-color: #DDDDFF">S</span> | |
669 Links to Entrez database at <a href="http://www.ncbi.nlm.nih.gov">NCBI</a> | |
670 <span style="background-color: #DDDD88">S</span> | |
671 Links to motif occurences table(<a href="#sec_i">SECTION I</a>) | |
672 <br/> | |
673 <span style="background-color: #DDFFDD">D</span> | |
674 Links to motif occurences diagram (<a href="#sec_ii">SECTION II</a>) | |
675 <br /> | |
676 <span style="background-color: #FFDDDD">A</span> | |
677 Links to sequence/motif annotated alignments (<a href="#sec_iii">SECTION III</a>) | |
678 <br /> | |
679 <span style="background-color: #FFFFFF">?</span> | |
680 This information | |
681 <br /> | |
682 | |
683 <hr /> | |
684 <span style="background-color: #DDDDFF"><a href="#top_buttons"><b>Go to top</b></a></span> | |
685 </xsl:template> | |
686 | |
687 <xsl:template name="wrap_sequence"> | |
688 <xsl:param name="sequence"/> | |
689 <xsl:param name="sequence_index"/> | |
690 <xsl:param name="sequence_name"/> | |
691 <xsl:variable name="current_sequence"> | |
692 <xsl:value-of select="substring($sequence, 1, 75)"/> | |
693 </xsl:variable> | |
694 <tr> | |
695 <td></td> | |
696 <td> | |
697 <xsl:call-template name="annotate_motif_names"> | |
698 <xsl:with-param name="sequence_index" select="$sequence_index"/> | |
699 <xsl:with-param name="sequence_name" select="$sequence_name"/> | |
700 <xsl:with-param name="current_sequence" select="$current_sequence" /> | |
701 </xsl:call-template> | |
702 </td> | |
703 </tr> | |
704 <tr> | |
705 <td style="width: 6em;"><xsl:value-of select ="$sequence_index"/></td> | |
706 <td><xsl:value-of select="$current_sequence"/></td> | |
707 </tr> | |
708 <xsl:variable name="new_sequence" select="substring($sequence, 76)"/> | |
709 <xsl:if test="string-length($new_sequence)"> | |
710 <xsl:call-template name="wrap_sequence"> | |
711 <xsl:with-param name="sequence" select="$new_sequence"/> | |
712 <xsl:with-param name="sequence_index" select="number($sequence_index) + 75"/> | |
713 <xsl:with-param name="sequence_name" select="$sequence_name"/> | |
714 </xsl:call-template> | |
715 </xsl:if> | |
716 </xsl:template> | |
717 | |
718 <xsl:template name="annotate_motif_names"> | |
719 <xsl:param name="sequence_index"/> | |
720 <xsl:param name="sequence_name"/> | |
721 <xsl:param name="input_sequence"/> | |
722 <xsl:param name="output_sequence"/> | |
723 <xsl:choose> | |
724 <xsl:when test="count(document('cisml.xml')/cis:cis-element-search/cis:pattern/cis:scanned-sequence[@name=$sequence_name]) = 1"> | |
725 </xsl:when> | |
726 </xsl:choose> | |
727 <xsl:for-each select="document('cisml.xml')/cis:cis-element-search/cis:pattern/cis:scanned-sequence[@name=$sequence_name]"> | |
728 <xsl:for-each select="./cis:matched-element[(@start >= $sequence_index) and (@start < ($sequence_index + 75))]"> | |
729 <xsl:sort select="@start" data-type="number" /> | |
730 <xsl:text> </xsl:text><xsl:value-of select="../../@name"/> | |
731 </xsl:for-each> | |
732 </xsl:for-each> | |
733 </xsl:template> | |
734 | |
735 <xsl:template name="annotate_pvalues"> | |
736 <xsl:param name="sequence_index"/> | |
737 <xsl:param name="sequence_name"/> | |
738 <pre> | |
739 <xsl:for-each select="document('cisml.xml')/cis:cis-element-search/cis:pattern/cis:scanned-sequence[@name=$sequence_name]"> | |
740 <xsl:for-each select="./cis:matched-element[(@start >= $sequence_index) and (@start < ($sequence_index + 75))]"> | |
741 <xsl:sort select="@start" data-type="number" /> | |
742 <xsl:text> </xsl:text><xsl:value-of select="@pvalue"/> | |
743 </xsl:for-each> | |
744 </xsl:for-each> | |
745 </pre> | |
746 </xsl:template> | |
747 | |
748 <xsl:template name="annotate_best_match"> | |
749 <xsl:param name="sequence_index"/> | |
750 <xsl:param name="sequence_name"/> | |
751 <pre> | |
752 <xsl:for-each select="document('cisml.xml')/cis:cis-element-search/cis:pattern/cis:scanned-sequence[@name=$sequence_name]"> | |
753 <xsl:for-each select="./cis:matched-element[(@start >= $sequence_index) and (@start < ($sequence_index + 75))]"> | |
754 <xsl:sort select="@start" data-type="number" /> | |
755 <xsl:text> </xsl:text><xsl:value-of select="document('fimo.xml')/fimo/motif[@name=./@name]/@best-possible-match"/> | |
756 </xsl:for-each> | |
757 </xsl:for-each> | |
758 </pre> | |
759 </xsl:template> | |
760 </xsl:stylesheet> | |
761 |