Пример #1
0
 def test_table_no_header(self):
     t = Table(('Key', 'Value'))
     t.add_row(Key="Employee name", Value="John Doe")
     self.assertEqual(
         t.html(), "<table>\n"
         "<tr><th>Key</th><th>Value</th></tr>\n"
         "<tr><td>Employee name</td><td>John Doe</td></tr>\n"
         "</table>")
     t.no_header()
     self.assertEqual(
         t.html(), "<table>\n"
         "<tr><td>Employee name</td><td>John Doe</td></tr>\n"
         "</table>")
Пример #2
0
    toc.add(toc_list)

    # Files
    files_info = report.add_section("Stats files")
    stats_files = "Statistics: %s" % Link(
        "[TSV]", os.path.relpath(stats_file, os.path.dirname(out_file)))
    if xlsx_file is not None:
        stats_files += " | %s" % Link(
            "[XLSX]", os.path.relpath(xlsx_file, os.path.dirname(out_file)))
    files_info.add(stats_files)
    toc_list.add_item(Link(files_info.title, files_info))

    # General info
    general_info = report.add_section("General info", name="general_info")
    tbl = Table(columns=('name', 'value'))
    tbl.no_header()
    data_items = (('Total #reads', 'total_reads'), ('Total assigned #reads',
                                                    'total_assigned_reads'),
                  ('Total #barcodes', 'total_barcodes'), ('Assigned #barcodes',
                                                          'assigned_barcodes'))
    for item in data_items:
        name, key = item
        tbl.add_row(name=name, value=data[key])
    general_info.add(tbl)

    # Reads at each stage
    cols = ['Nreads', 'Nreads_filtered', 'Nreads_trimmed']
    if contaminant_filtered:
        cols.append('Nreads_contaminant_filtered')
    plot_filen = os.path.join(out_dir, "reads_per_stage.png")
    reads_per_stage = \