annotate bin/html.pm @ 4:bbe202c54a29 draft

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