annotate bin/html.pm @ 13:98b4a5ec8e63 draft

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