150 void generate_summary_header(FILE* html_output)
157 template <
typename StatsType>
158 void generate_summary_cell(FILE* html_output,
const std::string file_name,
const char* type,
const StatsType&
stats,
const uint32 n)
160 char link_name[1024];
161 sprintf( link_name,
"<a href=\"%s\">%s</a>",
local_file( file_name ), type );
183 const std::string distant_mapped_bps_name =
generate_file_name( report,
"distant_stats.mapped-bps" );
185 const std::string distant_mapQ_name =
generate_file_name( report,
"distant_stats.mapQ" );
186 const std::string distant_mms_name =
generate_file_name( report,
"distant_stats.mms" );
187 const std::string distant_ins_name =
generate_file_name( report,
"distant_stats.ins" );
188 const std::string distant_dels_name =
generate_file_name( report,
"distant_stats.dels" );
189 const std::string distant_pos_name =
generate_file_name( report,
"distant_stats.pos" );
191 const std::string discordant_mapped_bps_name =
generate_file_name( report,
"discordant_stats.mapped-bps" );
192 const std::string discordant_ed_name =
generate_file_name( report,
"discordant_stats.ed" );
193 const std::string discordant_mapQ_name =
generate_file_name( report,
"discordant_stats.mapQ" );
194 const std::string discordant_mms_name =
generate_file_name( report,
"discordant_stats.mms" );
195 const std::string discordant_ins_name =
generate_file_name( report,
"discordant_stats.ins" );
196 const std::string discordant_dels_name =
generate_file_name( report,
"discordant_stats.dels" );
197 const std::string discordant_pos_name =
generate_file_name( report,
"discordant_stats.pos" );
223 FILE* html_output = fopen( report,
"w" );
224 if (html_output == NULL)
226 log_warning( stderr,
"unable to write HTML report \"%s\"\n", report );
234 const uint32 HI_MAPQ_BIN = 6;
238 const char* meta_list =
"<meta http-equiv=\"refresh\" content=\"5\" />";
248 html::table_object table( html_output,
"alignment-stats",
"stats",
"alignment stats" );
290 html::table_object table( html_output,
"discordance-stats",
"stats",
"discordance stats" );
300 html::td_object( html_output,
html::FORMATTED, NULL,
"%.2f M (%.2f M)",
float(cum_different_ref[0]) * 1.0e-6f,
float(cum_different_ref[HI_MAPQ_BIN]) * 1.0e-6f );
301 html::td_object( html_output,
html::FORMATTED, NULL,
"%5.2f %% (%.3f %%)", 100.0f *
float(cum_different_ref[0]) /
float(n), 100.0f *
float(cum_different_ref[HI_MAPQ_BIN]) /
float(n) );
306 html::td_object( html_output,
html::FORMATTED, NULL,
"%.2f M (%.2f M)",
float(cum_distant[0]) * 1.0e-6f,
float(cum_distant[HI_MAPQ_BIN]) * 1.0e-6f );
307 html::td_object( html_output,
html::FORMATTED, NULL,
"%5.2f %% (%.3f %%)", 100.0f *
float(cum_distant[0]) /
float(n), 100.0f *
float(cum_distant[HI_MAPQ_BIN]) /
float(n) );
312 html::td_object( html_output,
html::FORMATTED, NULL,
"%.2f M (%.2f M)",
float(cum_discordant[0]) * 1.0e-6f,
float(cum_discordant[HI_MAPQ_BIN]) * 1.0e-6f );
313 html::td_object( html_output,
html::FORMATTED, NULL,
"%5.2f %% (%.3f %%)", 100.0f *
float(cum_discordant[0]) /
float(n), 100.0f *
float(cum_discordant[HI_MAPQ_BIN]) /
float(n) );
321 generate_summary_header( html_output );
323 generate_summary_cell( html_output, ed_name,
"edit distance",
al_stats.
lower_ed, n );
325 generate_summary_cell( html_output, mms_name,
"mismatches",
al_stats.
lower_mms, n );
326 generate_summary_cell( html_output, ins_name,
"insertions",
al_stats.
lower_ins, n );
330 generate_summary_header( html_output );
332 generate_summary_cell( html_output, distant_ed_name,
"edit distance [distant]",
distant_stats.
lower_ed, n );
334 generate_summary_cell( html_output, distant_mms_name,
"mismatches [distant]",
distant_stats.
lower_mms, n );
335 generate_summary_cell( html_output, distant_ins_name,
"insertions [distant]",
distant_stats.
lower_ins, n );
339 generate_summary_header( html_output );
341 generate_summary_cell( html_output, discordant_ed_name,
"edit distance [discordant]",
discordant_stats.
lower_ed, n );
353 "mapped (L \\ R) vs (R \\ L)",
364 "unique (L \\ R) vs (R \\ L)",
375 "ambiguous (L \\ R) vs (R \\ L)",
386 "different reference by mapQ",
404 "discordant by mapQ",
411 fclose( html_output );