initial commit
[emacs-init.git] / nxhtml / tests / in / josh-091115-cancer_summary.xsl
1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
2                                 xmlns:set="http://exslt.org/sets">
3
4   <xsl:output method="html"/>
5   <xsl:output encoding="utf-8"/>
6   <xsl:output doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
7   <xsl:output doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
8
9   <xsl:template match="/">
10
11     <html>
12       <head>
13         <title>Cancer Summary: <xsl:value-of select="//individual/@name"/>&#160;<xsl:value-of select="//individual/@gender"/>&#160;<xsl:value-of select="//individual/@id"/></title>
14
15         <link rel="shortcut icon" href="/resources/report_resources/apipe_dashboard/images/gc_favicon.png" type="image/png" />
16
17         <link rel="stylesheet" href="/resources/report_resources/apipe_dashboard/css/master.css" type="text/css" media="screen" />
18         <link rel="stylesheet" href="/resources/report_resources/apipe_dashboard/css/tablesorter.css" type="text/css" media="screen" />
19         <script type="text/javascript" src="/resources/report_resources/jquery/jquery.js"></script>
20         <script type="text/javascript" src="/resources/report_resources/jquery/jquery.tablesorter.min.js"></script>
21         <script type="text/javascript">
22           $(document).ready(function() {
23           $("#tier_1_snps").tablesorter({
24           // sort on first column, ascending
25           // sortList: [[0,0]]
26           });
27
28           $("#tier_1_insertions").tablesorter({
29           // sort on first column, ascending
30           //sortList: [[0,0]]
31           });
32
33           $("#tier_1_deletions").tablesorter({
34           // sort on first column, ascending
35           //sortList: [[0,0]]
36           });
37           });
38         </script>
39         <link rel="stylesheet" href="/resources/report_resources/cancer_card/css/zoom2.css" type="text/css" media="screen"></link>
40         <script type="text/javascript" src="/resources/report_resources/cancer_card/js/dom-drag.js"></script>
41
42         <script type="text/javascript" src="/resources/report_resources/cancer_card/js/HotSpot2.js"></script>
43         <script type="text/javascript">
44           addEvent(window, 'load', function() {
45           HotSpotController.init("zoomImage",300, '<xsl:value-of select="//individual/circos-images/@large"/>','ZTbutton'); });
46
47           function addEvent(obj, evType, fn) {
48           if (obj.addEventListener) {
49           obj.addEventListener(evType, fn, false);
50           return true;
51           } else if (obj.attachEvent) {
52           var r = obj.attachEvent("on" + evType, fn);
53           return r;
54           } else {
55           return false;
56           }
57           }
58         </script>
59
60         <script type="text/javascript">
61                   $(document).ready(function() {
62                     $("input[type=checkbox]").click(function() {
63                       alert("Clicked: " + this.value);
64                         });
65                   });
66                 </script>
67
68         <style type="text/css" media="screen">
69           table.info_table_group td {
70           padding-right: 10px;
71           }
72
73           div.content_padding {
74           padding: 0 10px 20px 10px;
75           }
76
77           h3.group_header {
78           border-bottom: 2px solid #CCC;
79           }
80           div.circos_graph {
81           float: left;
82           width: 920px;
83           }
84
85                   form.status_selector {
86                     margin: 0;
87                         padding: 0;
88                     float: right;
89                     font-size: 85%;
90                     font-weight: normal;
91                   }
92
93                   form.status_selector table {
94                     margin: 0;
95                         padding: 0;
96                   }
97
98                   form.status_selector table td.lbl {
99                   padding-right: 10px;
100                   padding-left: 5px;
101                   }
102
103
104                   form.status_selector table td.table_lbl {
105                     font-weight: bold;
106                         padding-right: 8px;
107                         padding-left: 3px;
108                   }
109         </style>
110       </head>
111
112       <body>
113         <div class="container">
114           <div class="background">
115             <div class="page_header">
116               <table cellpadding="0" cellspacing="0" border="0">
117                 <tr>
118                   <td>
119                     <img src="/resources/report_resources/apipe_dashboard/images/gc_header_logo2.png" width="44" height="45" align="absmiddle" />
120                   </td>
121                   <td>
122                     <h1><xsl:value-of select="//individual/@name"/>&#160;<xsl:value-of select="//individual/@gender"/>&#160;<xsl:value-of select="//individual/@id"/>&#160;Cancer Summary</h1>
123                   </td>
124                 </tr>
125               </table>
126             </div>
127             <div class="page_padding">
128               <!-- <h2 class="page_title icon_instrument_data">Flow Cell <xsl:value-of select="//flow-cell/@id"/> Status</h2> -->
129               <table cellpadding="0" cellspacing="0" border="0" class="info_table_group">
130                 <tr>
131                   <td>
132                     <h3 class="group_header">Clinical Data</h3>
133                     <table border="0" cellpadding="0" cellspacing="0">
134                       <tr>
135                         <td>
136                           <table border="0" cellpadding="0" cellspacing="0" class="info_table" width="100%">
137                             <colgroup>
138                               <col/>
139                               <col width="100%"/>
140                             </colgroup>
141                             <tr><td class="label">Name:</td><td class="value"><xsl:value-of select="//individual/@name"/></td></tr>
142                             <tr>
143                               <td class="label">Gender:</td>
144                               <td class="value">
145                                 <xsl:choose>
146                                   <xsl:when test="string(//individual/@gender)">
147                                     <xsl:value-of select="//individual/@gender"/>
148                                   </xsl:when>
149                                   <xsl:otherwise>
150                                     Not Provided
151                                   </xsl:otherwise>
152                                 </xsl:choose>
153                               </td>
154                             </tr>
155                             <tr><td class="label">ID:</td><td class="value"><xsl:value-of select="//individual/@id"/></td></tr>
156
157                           </table>
158                         </td>
159                         <td>
160                           <table border="0" cellpadding="0" cellspacing="0" class="info_table" width="100%" style="float: left;">
161                             <colgroup>
162                               <col/>
163                               <col width="100%"/>
164                             </colgroup>
165
166                             <tr><td class="label">Year Diagnosed:</td><td class="value"><xsl:value-of select="//clinical-data/@diagnosis-year"/></td></tr>
167                             <tr><td class="label">Diagnosed at Age:</td><td class="value"><xsl:value-of select="//clinical-data/@diagnosis-age"/></td></tr>
168                             <xsl:choose>
169                               <xsl:when test="//clinical-data/@alive = '1'">
170                                 <tr><td class="label">Survived:</td><td class="value">Yes</td></tr>
171                               </xsl:when>
172                               <xsl:otherwise>
173                                 <tr><td class="label">Survived:</td><td class="value">No</td></tr>
174                                 <tr><td class="label">Days Survived:</td><td class="value"><xsl:value-of select="//clinical-data/@days-survived"/></td></tr>
175                               </xsl:otherwise>
176                             </xsl:choose>
177                           </table>
178                         </td>
179                         <td>
180                           <table border="0" cellpadding="0" cellspacing="0" class="info_table" width="100%" style="float: left;">
181                             <colgroup>
182                               <col/>
183                               <col width="100%"/>
184                             </colgroup>
185
186                             <tr><td class="label">Treatment:</td><td class="value"><xsl:value-of select="//clinical-data/@treatment"/></td></tr>
187                             <tr><td class="label">Outcome:</td><td class="value"><xsl:value-of select="//clinical-data/@outcome"/></td></tr>
188                             <tr><td class="label">AMP:</td><td class="value"><xsl:value-of select="//clinical-data/@amp"/></td></tr>
189
190                           </table>
191                         </td>
192                       </tr>
193                     </table>
194                   </td>
195                   <td>
196                     <h3 class="group_header">Sequencing Stats</h3>
197                     <table border="0" cellpadding="0" cellspacing="0" class="info_table" width="100%">
198                       <colgroup>
199                         <col/>
200                         <col width="100%"/>
201                       </colgroup>
202                       <tr><td class="label">Normal Coverage:</td><td class="value"><xsl:value-of select="//samples/sample/models/model/@normal-haploid-coverage"/>X</td></tr>
203                       <tr><td class="label">Tumor Coverage:</td><td class="value"><xsl:value-of select="//samples/sample/models/model/@tumor-haploid-coverage"/>X</td></tr>
204                     </table>
205                   </td>
206                 </tr>
207               </table>
208               <hr style="margin-bottom: 0;"/>
209               <h2 class="report_section" style="margin-bottom: 0; margin-top: 0">Circos Graph&#160;&#160;&#160;<a id="ZTbutton" href="javascript: void(0);" style="font-size: 85%; font-weight: normal;">[toggle zoom]</a></h2>
210               <p id="ZTthumbnail">
211                 <img>
212                   <xsl:attribute name="id">zoomImage</xsl:attribute>
213                   <xsl:attribute name="src"><xsl:value-of select="//individual/circos-images/@small"/></xsl:attribute>
214                   <xsl:attribute name="width">920</xsl:attribute>
215                   <xsl:attribute name="height">920</xsl:attribute>
216                 </img>
217               </p>
218               <h2 class="report_section" style="margin-bottom: 0">Tier 1 SNPs
219 <!--                      <form class="status_selector">
220                                 <input type="hidden" name="table" value="tier_1_snps"/>
221                                 <table cellpadding="0" cellspacing="0">
222                                   <tr>
223                                         <td class="table_lbl">Show:</td>
224                                         <xsl:for-each select="set:distinct(//variants/snps/snp/@validation-status)">
225                                           <td class="cb">
226                                                 <input type="checkbox"><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></input>
227                                           </td>
228                                           <td class="lbl">
229                                                 <xsl:value-of select="."/>
230                                           </td>
231                                         </xsl:for-each>
232                                   </tr>
233                                 </table>
234                           </form>
235 -->
236
237                           </h2>
238               <table id="tier_1_snps" class="list tablesorter" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-top: 0;">
239                 <xsl:choose>
240                   <xsl:when test="count(//variants/snps/snp) > 0">
241
242                     <thead>
243                       <tr>
244                         <th>validation status</th>
245                         <th>chromosome</th>
246                         <th class="last">start</th>
247                         <th class="last">reference</th>
248                         <th class="last">variant</th>
249                         <th class="last">gene</th>
250                         <th class="last">amino acid change</th>
251                                                 <th class="last">trv type</th>
252                       </tr>
253                     </thead>
254                     <tbody>
255                       <xsl:for-each select="//variants/snps/snp">
256                         <xsl:sort select="@validation-status" data-type="text" order="ascending"/>
257                         <xsl:sort select="@chromosome" data-type="number" order="ascending"/>
258                         <tr>
259                                                   <td class="validation_status"><xsl:value-of select="@validation-status"/></td>
260                                                   <td><xsl:value-of select="@chromosome"/></td>
261                           <td class="last">
262                                                         <xsl:variable name="start" select="@start"/><xsl:value-of select="format-number($start, '#,##0')"/>
263                                                   </td>
264                           <td class="last"><xsl:value-of select="@reference-allele"/></td>
265                           <td class="last"><xsl:value-of select="@variant-allele"/></td>
266                           <td class="last"><xsl:value-of select="@gene"/></td>
267                           <td class="last"><xsl:value-of select="@amino-acid-change"/></td>
268                                                   <td class="last"><xsl:value-of select="@trv-type"/></td>
269                         </tr>
270                       </xsl:for-each>
271                     </tbody>
272                   </xsl:when>
273                   <xsl:otherwise>
274                     <tr><td><span class="note">None found.</span></td></tr>
275                   </xsl:otherwise>
276                 </xsl:choose>
277               </table>
278
279               <h2 class="report_section" style="margin-bottom: 0">Tier 1 Insertions</h2>
280               <table id="tier_1_insertions" class="list tablesorter" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-top: 0;">
281                 <xsl:choose>
282                   <xsl:when test="count(//variants/insertions/insertion) > 0">
283                     <thead>
284                       <tr>
285                                                 <th>validation status</th>
286                         <th>chromosome</th>
287                         <th class="last">start</th>
288                         <th class="last">stop</th>
289                         <th class="last">variant</th>
290                         <th class="last">gene</th>
291                         <th class="last">amino acid change</th>
292                         <th class="last">trv type</th>
293                       </tr>
294                     </thead>
295                     <tbody>
296                       <xsl:for-each select="//variants/insertions/insertion">
297                         <xsl:sort select="@validation-status" data-type="text" order="ascending"/>
298                         <xsl:sort select="@chromosome" data-type="number" order="ascending"/>
299                         <tr>
300                           <td class="validation_status"><xsl:value-of select="@validation-status"/></td>
301                           <td><xsl:value-of select="@chromosome"/></td>
302                           <td class="last">
303                                                         <xsl:variable name="start" select="@start"/><xsl:value-of select="format-number($start, '#,##0')"/>
304                                                   </td>
305                           <td class="last">
306                                                         <xsl:variable name="stop" select="@stop"/><xsl:value-of select="format-number($stop, '#,##0')"/>
307                                                   </td>
308                           <td class="last"><xsl:value-of select="@variant-allele"/></td>
309                           <td class="last"><xsl:value-of select="@gene"/></td>
310                           <td class="last"><xsl:value-of select="@amino-acid-change"/></td>
311                                                   <td class="last"><xsl:value-of select="@trv-type"/></td>
312                         </tr>
313                       </xsl:for-each>
314                     </tbody>
315                   </xsl:when>
316                   <xsl:otherwise>
317                     <tr><td><span class="note">None found.</span></td></tr>
318                   </xsl:otherwise>
319                 </xsl:choose>
320               </table>
321
322               <h2 class="report_section" style="margin-bottom: 0">Tier 1 Deletions</h2>
323               <table id="tier_1_deletions" class="list tablesorter" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-top: 0;">
324                 <xsl:choose>
325                   <xsl:when test="count(//variants/deletions/deletion) > 0">
326                     <thead>
327                       <tr>
328                         <th>validation status</th>
329                         <th>chromosome</th>
330                         <th class="last">start</th>
331                         <th class="last">stop</th>
332                         <th class="last">reference</th>
333                         <th class="last">gene</th>
334                         <th class="last">amino acid change</th>
335                                                 <th class="last">trv type</th>
336                       </tr>
337                     </thead>
338                     <tbody>
339                       <xsl:for-each select="//variants/deletions/deletion">
340                         <xsl:sort select="@validation-status" data-type="text" order="ascending"/>
341                         <xsl:sort select="@chromosome" data-type="number" order="ascending"/>
342                         <tr>
343                           <td class="validation_status"><xsl:value-of select="@validation-status"/></td>
344                           <td><xsl:value-of select="@chromosome"/></td>
345                           <td class="last">
346                                                         <xsl:variable name="start" select="@start"/><xsl:value-of select="format-number($start, '#,##0')"/>
347                                                   </td>
348                           <td class="last">
349                                                         <xsl:variable name="stop" select="@stop"/><xsl:value-of select="format-number($stop, '#,##0')"/>
350                                                   </td>
351                           <td class="last"><xsl:value-of select="@reference-allele"/></td>
352                           <td class="last"><xsl:value-of select="@gene"/></td>
353                           <td class="last"><xsl:value-of select="@amino-acid-change"/></td>
354                                                   <td class="last"><xsl:value-of select="@trv-type"/></td>
355                         </tr>
356                       </xsl:for-each>
357                     </tbody>
358                   </xsl:when>
359                   <xsl:otherwise>
360                     <tr><td><span class="note">None found.</span></td></tr>
361                   </xsl:otherwise>
362                 </xsl:choose>
363               </table>
364
365               <h2 class="report_section" style="margin-bottom: 0;">Structural Variations (translocations)</h2>
366               <table id="sv_translocations" class="list" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-top: 0;">
367                 <xsl:choose>
368                   <xsl:when test="count(//structural-variants/translocations/translocation) > 0">
369                     <thead>
370                       <tr>
371                         <th>validation status</th>
372                         <th class="last">chromosome</th>
373                         <th class="last">position</th>
374                         <th>&#160;</th>
375                         <th class="last">chromosome</th>
376                         <th class="last">position</th>
377                       </tr>
378                     </thead>
379                     <tbody>
380                       <xsl:for-each select="//structural-variants/translocations/translocation">
381                         <xsl:sort select="@validation-status" data-type="text" order="ascending"/>
382                         <xsl:sort select="start/@chromosome" data-type="number" order="ascending"/>
383                         <tr>
384                           <td class="validation_status"><xsl:value-of select="@validation-status"/></td>
385                           <td class="last"><xsl:value-of select="start/@chromosome"/></td>
386                           <td class="last">
387                                                         <xsl:variable name="start_position" select="start/@position"/><xsl:value-of select="format-number($start_position, '#,##0')"/>
388                                                   </td>
389
390                           <td class="last"><span style="font-size: 100%; font-weight: bold;">&#8594;</span></td>
391
392                           <td class="last"><xsl:value-of select="stop/@chromosome"/></td>
393                           <td class="last">
394                                                         <xsl:variable name="stop_position" select="stop/@position"/><xsl:value-of select="format-number($stop_position, '#,##0')"/>
395                                                   </td>
396                         </tr>
397                       </xsl:for-each>
398                     </tbody>
399                   </xsl:when>
400                   <xsl:otherwise>
401                     <tr><td><span class="note">None found.</span></td></tr>
402                   </xsl:otherwise>
403                 </xsl:choose>
404               </table>
405
406               <h2 class="report_section" style="margin-bottom: 0;">Structural Variations (insertions)</h2>
407               <table id="sv_insertions" class="list" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-top: 0;">
408                 <tbody>
409                   <xsl:choose>
410                     <xsl:when test="count(//structural-variants/insertions/insertion) > 0">
411                       <thead>
412                         <tr>
413                                                   <th>validation status</th>
414                           <th class="last">chromosome</th>
415                           <th class="last">start</th>
416                           <th class="last">stop</th>
417                           <th class="last">size</th>
418                         </tr>
419                       </thead>
420                       <xsl:for-each select="//structural-variants/insertions/insertion">
421                         <xsl:sort select="@validation-status" data-type="number" order="ascending"/>
422                         <xsl:sort select="start/@chromosome" data-type="number" order="ascending"/>
423                         <tr>
424                           <td class="validation_status"><xsl:value-of select="@validation-status"/></td>
425                           <td class="last"><xsl:value-of select="start/@chromosome"/></td>
426                           <td class="last">
427                                                         <xsl:variable name="start_position" select="start/@position"/><xsl:value-of select="format-number($start_position, '#,##0')"/>
428                                                   </td>
429                           <td class="last">
430                                                         <xsl:variable name="stop_position" select="stop/@position"/><xsl:value-of select="format-number($stop_position, '#,##0')"/>
431                                                   </td>
432                                                   <xsl:variable name="size" select="@size"/><xsl:value-of select="format-number($size, '#,##0')"/>
433
434                         </tr>
435                       </xsl:for-each>
436                     </xsl:when>
437                     <xsl:otherwise>
438                       <tr><td><span class="note">None found.</span></td></tr>
439                     </xsl:otherwise>
440                   </xsl:choose>
441                 </tbody>
442               </table>
443
444               <h2 class="report_section" style="margin-bottom: 0;">Structural Variations (deletions)</h2>
445               <table id="sv_deletions" class="list" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-top: 0;">
446                 <xsl:choose>
447                   <xsl:when test="count(//structural-variants/deletions/deletion) > 0">
448                     <thead>
449                       <tr>
450                         <th>validation status</th>
451                         <th class="last">chromosome</th>
452                         <th class="last">start</th>
453                         <th class="last">stop</th>
454                         <th class="last">size</th>
455                       </tr>
456                     </thead>
457                     <tbody>
458                       <xsl:for-each select="//structural-variants/deletions/deletion">
459                         <xsl:sort select="@validation-status" data-type="number" order="ascending"/>
460                         <xsl:sort select="start/@chromosome" data-type="number" order="ascending"/>
461                         <tr>
462                           <td class="validation_status"><xsl:value-of select="@validation-status"/></td>
463                           <td class="last"><xsl:value-of select="start/@chromosome"/></td>
464                           <td class="last">
465                                                         <xsl:variable name="start_position" select="start/@position"/><xsl:value-of select="format-number($start_position, '#,##0')"/>
466                                                   </td>
467                           <td class="last">
468                                                         <xsl:variable name="stop_position" select="stop/@position"/><xsl:value-of select="format-number($stop_position, '#,##0')"/>
469                                                   </td>
470                           <td class="last">
471                                                         <xsl:variable name="size" select="@size"/><xsl:value-of select="format-number($size, '#,##0')"/>
472                                                   </td>
473                         </tr>
474                       </xsl:for-each>
475                     </tbody>
476                   </xsl:when>
477                   <xsl:otherwise>
478                     <tr><td><span class="note">None found.</span></td></tr>
479                   </xsl:otherwise>
480                 </xsl:choose>
481               </table>
482             </div>
483           </div>
484         </div>
485       </body>
486     </html>
487
488   </xsl:template>
489
490 </xsl:stylesheet>