45
|
1 package html;
|
|
2
|
|
3 use strict;
|
|
4 use warnings;
|
|
5 use File::Basename;
|
|
6
|
|
7 use Exporter;
|
|
8 our @ISA = qw( Exporter );
|
|
9 our @EXPORT_OK = qw( &main_page &details_pages &menu_page &ppp_page );
|
|
10
|
|
11 sub main_page
|
|
12 {
|
|
13 my ( $dir, $file, $list_mainTabP, $current, $ma, $ma_uni, $dir_root ) = @_;
|
|
14 my ( $futHashP, $uniqueTabP, $randTabP, $pngTabP ) = get_genome ( $dir, $dir_root );
|
|
15
|
|
16 open my $h, '>', $file || die "cannot create $file $!\n";
|
|
17 header ( $h );
|
|
18 navbar ( $h, $list_mainTabP, $current );
|
|
19 print $h "<div class=\"container\"><p><a class=\"btn\" href=\"$current-sub.html\">View details »</a></p></div>\n";
|
|
20 futurette( $h, $current, $pngTabP, $futHashP );
|
|
21 print $h "<div class=\"container\"><h2>mappers #: $ma</h2><h2>unique mappers #: $ma_uni</h2> </div>\n";
|
|
22 carousel2( $h, $uniqueTabP, $randTabP, $dir_root );
|
|
23 footer($h);
|
|
24 close $h;
|
|
25 }
|
|
26
|
|
27 sub menu_page
|
|
28 {
|
|
29 my ( $dir, $file, $list_mainTabP, $current, $min, $max, $simin, $simax, $pimin, $pimax, $dir_root ) = @_;
|
|
30 my $html_ref = $1 if $dir =~ /$dir_root(.*)/;
|
|
31 open my $h, '>', $file || die "cannot create $file $!\n";
|
|
32 header($h);
|
|
33 navbar ( $h, $list_mainTabP, $current );
|
|
34 span( $h, $current, $min, $max, $simin, $simax, $pimin, $pimax );
|
|
35 print $h " <div class=\"container\"> <div class=\"row text-center\"> <img src=\"$html_ref/pie_chart.png\"/><br />\n";
|
|
36 print $h " <A HREF=\"$html_ref/repartition.txt\">text file</A><br/>\n </div></div>";
|
|
37 footer($h);
|
|
38 close $h;
|
|
39 }
|
|
40
|
|
41 sub details_pages
|
|
42 {
|
|
43 my ( $dir_details, $prefix, $list_mainTabP, $current, $misTE, $dir_root, $ppp ) = @_;
|
|
44 my ($Hex, $HTE, $HG, $NonUniTE, $NonUniG, $UniG ) = get_subgroups( $dir_details, $current, $misTE, $dir_root );
|
|
45
|
|
46 my $html_ref = $1.'-PPP.html' if $prefix =~ /$dir_root(.*)/;
|
|
47 open my $h, '>', $prefix.'-TEs.html' || die "cannot create $prefix-TEs.html $!\n";
|
|
48 header($h);
|
|
49 navbar ( $h, $list_mainTabP, $current );
|
|
50 if ( $prefix =~ /piRNAs$/ && $ppp eq 'true' )
|
|
51 {
|
|
52 print $h " <div class=\"container\">";
|
|
53 print $h " <p><a class=\"btn\" href=\"$html_ref\">Ping Pong Partners</a></p>\n";
|
|
54 print $h "</div>";
|
|
55 }
|
|
56 fut($h,'Transposable elements',$HTE);
|
|
57 carousel($h,$NonUniTE,$dir_root);
|
|
58 footer($h);
|
|
59 close $h;
|
|
60
|
|
61 open $h, '>', $prefix.'-genome.html' || die "cannot create $prefix-genome.html $!\n";
|
|
62 header($h);
|
|
63 navbar ( $h, $list_mainTabP, $current );
|
|
64 fut($h,'Genome',$HG);
|
|
65 carousel2($h,$UniG, $NonUniG,$dir_root);
|
|
66 footer($h);
|
|
67 close $h;
|
|
68
|
|
69 open $h, '>', $prefix.'-transcripts.html' || die "cannot create $prefix-transcripts.html $!\n";
|
|
70 header($h);
|
|
71 navbar ( $h, $list_mainTabP, $current );
|
|
72 fut($h,'transcripts',$Hex);
|
|
73 footer($h);
|
|
74 close $h;
|
|
75 }
|
|
76
|
|
77 sub ppp_page
|
|
78 {
|
|
79 my ( $dir, $file, $list_mainTabP, $current, $ppp, $dir_root ) = @_;
|
|
80
|
|
81 my $ppp_file = $ppp.'ppp.txt';
|
|
82 open my $h, '>', $file || die "cannot create $file $!\n";
|
|
83 header($h);
|
|
84 navbar ( $h, $list_mainTabP, $current );
|
|
85 print $h '<div class="container"> <table class="wb-tables table table-striped table-hover">'."\n";
|
|
86 print $h '<thead>
|
|
87 <tr>
|
|
88 <th data-sortable="true">ID</th>
|
|
89 <th data-sortable="true">overlap sum</th>
|
|
90 <th data-sortable="true">ten overlap sum</th>
|
|
91 <th data-sortable="true">mean</th>
|
|
92 <th data-sortable="true">standard deviation</th>
|
|
93 <th data-sortable="true">z-score</th>
|
|
94 <th data-sortable="true">p-value</th>
|
|
95 </tr>
|
|
96 </thead>
|
|
97 <tbody>';
|
|
98
|
|
99 open my $f, '<', $ppp_file || die "cannot open $ppp_file $!\n";
|
|
100 while ( <$f> )
|
|
101 {
|
|
102 chomp;
|
|
103 print $h '<tr>';
|
|
104 my ( $id, $sum, $ten, $mean, $sd, $zscore, $prob) = split /\t/, $_;
|
|
105 if( -d "$ppp/$id" )
|
|
106 {
|
|
107 my $sub_html = $ppp.$id.'.html';
|
|
108 my $sub_html_ref = $1.$id if $ppp =~ /$dir_root(.*)/;
|
|
109 print $h "<td> <a href=\"$sub_html_ref.html\">$id</a> </td>";
|
|
110
|
|
111 open my $sub, '>', $sub_html || die "cannot create $sub_html\n";
|
|
112 {
|
|
113 header($sub);
|
|
114 print $sub "
|
|
115 <div align=\"center\">
|
|
116 <h2>$id</h2>
|
|
117 <p> <img class=\"featurette-image\" src=\"$id/histogram.png\"/></p>
|
|
118 <p><a href=\"$id/overlap_size.txt\">ping pong signature</a></p>
|
|
119 <p><a href=\"$id/sensPPP.txt\">sense reads with PPP</a></p>
|
|
120 <p><a href=\"$id/antisensPPP.txt\">reverse reads with PPP</a></p>
|
|
121 <p><a href=\"$id/sens.txt\">sense reads without PPP</a></p>
|
|
122 <p><a href=\"$id/antisens.txt\">reverse reads without PPP</a></p>
|
|
123 </div>";
|
|
124 footer($sub);
|
|
125 }
|
|
126 close $sub;
|
|
127
|
|
128 }
|
|
129 else { print $h "<td> $id </td>\n"; }
|
|
130 print $h "<td> $sum </td><td> $ten </td><td> $mean </td><td> $sd </td><td> $zscore </td><td> $prob </td>\n";
|
|
131
|
|
132 print $h '</tr>';
|
|
133 }
|
|
134 close $f;
|
|
135 print $h "</tbody></table></div>";
|
|
136 footer($h);
|
|
137 close $h;
|
|
138 }
|
|
139
|
|
140 sub get_genome
|
|
141 {
|
|
142 my ( $dir, $dir_root ) = @_;
|
|
143 my ( %hash, @group, @Unique, @NonUnique, @png );
|
|
144
|
|
145 my $fut = $dir.'/*';
|
|
146 my @fut = glob $fut;
|
|
147
|
|
148
|
|
149 foreach my $fr ( @fut )
|
|
150 {
|
|
151 my $f = $1 if $fr =~ /$dir_root(.*)/;
|
|
152 if ( $fr =~ /.*Gviz/ )
|
|
153 {
|
|
154 my $nu = $fr.'/rand/*';
|
|
155 @NonUnique = glob $nu;
|
|
156 my $u = $fr.'/unique/*';
|
|
157 @Unique = glob $u;
|
|
158 }
|
|
159 elsif ( $f =~ /.*distribution\.txt$/ ) { $hash{'mappers size distribution (txt)'} = $f; }
|
|
160 elsif ( $f =~ /.*distribution\.png$/ ) { push @png, $f; }
|
|
161 elsif ( $f =~ /.*unique\.fastq$/ ) { $hash{'unique mappers (fastq.gz)'} = $f.'.gz'; `gzip $fr`; }
|
|
162 elsif ( $f =~ /.*rejected\.fastq$/ ) { $hash{'unmapped (fastq.gz)'} = $f.'.gz'; `gzip $fr`; }
|
|
163 elsif ( $f =~ /.*all\.fastq$/ ) { $hash{'mappers (fastq.gz)'} = $f.'.gz'; `gzip $fr`; }
|
|
164 elsif ( $f =~ /.*dup_unique\.txt$/ ) { $hash{'unique mappers (txt)'} = $f; }
|
|
165 elsif ( $f =~ /.*dup_mapnum\.txt$/ ) { $hash{'mappers (txt)'} = $f; }
|
|
166 elsif ( $f =~ /.*dup_nonmapp\.txt$/ ) { $hash{'unmapped (txt)'} = $f; }
|
|
167 elsif ( $f =~ /.*_unique_sorted\.bam$/ ) { $hash{'unique alignment (bam)'} = $f; }
|
|
168 elsif ( $f =~ /.*_sorted\.bam$/ ) { $hash{'alignment (bam)'} = $f; }
|
|
169 elsif ( $f =~ /.*unique_plus.bedgraph/) { $hash{'bedgraph unique plus strand'} = $f; }
|
|
170 elsif ( $f =~ /.*unique_minus.bedgraph/) { $hash{'bedgraph unique minus strand'} = $f; }
|
|
171 elsif ( $f =~ /.*plus.bedgraph/) { $hash{'bedgraph plus strand'} = $f; }
|
|
172 elsif ( $f =~ /.*minus.bedgraph/) { $hash{'bedgraph minus strand'} = $f; }
|
|
173 else { unlink $fr; }
|
|
174 }
|
|
175 return (\%hash, \@Unique, \@NonUnique, \@png);
|
|
176 }
|
|
177
|
|
178 sub span
|
|
179 {
|
|
180 my ( $file, $name, $min, $max, $simin, $simax, $pimin, $pimax ) = @_;
|
|
181
|
|
182 print $file "
|
|
183 <div class=\"container text-center\">
|
|
184 <div class=\"row-fluid\">
|
|
185 <div class=\"span6\">
|
|
186 <h2>Bonafide</h2>
|
|
187 reads of size between $min and $max<br>with no mi, sn, t and r RNAs
|
|
188 <p><a class=\"btn\" href=\"$name-bonafide_reads-genome.html\">Genome</a></p>
|
|
189 <p><a class=\"btn\" href=\"$name-bonafide_reads-TEs.html\">TE</a></p>
|
|
190 <p><a class=\"btn\" href=\"$name-bonafide_reads-transcripts.html\">Transcripts</a></p>
|
|
191 <div class=\"row-fluid\">
|
|
192 <div class=\"span6\">
|
|
193 <h2>siRNAs</h2>
|
|
194 bonafide reads of size between $simin and $simax
|
|
195 <p><a class=\"btn\" href=\"$name-siRNAs-genome.html\">Genome</a></p>
|
|
196 <p><a class=\"btn\" href=\"$name-siRNAs-TEs.html\">TE</a></p>
|
|
197 <p><a class=\"btn\" href=\"$name-siRNAs-transcripts.html\">Transcripts</a></p>
|
|
198 </div>
|
|
199 <div class=\"span6\">
|
|
200 <h2>piRNAs</h2>
|
|
201 bonafide reads of size between $pimin and $pimax
|
|
202 <p><a class=\"btn\" href=\"$name-piRNAs-genome.html\">Genome</a></p>
|
|
203 <p><a class=\"btn\" href=\"$name-piRNAs-TEs.html\">TE</a></p>
|
|
204 <p><a class=\"btn\" href=\"$name-piRNAs-transcripts.html\">Transcripts</a></p>
|
|
205 </div>
|
|
206 </div>
|
|
207 </div>
|
|
208 <div class=\"span6\">
|
|
209 <h2>miRNAs</h2>
|
|
210 <p><a class=\"btn\" href=\"$name-miRNAs-genome.html\">Genome</a></p>
|
|
211 <p><a class=\"btn\" href=\"$name-miRNAs-TEs.html\">TE</a></p>
|
|
212 <p><a class=\"btn\" href=\"$name-miRNAs-transcripts.html\">Transcripts</a></p>
|
|
213 </div>
|
|
214 </div>
|
|
215 </div>
|
|
216 ";
|
|
217 }
|
|
218
|
|
219 sub get_subgroups
|
|
220 {
|
|
221 my ( $dir, $name, $misTE, $dir_root ) = @_;
|
|
222 my (%Hex, %HTE, %HG, @group, @png, @pngTE, @NonUniTE, @UniG, @NonUniG );
|
|
223
|
|
224 my $fut = $dir.'/*';
|
|
225 my @fut = glob $fut;
|
|
226 my $f ='';
|
|
227 foreach my $fr ( @fut )
|
|
228 {
|
|
229 $f = $1 if $fr =~ /$dir_root(.*)/;
|
|
230
|
|
231 if ( $f =~ /genome_unique_sorted\.bam$/ ) { $HG{'genome unique mappers (sorted bam)'} = $f; }
|
|
232 elsif ( $f =~ /genome_sorted\.bam$/ ) { $HG{'genome mappers (sorted bam)'} = $f; }
|
|
233 elsif ( $f =~ /miRNAs_reads_counts\.txt$/ ) { $HG{'miRNAs per type (txt)'} = $f; }
|
|
234 elsif ( $f =~ /genome_unique_plus\.bedgraph$/) { $HG{'bedgraph unique plus strand'} = $f; }
|
|
235 elsif ( $f =~ /genome_unique_minus\.bedgraph$/) { $HG{'bedgraph unique minus strand'} = $f; }
|
|
236 elsif ( $f =~ /genome_plus\.bedgraph$/) { $HG{'bedgraph plus strand'} = $f; }
|
|
237 elsif ( $f =~ /genome_minus\.bedgraph$/) { $HG{'bedgraph minus strand'} = $f; }
|
|
238 elsif ( $f =~ /TEs_plus\.bedgraph$/) { $HTE{'bedgraph plus strand'} = $f; }
|
|
239 elsif ( $f =~ /TEs_minus\.bedgraph$/) { $HTE{'bedgraph minus strand'} = $f; }
|
|
240 elsif ( $f =~ /transcripts_sorted\.bam$/) { $Hex{'transcripts mappers (sorted bam)'} = $f;}
|
|
241 elsif ( $f =~ /transcripts_unique_sorted\.bam$/) { $Hex{'transcripts unique mappers (sorted bam)'} = $f;}
|
|
242 elsif ( $f =~ /transcripts_reads_counts\.txt$/) { $Hex{'read number per transcript (txt)'} = $f;}
|
|
243 elsif ( $f =~ /TEs_reads_counts\.txt$/) { $HTE{"read number per TE 0 to $misTE mismatches (txt)"} = $f; }
|
|
244 elsif ( $f =~ /TEs_reads_counts_mismatches\.txt$/) { $HTE{"read number per TE with 1 to $misTE mismatches (txt)"} = $f; }
|
|
245 elsif ( $f =~ /TEs_reads_counts_nomismatches\.txt$/) { $HTE{'read number per TE with no mismatch (txt)'} = $f; }
|
|
246 elsif ( $f =~ /TEs_unique_sorted\.bam$/) { $HTE{'TEs unique mappers (sorted bam)'} = $f; }
|
|
247 elsif ( $f =~ /TEs_sorted\.bam$/) { $HTE{'TEs mappers (sorted bam)'} = $f; }
|
|
248 elsif ( $fr =~ /.*Gviz_TEs/ )
|
|
249 {
|
|
250 my $nu = $fr.'/*';
|
|
251 @NonUniTE = glob $nu;
|
|
252 }
|
|
253 elsif ( $fr =~ /.*Gviz_genome/ )
|
|
254 {
|
|
255 my $nu = $fr.'/rand/*';
|
|
256 @NonUniG = glob $nu;
|
|
257 my $u = $fr.'/unique/*';
|
|
258 @UniG = glob $u;
|
|
259 }
|
|
260 else { unlink $fr; }
|
|
261 }
|
|
262 return (\%Hex, \%HTE, \%HG, \@NonUniTE, \@NonUniG, \@UniG);
|
|
263 }
|
|
264
|
|
265 sub header
|
|
266 {
|
|
267 my $file = shift;
|
|
268 print $file "
|
|
269 <!DOCTYPE html>
|
|
270 <html lang=\"en\">
|
|
271 <head>
|
|
272 <meta charset=\"utf-8\">
|
|
273 <title>pipeline</title>
|
|
274 <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
|
275 <meta name=\"description\" content=\"\">
|
|
276 <meta name=\"author\" content=\"\">
|
|
277 <!-- Le styles -->
|
|
278 <link href=\"css/bootstrap.css\" rel=\"stylesheet\">
|
|
279 <link href=\"css/bootstrap-table.css\" rel=\"stylesheet\">
|
|
280 <style type=\"text/css\">
|
|
281 body {
|
|
282 padding-top: 60px;
|
|
283 padding-bottom: 40px;
|
|
284 }
|
|
285 div#page {
|
|
286 width: 940px;
|
|
287 background-color: #fff;
|
|
288 margin: 0 auto;
|
|
289 text-align: left;
|
|
290 border-color: #fff;
|
|
291 border-style: none solid solid;
|
|
292 border-width: medium 1px 1px;
|
|
293 }
|
|
294
|
|
295 div.content {
|
|
296 display: none;
|
|
297 float: right;
|
|
298 width: 550px;
|
|
299 }
|
|
300 div.content a, div.navigation a {
|
|
301 text-decoration: none;
|
|
302 color: #777;
|
|
303 }
|
|
304 div.content a:focus, div.content a:hover, div.content a:active {
|
|
305 text-decoration: underline;
|
|
306 }
|
|
307
|
|
308 div.controls {
|
|
309 margin-top: 5px;
|
|
310 height: 23px;
|
|
311 }
|
|
312
|
|
313 div.controls a {
|
|
314 padding: 5px;
|
|
315 }
|
|
316 div.ss-controls {
|
|
317 float: left;
|
|
318 }
|
|
319 div.nav-controls {
|
|
320 float: right;
|
|
321 }
|
|
322 div.slideshow-container {
|
|
323 position: relative;
|
|
324 clear: both;
|
|
325 height: 502px; /* This should be set to be at least the height of the largest image in the slideshow */
|
|
326 }
|
|
327 div.loader {
|
|
328 position: absolute;
|
|
329 top: 0;
|
|
330 left: 0;
|
|
331 background-image: url('loader.gif');
|
|
332 background-repeat: no-repeat;
|
|
333 background-position: center;
|
|
334 width: 550px;
|
|
335 height: 502px; /* This should be set to be at least the height of the largest image in the slideshow */
|
|
336 }
|
|
337 div.slideshow {
|
|
338
|
|
339 }
|
|
340
|
|
341 div.slideshow span.image-wrapper {
|
|
342 display: block;
|
|
343 position: absolute;
|
|
344 top: 0;
|
|
345 left: 0;
|
|
346 }
|
|
347 div.slideshow a.advance-link {
|
|
348 display: block;
|
|
349 width: 550px;
|
|
350 height: 502px; /* This should be set to be at least the height of the largest image in the slideshow */
|
|
351 line-height: 502px; /* This should be set to be at least the height of the largest image in the slideshow */
|
|
352 text-align: center;
|
|
353 }
|
|
354 div.slideshow a.advance-link:hover, div.slideshow a.advance-link:active, div.slideshow a.advance-link:visited {
|
|
355 text-decoration: none;
|
|
356 }
|
|
357 div.slideshow img {
|
|
358 vertical-align: middle;
|
|
359 border: 1px solid #ccc;
|
|
360 }
|
|
361
|
|
362 div.image-title {
|
|
363 font-weight: bold;
|
|
364 font-size: 1.4em;
|
|
365 }
|
|
366
|
|
367 div.image-desc {
|
|
368 line-height: 1.3em;
|
|
369 padding-top: 12px;
|
|
370 }
|
|
371 div.navigation {
|
|
372
|
|
373 }
|
|
374 ul.thumbs {
|
|
375 clear: both;
|
|
376 margin: 0;
|
|
377 padding: 0;
|
|
378 }
|
|
379 ul.thumbs li {
|
|
380 float: none;
|
|
381 padding: 0;
|
|
382 margin: 0;
|
|
383 list-style: none;
|
|
384 }
|
|
385 a.thumb {
|
|
386 padding: 0;
|
|
387 display: inline;
|
|
388 border: none;
|
|
389 }
|
|
390 ul.thumbs li.selected a.thumb {
|
|
391 color: #000;
|
|
392 font-weight: bold;
|
|
393 }
|
|
394 a.thumb:focus {
|
|
395 outline: none;
|
|
396 }
|
|
397 ul.thumbs img {
|
|
398 border: none;
|
|
399 display: block;
|
|
400 }
|
|
401 div.pagination {
|
|
402 clear: both;
|
|
403 }
|
|
404 div.navigation div.top {
|
|
405 margin-bottom: 12px;
|
|
406 height: 11px;
|
|
407 }
|
|
408 div.navigation div.bottom {
|
|
409 margin-top: 12px;
|
|
410 }
|
|
411 div.pagination a, div.pagination span.current, div.pagination span.ellipsis {
|
|
412 display: block;
|
|
413 float: left;
|
|
414 margin-right: 2px;
|
|
415 padding: 4px 7px 2px 7px;
|
|
416 border: 1px solid #ccc;
|
|
417 }
|
|
418 div.pagination a:hover {
|
|
419 background-color: #eee;
|
|
420 text-decoration: none;
|
|
421 }
|
|
422 div.pagination span.current {
|
|
423 font-weight: bold;
|
|
424 background-color: #000;
|
|
425 border-color: #000;
|
|
426 color: #fff;
|
|
427 }
|
|
428 div.pagination span.ellipsis {
|
|
429 border: none;
|
|
430 padding: 5px 0 3px 2px;
|
|
431 }
|
|
432
|
|
433 div.download {
|
|
434 float: right;
|
|
435 }
|
|
436
|
|
437 div.caption-container {
|
|
438 position: relative;
|
|
439 clear: left;
|
|
440 height: 75px;
|
|
441 }
|
|
442 span.image-caption {
|
|
443 display: block;
|
|
444 position: absolute;
|
|
445 width: 550px;
|
|
446 top: 0;
|
|
447 left: 0;
|
|
448 }
|
|
449 div.caption {
|
|
450 padding: 12px;
|
|
451 }
|
|
452
|
|
453 /* Featurettes
|
|
454 ------------------------- */
|
|
455
|
|
456 .featurette {
|
|
457 padding-top: 20px; /* Vertically center images part 1: add padding above and below text. */
|
|
458 overflow: hidden; /* Vertically center images part 2: clear their floats. */
|
|
459 text-align: center;
|
|
460 }
|
|
461
|
|
462 .featurette-p
|
|
463 {
|
|
464 text-align: left;
|
|
465 }
|
|
466
|
|
467 .featurette-image {
|
|
468 margin-top: 10px; /* Vertically center images part 3: negative margin up the image the same amount of the padding to center it. */
|
|
469 width: 450px;
|
|
470 height: auto;
|
|
471 }
|
|
472
|
|
473 </style>
|
|
474 <link href=\"css/bootstrap-responsive.css\" rel=\"stylesheet\">
|
|
475 </head>
|
|
476 <body>
|
|
477 ";
|
|
478 }
|
|
479
|
|
480 sub navbar
|
|
481 {
|
|
482 my ( $file, $fastq, $actif ) = @_;
|
|
483
|
|
484 print $file "
|
|
485 <div class=\"navbar navbar-inverse navbar-fixed-top\">
|
|
486 <div class=\"navbar-inner\">
|
|
487 <div class=\"container\">
|
|
488 <button type=\"button\" class=\"btn btn-navbar\" data-toggle=\"collapse\" data-target=\".nav-collapse\">
|
|
489 <span class=\"icon-bar\"></span>
|
|
490 <span class=\"icon-bar\"></span>
|
|
491 <span class=\"icon-bar\"></span>
|
|
492 </button>
|
|
493 <a class=\"brand\" href=\"report.txt\">Report</a>
|
|
494 <div class=\"nav-collapse collapse\">
|
|
495 <ul class=\"nav\">
|
|
496 ";
|
|
497 for (my $i = 0 ; $i <= $#{$fastq}; $i++)
|
|
498 {
|
|
499 # my $fa = basename($fastq->[$i],'.dat');
|
|
500 my $fa = $fastq->[$i];
|
|
501 if ($actif eq $fa){ print $file "<li class=\"active\"><a href=\"$fastq->[$i].html\">$fa</a></li>";}
|
|
502 else {print $file "<li><a href=\"$fastq->[$i].html\">$fa</a></li>" ;}
|
|
503 }
|
|
504 print $file "
|
|
505 </ul>
|
|
506 </div><!--/.nav-collapse -->
|
|
507 </div>
|
|
508 </div>
|
|
509 </div>";
|
|
510 }
|
|
511
|
|
512 sub footer
|
|
513 {
|
|
514 my $file = shift;
|
|
515 print $file "
|
|
516 <!-- FOOTER -->
|
|
517 <div class=\"container\">
|
|
518 <footer>
|
|
519
|
|
520 </footer>
|
|
521 </div>
|
|
522 <!-- Le javascript
|
|
523 ================================================== -->
|
|
524 <!-- Placed at the end of the document so the pages load faster -->
|
|
525 <script type=\"text/javascript\" src=\"js/filter.js\"></script>
|
|
526 <script type=\"text/javascript\" src=\"js/jquery.js\"></script>
|
|
527 <script type=\"text/javascript\" src=\"js/jquery-1.3.2.js\"></script>
|
|
528 <script type=\"text/javascript\" src=\"js/jquery.galleriffic.js\"></script>
|
|
529 <script type=\"text/javascript\" src=\"js/jquery.opacityrollover.js\"></script>
|
|
530 <script type=\"text/javascript\" src=\"js/bootstrap-table.js\"></script>
|
|
531 <script type=\"text/javascript\" src=\"js/bootstrap.min.js\"></script>
|
|
532 <script type=\"text/javascript\">
|
|
533 jQuery(document).ready(function(\$) {
|
|
534 // We only want these styles applied when javascript is enabled
|
|
535 \$('div.navigation').css({'width' : '300px', 'float' : 'left'});
|
|
536 \$('div.content').css('display', 'block');
|
|
537
|
|
538 \$(\".each-gallery\").each(function(i){
|
|
539 // Initially set opacity on thumbs and add
|
|
540 // additional styling for hover effect on thumbs
|
|
541 var onMouseOutOpacity = 0.67;
|
|
542 \$('#thumbs + i + ul.thumbs li').opacityrollover({
|
|
543 mouseOutOpacity: onMouseOutOpacity,
|
|
544 mouseOverOpacity: 1.0,
|
|
545 fadeSpeed: 'fast',
|
|
546 exemptionSelector: '.selected'
|
|
547 });
|
|
548
|
|
549 // Initialize Advanced Galleriffic Gallery
|
|
550 var gallery = \$('#thumbs'+i).galleriffic({
|
|
551 delay: 2500,
|
|
552 numThumbs: 22,
|
|
553 preloadAhead: 10,
|
|
554 enableTopPager: true,
|
|
555 enableBottomPager: true,
|
|
556 maxPagesToShow: 7,
|
|
557 imageContainerSel: '#slideshow'+ i,
|
|
558 controlsContainerSel: '#controls' + i,
|
|
559 captionContainerSel: '#caption' + i,
|
|
560 loadingContainerSel: '#loading' + i,
|
|
561 renderSSControls: true,
|
|
562 renderNavControls: true,
|
|
563 playLinkText: 'Play',
|
|
564 pauseLinkText: 'Pause',
|
|
565 prevLinkText: '‹ Previous',
|
|
566 nextLinkText: 'Next ›',
|
|
567 nextPageLinkText: 'Next ›',
|
|
568 prevPageLinkText: '‹ Prev',
|
|
569 enableHistory: false,
|
|
570 autoStart: false,
|
|
571 syncTransitions: true,
|
|
572 defaultTransitionDuration: 900,
|
|
573 onSlideChange: function(prevIndex, nextIndex) {
|
|
574 // 'this' refers to the gallery, which is an extension of \$('#thumbs')
|
|
575 this.find('ul.thumbs').children()
|
|
576 .eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
|
|
577 .eq(nextIndex).fadeTo('fast', 1.0);
|
|
578 },
|
|
579 onPageTransitionOut: function(callback) {
|
|
580 this.fadeTo('fast', 0.0, callback);
|
|
581 },
|
|
582 onPageTransitionIn: function() {
|
|
583 this.fadeTo('fast', 1.0);
|
|
584 }
|
|
585 });
|
|
586 });
|
|
587 });
|
|
588 </script>
|
|
589 </body>
|
|
590 </html>
|
|
591 ";
|
|
592 }
|
|
593
|
|
594 sub carousel
|
|
595 {
|
|
596 my ($file, $non_unique, $dir_root) = @_;
|
|
597 my $ac = 0;
|
|
598 print $file "
|
|
599 <div id=\"page\">
|
|
600 <div id=\"container\">
|
|
601 <div class=\"each-gallery\">
|
|
602 <div id=\"gallery\" class=\"content\">
|
|
603 <div id=\"controls0\" class=\"controls\"></div>
|
|
604 <div class=\"slideshow-container\">
|
|
605 <div id=\"loading0\" class=\"loader\"></div>
|
|
606 <div id=\"slideshow0\" class=\"slideshow\"></div>
|
|
607 </div>
|
|
608 <div id=\"caption0\" class=\"caption-container\">Reads randomly assigned</div>
|
|
609 </div>
|
|
610 <div id=\"thumbs0\" class=\"navigation\">
|
|
611 <input type=\"text\" id=\"myInput0\" onkeyup=\"search(this)\" placeholder=\"Search for names...\">
|
|
612 <ul class=\"thumbs noscript\">
|
|
613 ";
|
|
614 foreach my $u (@{$non_unique})
|
|
615 {
|
|
616 my $name = basename($u,'.png');
|
|
617 $u = $1 if $u =~ /$dir_root(.*)/;
|
|
618 print $file "
|
|
619 <li>
|
|
620 <a class=\"thumb\" href=\"$u\" title=\"$name\">$name</a>
|
|
621 </li>
|
|
622 ";
|
|
623 }
|
|
624 print $file "
|
|
625 </ul>
|
|
626 </div>
|
|
627 <div style=\"clear: both;\"></div></div>
|
|
628 </div>
|
|
629 </div>
|
|
630 ";
|
|
631 }
|
|
632
|
|
633 sub carousel2
|
|
634 {
|
|
635 my ($file, $unique, $non_unique, $dir_root) = @_;
|
|
636 print $file "
|
|
637 <div id=\"page\">
|
|
638 <div id=\"container\">
|
|
639 <div class=\"each-gallery\">
|
|
640 <div id=\"gallery\" class=\"content\">
|
|
641 <div id=\"controls0\" class=\"controls\"></div>
|
|
642 <div class=\"slideshow-container\">
|
|
643 <div id=\"loading0\" class=\"loader\"></div>
|
|
644 <div id=\"slideshow0\" class=\"slideshow\"></div>
|
|
645 </div>
|
|
646 <div id=\"caption0\" class=\"caption-container\">Uniquely mapped reads</div>
|
|
647 </div>
|
|
648 <div id=\"thumbs0\" class=\"navigation\">
|
|
649 <input type=\"text\" id=\"myInput0\" onkeyup=\"search(this)\" placeholder=\"Search for names...\">
|
|
650 <ul class=\"thumbs noscript\">
|
|
651 ";
|
|
652
|
|
653 foreach my $u (@{$unique})
|
|
654 {
|
|
655 my $name = basename($u,'.png');
|
|
656 $u = $1 if $u =~ /$dir_root(.*)/;
|
|
657 print $file "
|
|
658 <li>
|
|
659 <a class=\"thumb\" href=\"$u\" title=\"$name\">$name</a>
|
|
660 </li>
|
|
661 ";
|
|
662 }
|
|
663 print $file "
|
|
664 </ul>
|
|
665 </div>
|
|
666 </div>
|
|
667 <div id=\"page\">
|
|
668 <div id=\"container\">
|
|
669 <div class=\"each-gallery\">
|
|
670 <div id=\"gallery\" class=\"content\">
|
|
671 <div id=\"controls1\" class=\"controls\"></div>
|
|
672 <div class=\"slideshow-container\">
|
|
673 <div id=\"loading1\" class=\"loader\"></div>
|
|
674 <div id=\"slideshow1\" class=\"slideshow\"></div>
|
|
675 </div>
|
|
676 <div id=\"caption1\" class=\"caption-container\">Reads randomly assigned</div>
|
|
677 </div>
|
|
678 <div id=\"thumbs1\" class=\"navigation\">
|
|
679 <input type=\"text\" id=\"myInput1\" onkeyup=\"search(this)\" placeholder=\"Search for names...\">
|
|
680 <ul class=\"thumbs noscript\">
|
|
681 ";
|
|
682
|
|
683 foreach my $nu (@{$non_unique})
|
|
684 {
|
|
685 my $name = basename($nu,'.png');
|
|
686 $nu = $1 if $nu =~ /$dir_root(.*)/;
|
|
687 print $file "
|
|
688 <li>
|
|
689 <a class=\"thumb\" href=\"$nu\" title=\"$name\">$name</a>
|
|
690 </li>
|
|
691 ";
|
|
692 }
|
|
693 print $file "
|
|
694 </ul>
|
|
695 </div>
|
|
696 <div style=\"clear: both;\"></div></div>
|
|
697 </div>
|
|
698 </div>
|
|
699 ";
|
|
700 }
|
|
701
|
|
702 sub futurette
|
|
703 {
|
|
704 my ($file, $name, $png, $hash) = @_;
|
|
705 print $file "
|
|
706 <div class=\"container\">
|
|
707 <div class=\"featurette\">
|
|
708 <h1>$name</h1>
|
|
709 <p class=\"featurette-p\">
|
|
710 ";
|
|
711 foreach my $k (sort keys %{$hash})
|
|
712 {
|
|
713 print $file "<A HREF=\"".${$hash}{$k}."\">$k</A><br/> \n" ;
|
|
714 }
|
|
715
|
|
716 print $file "
|
|
717 </p>";
|
|
718
|
|
719 foreach my $pn (@{$png}){print $file "<img class=\"featurette-image\" src=\"$pn\"/><br />";}
|
|
720
|
|
721 print $file "
|
|
722 </div>
|
|
723 </div>
|
|
724 ";
|
|
725 }
|
|
726
|
|
727 sub fut
|
|
728 {
|
|
729 my ($file, $name, $hash) = @_;
|
|
730 print $file "
|
|
731 <div class=\"container\">
|
|
732 <div class=\"featurette\">
|
|
733 <h1>$name</h1>
|
|
734 <p class=\"featurette-p\">
|
|
735 ";
|
|
736
|
|
737 foreach my $k (sort { ${$hash}{$a} cmp ${$hash}{$b} } keys %{$hash})
|
|
738 {
|
|
739 print $file "<A HREF=\"".${$hash}{$k}."\">$k</A><br/> \n" ;
|
|
740 }
|
|
741
|
|
742 print $file "
|
|
743 </p>
|
|
744 </div>
|
|
745 </div>
|
|
746 ";
|
|
747 }
|
|
748
|
|
749 sub get_distri_exon
|
|
750 {
|
|
751 my ($dir, $name) = @_;
|
|
752 my (@out,@group);
|
|
753 my $group = $dir.'/'.$name.'-subgroups-bonafide_reads-transcripts-*distribution-*.png';
|
|
754 @group = glob $group;
|
|
755 foreach (my $g =0; $g <= $#group; $g++)
|
|
756 {
|
|
757 if ($group[$g] =~ /.*($name-subgroups-bonafide_reads-transcripts-.*distribution-.*\.png)/ )
|
|
758 {
|
|
759 my $tmp = $1;
|
|
760 push @out, $1;
|
|
761 }
|
|
762 }
|
|
763 return (\@out);
|
|
764 }
|
|
765
|
|
766 sub get_distri_TE
|
|
767 {
|
|
768 my ($dir, $name) = @_;
|
|
769 my (@out,@group);
|
|
770 my $group = $dir.'/'.$name.'-subgroups-bonafide_reads-TE-*distribution-*.png';
|
|
771 @group = glob $group;
|
|
772 foreach (my $g =0; $g <= $#group; $g++)
|
|
773 {
|
|
774 if ($group[$g] =~ /.*($name-subgroups-bonafide_reads-TE-.*distribution-.*\.png)/ )
|
|
775 {
|
|
776 my $tmp = $1;
|
|
777 push @out, $1;
|
|
778 }
|
|
779 }
|
|
780 return (\@out);
|
|
781 }
|
|
782
|
|
783 sub get_PPP
|
|
784 {
|
|
785 my ($dir,$name) = @_;
|
|
786 my (%distri,@group);
|
|
787 my $group = $dir.'/'.$name.'-subgroups-bonafide_reads-TE-PPPartners-*';
|
|
788 @group = glob $group;
|
|
789
|
|
790 foreach (my $g =0; $g <= $#group; $g++)
|
|
791 {
|
|
792 if ($group[$g] =~ /.*($name-subgroups-bonafide_reads-TE-PPPartners-.*)/ )
|
|
793 {
|
|
794 my $tmp = $1;
|
|
795 if ($tmp =~ /PPPartners-(.*?)-sens\.txt$/)
|
|
796 {
|
|
797 $distri{$1} = ['','','','','',''] unless exists $distri{$1};
|
|
798 $distri{$1}->[0] = $tmp;
|
|
799 }
|
|
800 elsif ($tmp =~ /PPPartners-(.*?)-antisens\.txt$/)
|
|
801 {
|
|
802 $distri{$1} = ['','','','','',''] unless exists $distri{$1};
|
|
803 $distri{$1}->[1] = $tmp;
|
|
804 }
|
|
805 elsif ($tmp =~ /PPPartners-(.*?)-sensPPP\.txt$/)
|
|
806 {
|
|
807 $distri{$1} = ['','','','','',''] unless exists $distri{$1};
|
|
808 $distri{$1}->[2] = $tmp;
|
|
809 }
|
|
810 elsif ($tmp =~ /PPPartners-(.*?)-antisensPPP\.txt$/)
|
|
811 {
|
|
812 $distri{$1} = ['','','','','',''] unless exists $distri{$1};
|
|
813 $distri{$1}->[3] = $tmp;
|
|
814 }
|
|
815 elsif ($tmp =~ /PPPartners-(.*?)-overlap_size\.txt$/)
|
|
816 {
|
|
817 $distri{$1} = ['','','','','',''] unless exists $distri{$1};
|
|
818 $distri{$1}->[4] = $tmp;
|
|
819 }
|
|
820 elsif ($tmp =~ /PPPartners-(.*?)-histogram\.png$/)
|
|
821 {
|
|
822 $distri{$1} = ['','','','','',''] unless exists $distri{$1};
|
|
823 $distri{$1}->[5] = $tmp;
|
|
824 }
|
|
825 }
|
|
826 }
|
|
827 return \%distri;
|
|
828 }
|
|
829
|
|
830 sub PPPrint
|
|
831 {
|
|
832 my ($h, $hash) = @_;
|
|
833 my $cmp = 0;
|
|
834
|
|
835 print $h "<div class=\"container\">\n";
|
|
836 print $h "<div class=\"row text-center\">";
|
|
837 while ( my ($k,$v) = each %{$hash} )
|
|
838 {
|
|
839 print $h "</div><div class=\"row text-center\">" if $cmp != 0 && $cmp % 2 == 0;
|
|
840 print $h "
|
|
841
|
|
842 <div class=\"span6\">
|
|
843 <h2>$k</h2>
|
|
844 <p class=\"featurette-p\"> <img src=\"$v->[5]\"/></p>
|
|
845 <p class=\"featurette-p\"><a href=\"$v->[4]\">ping pong signature</a></p>
|
|
846 <p class=\"featurette-p\"><a href=\"$v->[2]\">sense reads with PPP</a></p>
|
|
847 <p class=\"featurette-p\"><a href=\"$v->[3]\">reverse reads with PPP</a></p>
|
|
848 <p class=\"featurette-p\"><a href=\"$v->[0]\">sense reads without PPP</a></p>
|
|
849 <p class=\"featurette-p\"><a href=\"$v->[1]\">reverse reads without PPP</a></p>
|
|
850 </div>
|
|
851 ";
|
|
852 $cmp++;
|
|
853 }
|
|
854
|
|
855 print $h "</div></div>";
|
|
856 }
|
|
857
|
|
858 sub printDistri
|
|
859 {
|
|
860 my ($h, $tab) = @_;
|
|
861 my ($txt, $name);
|
|
862 my $cmp = 0;
|
|
863 print $h "<div class=\"container\">\n";
|
|
864 print $h "<div class=\"row text-center\">";
|
|
865 foreach my $k (@{$tab})
|
|
866 {
|
|
867 if ($k =~ /(.*)-(.*)\.png$/)
|
|
868 {
|
|
869 $txt = $1.'-'.$2.'.txt';
|
|
870 $name = $2;
|
|
871 }
|
|
872 print $h "</div><div class=\"row text-center\">" if $cmp != 0 && $cmp % 2 == 0;
|
|
873 print $h "
|
|
874
|
|
875 <div class=\"span6\">
|
|
876 <h2>$name</h2>
|
|
877 <p> <img src=\"$k\"/></p>
|
|
878 <p class=\"featurette-p\"><a href=\"$txt\">text file</a></p>
|
|
879 </div>
|
|
880 ";
|
|
881 $cmp++;
|
|
882 }
|
|
883
|
|
884 print $h "</div></div>";
|
|
885 }
|
|
886
|
|
887 sub mapnum
|
|
888 {
|
|
889 my $dupmapnum = shift;
|
|
890 my $dupnum_genome = shift;
|
|
891 open (my $dupTE, $dupmapnum) || die "cannot open ".$dupmapnum."\n";
|
|
892 my %dupnum_TE = ();
|
|
893 my $header = <$dupTE>;
|
|
894 while (<$dupTE>)
|
|
895 {
|
|
896 chomp $_;
|
|
897 my @dupline = split /\t/, $_;
|
|
898 $dupnum_TE{$dupline[0]} = $dupline[2];
|
|
899 }
|
|
900 close $dupTE;
|
|
901 open (my $du_TE, '>'.$dupmapnum) || die "cannot open to write ".$dupmapnum."\n";
|
|
902 print $du_TE "sequence\tduplicate\tgenome map num\tmap num\n";
|
|
903 while (my ($k, $v) = each %dupnum_TE )
|
|
904 {
|
|
905 my $hashRef = ${$dupnum_genome}{$k};
|
|
906 print $du_TE "$k\t$hashRef->[0]\t$hashRef->[1]\t$v\n";
|
|
907 }
|
|
908 close $du_TE;
|
|
909 }
|
|
910
|
|
911 1;
|