def make_DataAnnPkg_page(c): pkg_to_Y = stats_utils.make_package_reports(c, 'annotation', main_page_file, main_page_title) out = open(main_page_file, 'w') stats_utils.write_top_asHTML(out, main_page_title, 'main.css') out.write('<BODY>\n') stats_utils.write_topright_links_asHTML(out, 'index.html', 'Download stats for Bioconductor Software packages', 'data-experiment.html', 'Download stats for Bioconductor experiment packages') out.write('<H1 style="text-align: center;">%s</H1>\n' % main_page_title) stats_utils.write_timestamp_asHTML(out) out.write('<P><I>') out.write('This page monitors Bioconductor annotation package ') out.write('downloads from http://bioconductor.org/ over the last ') out.write('12 months. ') out.write('The number reported next to each package name is the ') out.write('<B>number of distinct IPs that “hit” the ') out.write('package over the last 12 months.</B> ') #out.write('Core packages (i.e. the BiocInstaller package + ') #out.write('packages that get installed the first time ') #out.write('<A href="%s">biocLite()</A> is called ' % \ # 'http://bioconductor.org/docs/install/') #out.write('with no arguments) are reported <B>in bold</B>.') out.write('</I></P>\n') out.write('<HR>\n') # Top 30 out.write('<H2>%s</H2>\n' % 'Top 30') stats_utils.write_TotalDownloadsPerPkg_TABLE(out, 'annotation', pkg_to_Y.keys(), pkg_to_Y, True, 30) out.write('<HR>\n') # All annotation packages out.write('<H2>%s</H2>' % 'All annotation packages') stats_utils.write_DownloadsPerMonth_TABLE(c, out, 'All annotation packages', "biocrepo='annotation'", 'all_annotation_packages.png') stats_utils.write_AlphabeticalIndex(out, 'annotation', pkg_to_Y) out.write('</BODY>\n') out.write('</HTML>\n') out.close() return
def make_SoftwarePkg_page(c): pkg_to_Y = stats_utils.make_package_reports(c, 'bioc', main_page_file, main_page_title) out = open(main_page_file, 'w') stats_utils.write_top_asHTML(out, main_page_title, 'main.css') out.write('<BODY>\n') stats_utils.write_topright_links_asHTML(out, 'data-annotation.html', 'Download stats for Bioconductor annotation packages', 'data-experiment.html', 'Download stats for Bioconductor experiment packages') out.write('<H1 style="text-align: center;">%s</H1>\n' % main_page_title) stats_utils.write_timestamp_asHTML(out) out.write('<P><I>') out.write('This page monitors Bioconductor Software package ') out.write('downloads from http://bioconductor.org/ over the last ') out.write('12 months. ') out.write('The number reported next to each package name is the ') out.write('<B>number of distinct IPs that “hit” the ') out.write('package over the last 12 months.</B> ') out.write('Core packages (i.e. the BiocInstaller package + ') out.write('packages that get installed the first time ') out.write('<A href="%s">biocLite()</A> is called ' % \ 'http://bioconductor.org/docs/install/') out.write('with no arguments) are reported <B>in bold</B>.') out.write('</I></P>\n') out.write('<HR>\n') # Top 50 out.write('<H2>%s</H2>\n' % 'Top 50') stats_utils.write_TotalDownloadsPerPkg_TABLE(out, 'bioc', pkg_to_Y.keys(), pkg_to_Y, True, 50) out.write('<HR>\n') # All Software packages out.write('<H2>%s</H2>' % 'All Software packages') stats_utils.write_DownloadsPerMonth_TABLE(c, out, 'All Software packages', "biocrepo='bioc'", 'all_bioc_packages.png') stats_utils.write_AlphabeticalIndex(out, 'bioc', pkg_to_Y) out.write('</BODY>\n') out.write('</HTML>\n') out.close() return
def make_main_page(): out = open(main_page_file, 'w') stats_utils.write_top_asHTML(out, main_page_title, 'main.css') out.write('<BODY>\n') out.write('<H1 style="text-align: center;">%s</H1>\n' % main_page_title) out.write('<H2>Global stats</H2>') title = 'All packages' barplot_file = 'all_packages.png' stats_utils.write_DownloadsPerMonth_TABLE(c, out, title, "package IS NOT NULL", barplot_file, 700000) title = 'All Software packages' barplot_file = 'all_bioc_packages.png' stats_utils.write_DownloadsPerMonth_TABLE(c, out, title, "biocrepo='bioc'", barplot_file, 700000) title = 'All Annotation, CDF and Probe packages' barplot_file = 'all_data_annotation_packages.png' stats_utils.write_DownloadsPerMonth_TABLE(c, out, title, "biocrepo='annotation'", barplot_file, 700000) title = 'All Experiment Packages' barplot_file = 'all_data_experiment_packages.png' stats_utils.write_DownloadsPerMonth_TABLE(c, out, title, "biocrepo='experiment'", barplot_file, 700000) out.write('<H2>%s</H2>' % 'Software packages') pkg_to_Y = stats_utils.make_package_reports(c, 'bioc', main_page_file, main_page_title) stats_utils.write_TotalDownloadsPerPkg_TABLE(out, 'bioc', pkg_to_Y.keys(), pkg_to_Y) out.write('<H2>%s</H2>' % 'Annotation, CDF and Probe packages') pkg_to_Y = stats_utils.make_package_reports(c, 'annotation', main_page_file, main_page_title) stats_utils.write_TotalDownloadsPerPkg_TABLE(out, 'annotation', pkg_to_Y.keys(), pkg_to_Y) out.write('<H2>%s</H2>' % 'Experiment packages') pkg_to_Y = stats_utils.make_package_reports(c, 'experiment', main_page_file, main_page_title) stats_utils.write_TotalDownloadsPerPkg_TABLE(out, 'experiment', pkg_to_Y.keys(), pkg_to_Y) out.write('</BODY>\n') out.write('</HTML>\n') out.close() return
def makeDownloadStatsHTML(): os.chdir(biocrepo_dirpath) stats_utils.make_package_HTML_reports(biocrepo, from_year, to_year, "../../", index_page_title) stats_utils.make_biocrepo_HTML_report(biocrepo_page, biocrepo_page_title, biocrepo, from_year, to_year, "../", index_page_title) ## ------ Make the index page ------ ## out = open(os.path.join('..', index_page), 'w') stats_utils.write_top_asHTML(out, index_page_title, 'main.css') out.write('<BODY>\n') stats_utils.write_topright_links_asHTML( out, 'data-annotation.html', 'Bioconductor annotation packages', 'data-experiment.html', 'Bioconductor experiment packages', 'workflows.html', 'Bioconductor workflow packages') out.write('<H1 style="text-align: center;">%s</H1>\n' % index_page_title) stats_utils.write_timestamp_asHTML(out) #out.write('<P style="text-align: center">') out.write('<P>') out.write('The number reported next to each package name is the ') out.write('<I>download score</I>, that is, the average number of ') out.write('distinct IPs that “hit” the package each month ') out.write('for the last 12 months (not counting the current month). ') #out.write('Packages <B>in bold</B> are the default Bioconductor packages ') #out.write('(i.e. the BiocInstaller package + the packages that get ') #out.write('installed the first time <A HREF="%s">biocLite()</A> is ' % \ # 'https://bioconductor.org/docs/install/') #out.write('called with no arguments).') out.write('</P>\n') out.write('<HR>\n') ## Top 75. out.write('<H2>%s</H2>\n' % 'Top 75') stats_utils.write_HTML_top_packages(out, biocrepo, allpkg_scores_filename, 75) out.write('<HR>\n') ## All software packages. out.write('<H2>All %s packages</H2>' % biocrepo_label) #out.write('<P style="text-align: center">') out.write('<P>') out.write('All %s package stats in one file: ' % biocrepo_label) out.write('<A HREF="%s/%s">%s</A>' \ % (biocrepo_subdir, allpkg_stats_filename, allpkg_stats_filename)) out.write('</P>\n') #out.write('<P style="text-align: center">') out.write('<P>') out.write('All %s package download scores in one file: ' \ % biocrepo_label) out.write('<A HREF="%s/%s">%s</A>' \ % (biocrepo_subdir, allpkg_scores_filename, allpkg_scores_filename)) out.write('</P>\n') biocrepo_page_href = '%s/%s' % (biocrepo_subdir, biocrepo_page) out.write('<P style="text-align: center"><A HREF="%s">%s</A></P>\n' \ % (biocrepo_page_href, 'See ' + biocrepo_page_title)) stats_utils.write_HTML_package_alphabetical_index(out, biocrepo, allpkg_scores_filename) out.write('</BODY>\n') out.write('</HTML>\n') out.close() return
def makeDownloadStatsHTML(): os.chdir(biocrepo_dirpath) stats_utils.make_package_HTML_reports(biocrepo, from_year, to_year, '../../%s' % index_page, index_page_title) stats_utils.make_biocrepo_HTML_report(biocrepo_page, biocrepo_page_title, biocrepo, from_year, to_year, '../%s' % index_page, index_page_title) ## ------ Make the index page ------ ## out = open(os.path.join('..', index_page), 'w') stats_utils.write_top_asHTML(out, index_page_title, 'main.css') out.write('<BODY>\n') stats_utils.write_topright_links_asHTML( out, 'index.html', 'Bioconductor software packages', 'data-annotation.html', 'Bioconductor annotation packages', 'data-experiment.html', 'Bioconductor experiment packages') out.write('<H1 style="text-align: center;">%s</H1>\n' % index_page_title) stats_utils.write_timestamp_asHTML(out) #out.write('<P style="text-align: center">') out.write('<P>') out.write('The number reported next to each package name is the ') out.write('<I>download score</I>, that is, the average number of ') out.write('distinct IPs that “hit” the package each month ') out.write('for the last 12 months (not counting the current month). ') out.write('</P>\n') #out.write('<HR>\n') ## Top 15. #out.write('<H2>%s</H2>\n' % 'Top 15') # #stats_utils.write_HTML_top_packages(out, biocrepo, # allpkg_scores_filename, 15) # #out.write('<HR>\n') ## All workflow packages. #out.write('<H2>All %s packages</H2>' % biocrepo_label) #out.write('<P style="text-align: center">') out.write('<P>') out.write('All %s package stats in one file: ' % biocrepo_label) out.write('<A HREF="%s/%s">%s</A>' \ % (biocrepo_subdir, allpkg_stats_filename, allpkg_stats_filename)) out.write('</P>\n') #out.write('<P style="text-align: center">') out.write('<P>') out.write('All %s package download scores in one file: ' \ % biocrepo_label) out.write('<A HREF="%s/%s">%s</A>' \ % (biocrepo_subdir, allpkg_scores_filename, allpkg_scores_filename)) out.write('</P>\n') biocrepo_page_href = '%s/%s' % (biocrepo_subdir, biocrepo_page) out.write('<P style="text-align: center"><A HREF="%s">%s</A></P>\n' \ % (biocrepo_page_href, 'See ' + biocrepo_page_title)) #stats_utils.write_HTML_package_alphabetical_index(out, biocrepo, # allpkg_scores_filename) pkg2score = stats_utils.load_pkg2score(allpkg_scores_filename) pkgs = pkg2score.keys() stats_utils.write_HTML_package_index(out, biocrepo, pkgs, pkg2score) out.write('</BODY>\n') out.write('</HTML>\n') out.close() return