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